How to create a Smart Field control with ValueHelp feld

落爺英雄遲暮 提交于 2019-12-13 22:41:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!