问题
I need to implement a Smart Field control with Value Help in my form. I am getting json response from ODATA service. And I am setting it to a JSONModel. I have tried a sample code refering this link but I don't know how to bindElement. Please refer this JsBin
回答1:
SmartControls rely on OData! However, you are using a JSONModel! Also, as @matbtt mentioned you are binding a single field to an array, but you should do it the way he mentioned above... This jsbin is the correction but still only with a JSONModel instead of an ODataModel. And this one uses OData and works just fine.
Is there a specific reason why you call an OData Service and wrap the response into a JSONModel? Do you know how to use the ODataModel in UI5?
And thank you for using my single file template!
回答2:
As your data are contained in a named array you need adjust the binding as follows:
<smartField:SmartField value="{/TableCollection/0/AccountNo}" id="companyCode"/>
来源:https://stackoverflow.com/questions/38075162/how-to-create-a-smart-field-control-with-valuehelp-feld