Data Provider Use Case: TabbedView usage

Official Content
This documentation is valid for:

The procedural way of loading an SDT (like the one needed in the TabbedView Web Component) is:

Event Start
    ...
    &Tabs = new()
    &TabsItem = new()
    &TabsItem.Code = 'General'
    &TabsItem.Description = 'General info'
    &TabsItem.Link = link(ViewCustomer, CustomerId, 'General'
    &TabsItem.WebComponent = create(CustomerGeneral, CustomerId)
    &Tabs.add(&TabsItem)
    &TabsItem = new()
    &TabsItem.Code = 'Invoices'
    &TabsItem.Description = 'Invoices'
    &TabsItem.Link = link(ViewCustomer, CustomerId, 'Invoices'
    &TabsItem.WebComponent = create(CustomerInvoices, CustomerId)
    &Tabs.add(&TabsItem)
    ...
    TabWC.Object = Create(TabbedView, &Tabs)
EndEvent

Using Data Providers, the declarative way is:

LoadCustomerTabs
Tabs
{ 
   TabOptionsItem
   {
      Code           = 'General'
      Description    = 'General info'
      Link           = link(ViewCustomer, CustomerId, 'General'
      WebComponent   = create(CustomerGeneral, CustomerId)
   } 
   TabOptionsItem
   {
      Code           = 'Invoices'
      Description    = 'Invoices'
      Link           = link(ViewCustomer, CustomerId, 'Invoices'
      WebComponent   = create(CustomerInvoices, CustomerId)
   }
} 

So the Event Start becomes:

Event Start
   &Tabs = LoadCustomerTabs()
   TabWC.Object = Create(TabbedView, &Tabs)
Endevent








Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.