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 

Here is the metadata of the page.

{
	"Controls": [
		{
			"FilterFeedbackBar": {
				"ShowAllFilters": false,
				"_Type": "Control.Type.FilterFeedbackBar"
			},
			"_Type": "Control.Type.SectionedTable",
			"_Name": "SectionedTable0",
			"Sections": [
				{
					"Separators": {
						"TopSectionSeparator": false,
						"BottomSectionSeparator": true,
						"HeaderSeparator": true,
						"FooterSeparator": true,
						"ControlSeparator": true
					},
					"Controls": [
						{
							"_Type": "Control.Type.FormCell.ListPicker",
							"_Name": "ListPicker1",
							"IsVisible": true,
							"Separator": true,
							"AllowMultipleSelection": true,
							"AllowEmptySelection": true,
							"Caption": "This is bound to string collection",
							"DataPaging": {
								"ShowLoadingIndicator": true,
								"LoadingIndicatorText": "",
								"PageSize": 10000
							},
							"IsSelectedSectionEnabled": true,
							"IsPickerDismissedOnSelection": false,
							"IsSearchCancelledAfterSelection": false,
							"AllowDefaultValueIfOneItem": false,
							"IsEditable": true,
							"FilterProperty": [],
							"Search": {
								"Enabled": true,
								"Placeholder": "Select",
								"Delay": 100
							},
							"PickerItems": []
						},
						{
							"_Type": "Control.Type.FormCell.ListPicker",
							"_Name": "ListPicker2",
							"IsVisible": true,
							"Separator": true,
							"AllowMultipleSelection": true,
							"AllowEmptySelection": true,
							"Caption": "This is bound to Object binding on entityset",
							"DataPaging": {
								"ShowLoadingIndicator": false,
								"LoadingIndicatorText": "",
								"PageSize": 10000
							},
							"IsSelectedSectionEnabled": true,
							"IsPickerDismissedOnSelection": false,
							"IsSearchCancelledAfterSelection": false,
							"AllowDefaultValueIfOneItem": false,
							"IsEditable": true,
							"FilterProperty": [],
							"Search": {
								"Enabled": true,
								"Delay": 100
							},
							"PickerItems": {
								"Target": {
									"Service": "/Search/Services/Search.service",
									"EntitySet": "ORDERTYPES_F4"
								},
								"DisplayValue": "{OrderType}: {Desc}",
								"ReturnValue": "{OrderType}"
							}
						}
					],
					"Visible": true,
					"EmptySection": {
						"FooterVisible": false
					},
					"_Type": "Section.Type.FormCell",
					"_Name": "SectionFormCell0"
				}
			]
		}
	],
	"_Type": "Page",
	"_Name": "Search",
	"Caption": "Search",
	"PrefersLargeCaption": false,
	"ToolBar": {
		"Items": [
			{
				"_Type": "Control.Type.ToolbarItem",
				"_Name": "ToolbarItem1",
				"Caption": "Search",
				"Enabled": true,
				"Visible": true,
				"Clickable": true,
				"ItemType": "Button",
				"Style": "",
				"OnPress": "/Search/Actions/Search.js"
			}
		],
		"Visible": true
	}
}

 I have just renamed the service and captions to publish it here, rest of the code is as it is.  

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
How and where are you populating the first list picker that is bound to a string collection?