cancel
Showing results for 
Search instead for 
Did you mean: 

Select «all» in drop down box

Former Member
0 Kudos

Hi Experts

 

In our dashboard I am filling a dropdown box with some
values from a data source. I us the following script to fill the data.

 

DROPDOWN_1.setItems(DS_2.getMemberList("ZQMKPI",
MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT,
100, "No
KPI selected"
));

So by default the drop down box will say “No KPI selected”.
Then the user can select a KPI from the dropdown box and everything is fine.
But in some rear cases I would like to set the selected item in the dropdown
box back to “No KPI selected”. How do I do that?

 

Kind regards

 

Erik

Accepted Solutions (1)

Accepted Solutions (1)

Karol-K
Advisor
Advisor
0 Kudos

Hi Eric,

the code should be like this line:

DROPDOWN_1.setSelectedValue("<your value>");

this means, for selecting "all" option,

DROPDOWN_1.setSelectedValue("ALL_MEMBERS"); // ALL_MEMBERS is the key.

Former Member
0 Kudos

Hi Karol

I tried the syntax DROPDOWN_1.setSelectedValue("ALL_MEMBERS"); but it does not work. We use DS 1.3 sp02 and the newest BO patch. If this works for you, what version are you using?

Thank you for your response

Erik

former_member193885
Contributor
0 Kudos

Erik,

Have you tried the following?

DROPDOWN_1.setSelectedValue("");


If you check the code generated for the dropdown the "No KPI selected" key will be set to a null blank value. You can use the code above to set it to back to null which should display the corresponding text "No KPI selected".

Thanks.    

Former Member
0 Kudos

Hi everyone

I found the error. Somehow in DS 1.3 sp02 you need to write DROPDOWN_1.setSelectedValue("(ALL_MEMBERS)"); instead of DROPDOWN_1.setSelectedValue("ALL_MEMBERS");. Now it works perfectly

Erik

Karol-K
Advisor
Advisor
0 Kudos

Erik, this was my typo - also in 1.3 SP1 the brackets are required... This means there was no change.

btw. here the code to see what is the selected key:

APPLICATION.createInfoMessage("Selected Key: \"" + DROPDOWN_1.getSelectedValue() + "\"");

APPLICATION.createInfoMessage("Selected Text: \"" + DROPDOWN_1.getSelectedText() + "\"");

Answers (2)

Answers (2)

IngoH
Active Contributor
0 Kudos

Hello Erik,

I assume you just wanna reset the drop down box and not do any selection on the data source or cube - correct ?

did you try the setSelectedValue option ?

ingo

TammyPowlas
Active Contributor
0 Kudos

Could you fake this by adding a "No KPI selected" to the cube that points to an empty row?  That might be the easiest, unless others have suggestions