cancel
Showing results for 
Search instead for 
Did you mean: 

refresh or reload UI5dropdown

Former Member
0 Kudos

Hi,

I am using SAP MII 15.0 SP5 version.

Can you tell me how to refresh or reload or update drop down element after executing a dynamic query configured to it?

Regards,

Naga.

Accepted Solutions (0)

Answers (3)

Answers (3)

swaroop_anasane
Active Contributor
0 Kudos

Hi Naga,

You are using MII objects to create dropdown. Check if query caching in QT is enabled? If yes, you need to disable it.

I don't think it has anything to do with UI caching as well as data would not be cached along with UI elements. Just a thought.

Regards,

Swaroop

Former Member
0 Kudos

Hi Naga,

I am also facing same issue.

Can you please suggest me how to do that.

Former Member
0 Kudos

Hi Naga,

You can try this method.

DropdownBox0_c0c0.addItemsByQuery();

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

Thank you for the reply. It gives error.

I did the following ..

$.ajax({

                    url: '/XMII/Illuminator?QueryTemplate=Test/test.XQry&Content-Type=text/json',  

                    type: 'POST',

                     data:{'Param.1':plant, 'Param.2':sfc},

                    success: function(sdata)

                    {                       

                        DropdownBox_c0c0.addItemsByQuery();                              

                       

                    }

})

Error: Object doesn't support property or method 'addItemsByQuery'



Regards,

Naga.

Former Member
0 Kudos

Hi Naga,

I checked in 15.0 SP07. Pls check if your SP level is same

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

I am using SAP MII 15.0 SP5 Patch4  version.



Regards,

Naga.

swaroop_anasane
Active Contributor
0 Kudos

Hi Naga,

Are you using Display template or UI5 dropdown?

Regards,

Swaroop

Former Member
0 Kudos

Hi Swaroop,

Thank you for the reply. I am using UI5 dropdown.

Regards,

Naga.

swaroop_anasane
Active Contributor
0 Kudos

Hi Naga,

You are welcome! Best way is to update your model once ajax is updated, same would be reflected in the dropdown you created.

when you say "update dropdown element", do you mean the entire list or one list item in the dropdown?

Let me know how have you instantiated the dropdown.

Regards,

Swaroop

Former Member
0 Kudos

Hi Swaroop,

I want to populate the dropdown list with the output of the  Query Test/test.XQry that I executed after passing parameters at runtime.

I created UI dropdown 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(function)  I am passing params to the query and executed to populate the result of the query in the dropdown.

$.ajax({

                    url: '/XMII/Illuminator?QueryTemplate=Test/test.XQry&Content-Type=text/json', 

                    type: 'POST',

                     data:{'Param.1':plant, 'Param.2':sfc},

                    success: function(sdata)

                    {                      

                                                    

                      

                    }

})

Regards,

Naga.

Former Member
0 Kudos

Hi Swaroop,

I tried to use oModel to update as below.But still the drop down is not refreshed with the query result.

Any Help?

$.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);

                      

                    }

})

Regards,

Naga.