cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown Box with "All" values

Former Member
0 Kudos

I have two dropdown boxes and is cascaded. How do I add "All" in the dropdown box to get back to my initial view.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sini,

This can be done by manually adding ALL in the following way,

<SelectorComponent>.setItems(<datasource>.getMemberList("<measure>", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 50,"All"));

this should give you a false data which is not present in the Dataset, which makes the Datasource to display all!

Hope this helps,

Thanks and regards,

Fazith

Answers (2)

Answers (2)

Former Member
0 Kudos

hi, does this still work in DS 1.2? doing setSelectedValue()=="" doesn't select the "ALL" values.

Jp

murali_balreddy2
Active Participant
0 Kudos

Do the following

a) In application's "On Startup" event add,

DROPDOWN_1.setItems(DS_1.getMemberList("0D_NW_CNTRY", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 10, "ALL"));

Notice the last optional parameter "ALL"  (you can have any text eg: "All Countries") added to the dropdown setitems to represent all items of the diemnsion.

b) In Dropdown's "On Select" event add,

if

(DROPDOWN_1.getSelectedValue() == "") {

     DS_1.clearFilter("0D_NW_CNTRY");

}

else {

      DS_1.setFilter("0D_NW_CNTRY", DROPDOWN_1.getSelectedValue());

}

When ALL is selected, (getselectedvalue is internally null/blank), clear the filter. When any other value is selected, set the filter to this value.

And if you are looking for a drill-down feel, add this instead of the above

if

(DROPDOWN_1.getSelectedValue() == "") {

     DS_1.clearFilter("0D_NW_CNTRY");

       DS_1.moveDimensionBefore("0D_NW_CNTRY", "0D_NW_PROD__0D_NW_PRDCT");

}

else {

      DS_1.setFilter("0D_NW_CNTRY", DROPDOWN_1.getSelectedValue());

      DS_1.removeDimension("0D_NW_CNTRY");

}

Here Country is the first column and Product Category is the next column of the crosstab. Initially, both country and product category are shown. When a country is selected from the dropdown, country column is removed giving a drilldown/filter-by feel. When ALL is selected, country column is brought back.

Let me know if it works.

(Not sure about your two dropdown requirements)

Thanks,

Murali