cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK bind data to the List picker control from the rule

learner1
Explorer
0 Kudos

Hi Experts, @bill_froelich 

I am trying to call the OData from the Rule and bind the results to List Picker control. Rule is executing when the page is loaded and  getting the error as no Data providers exists, it's due to the Page is loaded before the Service is initialized. Now I am calling the OData services after the Success Action of the InitializeOnline.action and setting the data to the ListPicker using the setPickerItems(items). 

But this is making the list screen hanging as the screen is loading all the records that are set using setPickerItems method and no paging working here. I don't want to bind the entityset as a target to the list picker as I want to use the search functionality and filter the values within the list picker results screen without making an Odata call again when I type a text. 

Is there any option to call the OData after the click of ListPicker, store all the records from the response in client data and bind the string collection or object collection to List Picker without loosing the paging feature

#MDK, #SAP MDK ListPicker

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Is the list picker on the main page of the application?
View Entire Topic
learner1
Explorer
0 Kudos

Hi @bill_froelich thanks for the reply. I am currently calling OData services for list pickers after service is initialised, these calls would happen irrespective whether list picker clicked or not. This will impact the performance of the UI if making the calls several list pickers. If I set the rule to the list picker then rule getting executed even before the OData service is initialised this is leading the page to load blank screen.

I am setting the default values as an array the to list picker where picker items are bound to the entity set. List picker defaulting the top value from the list always. This works okay where listpicker bound to string collection. 

Ex. 

let orderTypes = ["C","D"];

orderTypeLipickerControl.setValue(orderTypes);

as a result I see two OData calls are triggered immediately as 

call 1: OrderTypesSet?$filter=Type eq 'C'

call 2: OrderTypesSet?$filter=Type eq 'D'

after the data loaded / bound to list picker, orderTypeLipickerControl has two default values (duplicate) AA.

Where 'A' is the first value from the list such as that the list has A, B, C, D. List picker always setting the top value as default value and duplicating as many values set previously. 

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Can you share your page metadata definition?