I think you will find your answer in this blog from Jonathan Robbins.
It is quite some code - too much to copy here. An overview of what is all in his example:
- SubPageCode rendering
- The Border
Border
rendering adds a Placeholder for the other renderings. - The MessageBar
MessageBar
is used to display messages - AdvancedExpander
AdvancedExpander
datasources the ‘SampleOrdersAccordion’SampleOrdersAccordion
Item we created earlier. The next four renderings are added to this AdvancedExpander‘s placeholder. - The ListControl
ListControl
is responsible for displaying the data - Set the Datasource
Datasource
the SampleOrders ListControlSampleOrders ListControl
item - Items field looks at the data provider to know what to display e.g. {Binding SampleOrdersDataProvider.cidata}
{Binding SampleOrdersDataProvider.cidata}
. - ProgressIndicator
ProgressIndicator
displays a loading indicator for the ListControlListControl
- Set it’s Target
Target
property to the IdId
of the ListControlListControl
- IsBusy
IsBusy
property is wired to the following GenericDataProviderGenericDataProvider
e.g. {Binding SampleOrdersDataProvider.IsBusy}{Binding SampleOrdersDataProvider.IsBusy}
- Finally it datasourced to the out-of-the-box ProgressIndicator
ProgressIndicator
Item. - GenericDataProvider
GenericDataProvider
actually holds the data we are loading and displaying. Datasourced to an Item called DataProviderForListControlDataProviderForListControl
– {6CD06869-4264-420C-A161-3220DD3AB7BA}{6CD06869-4264-420C-A161-3220DD3AB7BA}
- Border
Border
adds a placeholder for a ‘see more’ button is more data is available than the page size. - To set this conditional visibility set the IsVisible
IsVisible
field to a property of the DataProviderDataProvider
denoting if there is more data available than the page – {Binding SampleOrdersDataProvider.HasMoreData}{Binding SampleOrdersDataProvider.HasMoreData}
- The Button
Button
facilitates pagination of the data, its ClickClick
event field set to a preexisting JavaScript Method – javascript:app.SampleOrdersDataProvider.nextListData()javascript:app.SampleOrdersDataProvider.nextListData()
.