Hello,
I want to use in my view xml and bind a ComboBox to a Model. The problem is, I dont know how because there is too less documantion for it.
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="zui5_report_xml.Master" xmlns:form="sap.ui.layout.form" xmlns:html="http://www.w3.org/1999/xhtml"> <App> <Page title="Example" > <form:SimpleForm> <Label text="Auto" /> <ComboBox text="/items"> <items> <core:Item key="{key}" text="{text}"/> </items> </ComboBox> </App></core:View>
var oModel = new sap.ui.model.json.JSONModel(); var mData = { "items": [ { "key": "DZ", "text": "Algeria" }, { "key": "AR", "text": "Argentina" }, { "key": "AU", "text": "Australia" } ]}; oModel.setData(mData); this.getView().setModel(oModel);
I know, that is a simple problem but I need help for it...