cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Add Tabs Dynamically

rcolcombet
3-Visitor

Add Tabs Dynamically

I want to create tabs dynamically. Basically when I click on a button a new tab is added with the same template as what was set. The tabs will represent objects and they will contain information about the object. Is this possible?

From the research I did it's only possible to hide the tabs making them appear with an event. But that would mean I know at the begin the total number of tabs, thing I don't know. This solution it will not work.

1 ACCEPTED SOLUTION

Accepted Solutions

You can certainly create a custom widget/extension for ThingWorx to add functionality that you need. There is documentation available to help developers get started on custom widget development.

 

Widgets in ThingWorx Applications 

ThingWorx Extension Development Guide 

 

Another alternative that might be possible for your use case is to use a Menu widget and use the Data Driven setting of the ConfiguredOrDataDriven widget property. You might be able to dynamically update the menu with new selections and use the menu options to perform changes in the body of the mashup (or maybe even change mashups if needed). 

 

For example, your mashup might have just one form and each menu option is just another "copy" of that form. You might be able to write service logic to save/populate/clear that single form based on what menu item you have selected and what data you saved to the user's session.

View solution in original post

3 REPLIES 3

Hi rcolcombet,

 

This is not currently possible with Tabs. Depending on your use case you might be able to get something similar by using the Collection widget.

 

The Collection widget takes a set of data and repeats a mashup for each row of data. Each instance of the mashup that is shown will contain an instance of this row data (if configured correctly). You would create a mashup that represents the body of your "tab" and then set it as the mashup to use in the collection. You then could have a button outside the collection that adds more rows/info into the data set so it adds more instances of the mashup in the collection.

 

 

Thank you @abrigode !
It seems a good solution! However it bothers me that the information of the various objects appear on the same screen all together...
Is it possible to custom a widget and implement the tab system I wish?

You can certainly create a custom widget/extension for ThingWorx to add functionality that you need. There is documentation available to help developers get started on custom widget development.

 

Widgets in ThingWorx Applications 

ThingWorx Extension Development Guide 

 

Another alternative that might be possible for your use case is to use a Menu widget and use the Data Driven setting of the ConfiguredOrDataDriven widget property. You might be able to dynamically update the menu with new selections and use the menu options to perform changes in the body of the mashup (or maybe even change mashups if needed). 

 

For example, your mashup might have just one form and each menu option is just another "copy" of that form. You might be able to write service logic to save/populate/clear that single form based on what menu item you have selected and what data you saved to the user's session.

Top Tags