User:anonymousLog inRegister
Recents:
Data Provider Use Case: TabbedView usage

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




Created: 07/20/07 08:23 PM by jnj Last update: 01/27/09 05:41 PM by lcpc2009
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)