on 2016 May 05 3:03 AM
Hi,
I created a dropdown control in my application as below.
var dropdown_c0c0 = new com.sap.xmii.ui.UIElementDropdownM({
dataStatic:"false",
dataDynamic :"true",
keyValueList :"",
queryPath:"Test/test.XQry",
keyColumn:"wc",
valueColumn:"wc",
defaultValue:"",
colSpan :"2",
rowSpan :"1",
topPosition :"1",
leftPosition :"7",
controlVisible :"true",
controlEnabled :"true",
textSize:"12",
controlId: 2,
onSelect :"",
onInitialize :""});
form_c0c0.add(dropdown_c0c0);
on event, I passed parameters to the query Test/test.XQry which is attached to the dropdown and executed the query using Ajax. I want to populate the result of the query in the dropdown after Ajax call.
$.ajax({
url: '/XMII/Illuminator?QueryTemplate=Test/test.XQry&Content-Type=text/json',
type: 'POST',
data:{'Param.1':plant, 'Param.2':sfc},
success: function(sdata)
{
var oResult = sdata.Rowsets.Rowset[0].Row;
var abc = [];
abc.push(oResult[0].wc);
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(abc);
dropdown_c0c0.setModel(oModel);
}
})
But still the dropdown is not updated. Any help will be appreciated.
Regards,
Naga.
did you get the data in the ajax call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun,
Sorry for the delay.
Yes,I got the response after the ajax call.
I have added oModel.refresh(true) at the end of the code as below.But still it doesn't work.There is no error but the dropdown is not updated/refreshed.
$.ajax({
url: '/XMII/Illuminator?QueryTemplate=Test/test.XQry&Content-Type=text/json',
type: 'POST',
data:{'Param.1':plant, 'Param.2':sfc},
success: function(sdata)
{
var oResult = sdata.Rowsets.Rowset[0].Row;
var abc = [];
abc.push(oResult[0].wc);
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(abc);
dropdown_c0c0.setModel(oModel);
oModel.refresh(true);
}
})
Regards,
Naga.
oModel.refresh(true)
check if it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.