25
Views
1
Comments
Using IF and Integers to generate dynamic tabs
Question

Outsystems 11

Using tabs control / reactive web application


I have a scenario as follows:


Data aggregation builds me a list of content fields ordered by an Order attribute.
       (Eg

Order | description | item

           1 | lunch | taco 

           2 | Side | salad 

           3 | Drink | Beer

I want to loop through the list to create the tabs and content 


  Tab 1

         

          Tab name = lunch 

           Content = taco

   Tab 2 

          

           Tab name = Side 

            Tab Content = Salad 

I used IF statements as follows to iterate through (knowing I’d have 3 tabs):

   If getorderlist.current.Order = 1
           True

                    Tabname = description
                     Content = item

It seems to get lost on this method tracking the different columns between the numbers. Has anyone seen issues with the tab control and or if statements?

Is there a better way that would also ensure completeness and accuracy? Is there a way to do a for loop instead where I could just iterate through for all entities (filtering of course to prevent too many tabs as generally we would only have 1-10.


mvp_badge
MVP
Rank: #91

Hi Jeremy,

I have created a sample application- DynamicTab demonstrating the implementation for the mentioned use-case.

See the attached .oml solution file


Hope this helps you!


Regards,

Benjith Sam

ReactiveDynamicTab.oml