cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to set selected key for combo box

Former Member
0 Kudos

http://jsbin.com/cecotuzace/1/edit?html,js,output

Hi Experts,

I am not able to set the selected key for the combo box. In the JSbin, it is working, but when I run it as an application, no key is set for the combo box.

Please see above link.

Could you give me some hints about solving this issue.

Regards,

Shashi

Accepted Solutions (0)

Answers (4)

Answers (4)

Private_Member_15166
Active Contributor
0 Kudos

Press F12 in your browser and go to console tab.(Chrome is preferred browser)

Here you can see any error if you have made in your program.

dunayevsky_yuri
Participant
0 Kudos

Try to comment the code in your app and just copy-paste your code from the jsbin to your app's code.

If it still doesn't work, you should look for the problem elsewhere.

If it works - you have some error in your code that you missed.

Former Member
0 Kudos

Did this. Code is exactly same. Still it is not selecting the key in the dropdown combo box, although it is showing the selected key in the JSbin.

dunayevsky_yuri
Participant
0 Kudos

If the boot strap is the same and the code is EXACTLY the same (if you din't copy-paste, but only looked through the code, you could miss some tiny detail), then the problem is not in this part of the code, but somewhere else.

Also, if you use Eclipse, you may want to check for updates (I'm not sure this will help, but give it a try).

And also, you may want to clear browser cache. If you use Chrome, go to Network tab of the developer tools, check "Disable cache" check box and reload the page.

former_member182862
Active Contributor
0 Kudos

Can you check if your model is binded?

and did you have a named model, e.g. setModel(oModel,  "example")

Former Member
0 Kudos

Hi Dennis,

Yes, model is binded because the drop down values are shown, but somehow the selected key is not getting bound when I run the same code as an application using my HANA studio.

In the JS Bin (See link in above post), it is working fine.
The same code as an app is not working.

Regards,

Shashi

former_member182862
Active Contributor
0 Kudos

I believe that it is somewhere in the model data is not right.

can you cross check?

-D

santhu_gowdaz
Active Contributor
0 Kudos

onAfterRendering: function()

  {

this.getView().byId("YourDDId").setSelectedKey("Key");

}

former_member182862
Active Contributor
0 Kudos

Santhosh, in my opinion, this is not the way to go.

-D

santhu_gowdaz
Active Contributor
0 Kudos

Adding data-sap-ui-xx-bindingSyntax="complex" in you boot strap.

Former Member
0 Kudos

Hi Santhosh,

I added this parameter to the bootstrap, but it is not making any difference.

Regards,

Shashi