on 01-26-2018 8:50 AM
Hi SAPUI5/ODATA Experts,
I have a SAPUI5 page developed in view.js and controller.js with having mutliple combobox controls in the SPAUI5 page.
Can anyone suggest,on how to get data for that particular combobox using odata model,i don't want any JSON included in between and i don't want to use view.xml in SAPUI5.
Please help me with some sample links or codes
Please help me soon !!
Thanks,
Jay
Hi Efam/SAPUI5 Experts,
Can please help me on this ASAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efam/SAPUI5 Experts,
Can please help me on this ASAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efam/SAPUI5 Experts,
Can please help me on this ASAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efam,
Thanks for the reply,i did the same way as you said.
I have tired the way,but if i maintain the KEY and Text field values as blank,the i am getting list as [object Object] or else if fill any values in the KEY and Text field,i am getting the combo box as empty list as shown in the attached image,whereas here the count of empty list is same as columns in the Tables.
View.js:
var oComboBox_FunArea = new sap.m.ComboBox({ items:{ path: "/XYZSet", template : new sap.ui.core.Item({ key:'{ABC}', text:'{ABC}' }) };
Controller.js:
var sServiceUrl = ("proxy/http/____________:8000/sap/opu/odata/SAP/YREQSUB_SRV/");
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,true);
this.getView().setModel(oModel);
sap.ui.getCore().setModel(oModel);
Can you please advise me,what does the KEY field in sap.core.item exactly required for and can i
maintain the same values in KEY and Text fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efim,
Firstly thanks for the reply !!
pls find my code below and correct em if i am wrong,as this is my first project in SAPUI5
View.js :
var oComboBox_FunArea = new sap.ui.commons.ComboBox("FunArea",{Items:{path:"/sServiceUrl"}});
controller.js:
onInit: function() {
var sServiceUrl = ("proxy/http/____________:8000/sap/opu/odata/SAP/YREQSUB2_SRV/");
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,true);
this.getView().setModel(oModel);
}
or else please help me with more detail elaboration of code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its looks ok, except for ComboBox items binding.
1) You should find entitySet that represent data for you combobox items (navigate to your service url to find). You should bind items to entity set, not service name.
Or it can be relative binding through navigation property from specific entity, but i'm suppose this is not your case.
2) Set template for each item of this set as i shown above.
Hi! If you have oData entity sets that represent data for paticular combobox, you can directly bind it to ODataModel:
//You have default ODataModel with entity set ComboBoxData1 that contains set of key-value pairs
new sap.m.ComboBox({
items:{
path: '/ComboBoxData1',
template: new sap.ui.core.Item({
key: '{keyProp}',
text: '{textProp}'
})
}
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.