Skip to Content
0
Oct 09, 2020 at 07:48 AM

QueryOptions not working in Objectcell binding on entityset for a List Picker in MDK app

193 Views Last edit Oct 09, 2020 at 09:09 AM 3 rev

Hello experts,

I have an issue in using filter in QeryOptions for a list picker in my page of the offline MDK application. I actually want to create a URI like #Page:Notification_Create/#Control:FormCellSimplePropertyPlant/#Value as the values for the Notificaiton type is dependent on the value of the Plant (/sap/opu/odata/SAP/ZME_PM_CREATE_NOTIFICATION_SRV/NotifTypeListSet?$filter=Plant eq '1190'). For testing purposes I am trying to use hard coded value for Plant like 1190 ("$filter=Plant eq '\"1190\"'"). But, it does not work in any case. I see blank values when I open the list picker in the deployed app on my emulator.

The picker is the one for Notification types:

"AllowEmptySelection": false, "AllowMultipleSelection": false, "Caption": "Notification Type", "IsEditable": true, "IsPickerDismissedOnSelection": true, "IsSearchCancelledAfterSelection": true, "IsSelectedSectionEnabled": false, "IsVisible": true, "PickerItems": { "ObjectCell": { "DetailImageIsCircular": false, "Icons": [ ], "PreserveIconStackSpacing": true, "Styles": { }, "Subhead": "{NotifType}", "Title": "{NotifTypeTxt}" }, "ReturnValue": "{NotifType}", "Target": { "EntitySet": "NotifTypeListSet", "QueryOptions": "$filter=Plant eq '\"1190\"'", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" } }, "Search": { "Enabled": true }, "_Name": "NotTypeFormCellListPicker", "_Type": "Control.Type.FormCell.ListPicker"

Below is the code for the complete page:

{ "ActionBar": { "Items": [ { "OnPress": "/ZME_CREATENOTIFICATION/Actions/NavToNotifications_List.action", "Position": "left", "SystemItem": "Cancel", "Text": "Cancel", "Visible": false }, { "Position": "Right", "SystemItem": "Organize", "Text": "Check", "Visible": false }, { "OnPress": "/ZME_CREATENOTIFICATION/Actions/CreateNotification.action", "Position": "right", "SystemItem": "Save", "Text": "Create", "Visible": true } ] }, "Caption": "Create Notification", "Controls": [ { "Sections": [ { "Controls": [ { "Caption": "Plant", "IsEditable": true, "IsVisible": false, "_Name": "FormCellSimplePropertyPlant", "_Type": "Control.Type.FormCell.SimpleProperty" }, { "AllowEmptySelection": false, "AllowMultipleSelection": false, "Caption": "Functional location", "IsEditable": true, "IsPickerDismissedOnSelection": true, "IsSearchCancelledAfterSelection": true, "IsSelectedSectionEnabled": false, "IsVisible": true, "PickerItems": { "ObjectCell": { "DetailImageIsCircular": false, "Icons": [ ], "PreserveIconStackSpacing": true, "Styles": { }, "Subhead": "{FuncLoc}", "Title": "{FuncLocText}" }, "ReturnValue": "{FuncLoc}", "Target": { "EntitySet": "FLocListfromSettingSet", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" } }, "Search": { "BarcodeScanner": true, "Enabled": true }, "_Name": "FuncLocFormCellListPicker", "_Type": "Control.Type.FormCell.ListPicker" }, { "AllowEmptySelection": false, "AllowMultipleSelection": false, "Caption": "Equipment", "IsEditable": true, "IsPickerDismissedOnSelection": true, "IsSearchCancelledAfterSelection": true, "IsSelectedSectionEnabled": false, "IsVisible": true, "PickerItems": { "ObjectCell": { "DetailImageIsCircular": false, "Icons": [ ], "PreserveIconStackSpacing": true, "Styles": { }, "Subhead": "{Equip}", "Title": "{EquipText}" }, "ReturnValue": "{Equip}", "Target": { "EntitySet": "EquiListfromFLocSet", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" } }, "Search": { "BarcodeScanner": true, "Enabled": true }, "_Name": "EquipFormCellListPicker", "_Type": "Control.Type.FormCell.ListPicker" }, { "AllowEmptySelection": false, "AllowMultipleSelection": false, "Caption": "Notification Type", "IsEditable": true, "IsPickerDismissedOnSelection": true, "IsSearchCancelledAfterSelection": true, "IsSelectedSectionEnabled": false, "IsVisible": true, "PickerItems": { "ObjectCell": { "DetailImageIsCircular": false, "Icons": [ ], "PreserveIconStackSpacing": true, "Styles": { }, "Subhead": "{NotifType}", "Title": "{NotifTypeTxt}" }, "ReturnValue": "{NotifType}", "Target": { "EntitySet": "NotifTypeListSet", "QueryOptions": "$filter=Plant eq '\"1190\"'", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" } }, "Search": { "Enabled": true }, "_Name": "NotTypeFormCellListPicker", "_Type": "Control.Type.FormCell.ListPicker" }, { "AllowEmptySelection": false, "AllowMultipleSelection": false, "Caption": "Priority", "IsEditable": true, "IsPickerDismissedOnSelection": true, "IsSearchCancelledAfterSelection": true, "IsSelectedSectionEnabled": false, "IsVisible": true, "PickerItems": { "ObjectCell": { "Description": "", "DetailImageIsCircular": false, "Icons": [ ], "PreserveIconStackSpacing": true, "Styles": { }, "Subhead": "{Priority}", "Title": "{ProirityText}" }, "ReturnValue": "{Priority}", "Target": { "EntitySet": "PrioritiesListSet", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" } }, "_Name": "PriorityFormCellListPicker", "_Type": "Control.Type.FormCell.ListPicker" }, { "Caption": "Short text", "_Name": "ShortTextFormCellSimpleProperty", "_Type": "Control.Type.FormCell.SimpleProperty" }, { "Caption": "Description", "_Name": "DescFormCellSimpleProperty", "_Type": "Control.Type.FormCell.SimpleProperty" }, { "AttachmentActionType": [ "AddPhoto", "TakePhoto", "SelectFile" ], "IsVisible": true, "_Name": "FormCellAttachmentNotif", "_Type": "Control.Type.FormCell.Attachment" } ], "Visible": true } ], "_Name": "FormCellContainer", "_Type": "Control.Type.FormCellContainer" } ], "_Name": "Notification_Create", "_Type": "Page" }
 

I understand the alternative is to use a js rule, but I had an issue with that as well previously(https://answers.sap.com/questions/13091447/mdk-odata-association-and-navigation-implementatio.html)

Pls help.

Thanks

Aanchal