Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Deselect default value in listbox

$
0
0

All,

 

Apologies in advance for how basic a question this is - I don't know why my solution is not working.

 

We are on DS 1.5.

 

I have a listbox (Multiple selections = false, enabled = true)  that is populated on startup via the following script.

 

POPUP_1.show();

 

var BWRoles = CONNECTION_1.getRootFolders(DataSourceBrowseType.ROLES);

 

BWRoles.forEach(function(element, index) {

 

  LISTBOX_2.addItem(index + "", "["+element.name+"] "+element.description);

});

LISTBOX_2.setSelectedValue("");

 

The last line, to my knowledge and per this post ( http://scn.sap.com/thread/3529413 ), should "select" (blank) as a selected value, resulting in no highlighted values.  However, this is not functioning as expected. I have tried selecting both "" and various strings not in the list ("1",etc.), to no avail.  The only solution that has produced any results has been adding a blank "item" to the end of the list and selecting it.  However, this is still not optimal, as it results in a blank, selected row at the beginning/end of my list.

 

Does anyone have any thoughts as to what I could be missing here?  I have experimented with both setSelectedValue () and setSelectedValues(), as well as changing the "multiple selections" parameter for LISTBOX_2.

 

Thanks!

Scott


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>