cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting Cascaded Filters in Design Studio Application

Former Member
0 Kudos

Hi Everyone,

I have created an application using Design studio 1.1 with 4 cascading filters(Plant, Profit Center, Material and Production Order) using Dropdown boxes. While running the application, when I am select values in all the 4 filters, data in the application is changing accordingly. But, whenever I go for changing values in the filters after selecting Start and end Dates, it is not showing all the values in the 4 filters(Dropdown boxes). That means filters are not getting reset. It is working if I keep a RESET button for clearing all filters. Can you give me a solution without adding a RESET button so that values in the filters reset automatically after each selection.

Note: I have taken Start Date and End Date filters over the application initially.

Thanks

Nirupa

Accepted Solutions (1)

Accepted Solutions (1)

murali_balreddy2
Active Participant
0 Kudos

Check out this post: http://scn.sap.com/message/14180360#14180360

It talks about the exact same scenario.

After you set your date range, the key is to clear all filters and set the items of drop-down boxes again based on the datasource filtered by the new date range.

Thanks.

Former Member
0 Kudos

Hi Murali,

I have gone through your post. I have implemented the same that you mentioned in the post. It was really helpful. But after selecting dates, my other filters are not getting values according to the selected dates. Once I click on refresh button and then select all the filters then only its working fine. Can you tell me where exactly i need to apply 'clearAllfilters'!

Former Member
0 Kudos

Hi Nirupa,

you should use the clearAllFilters in the onSelect of your date selection, before setting the filter value for your new date. After the clearAllFilters, set your new date selection, and setItems for your dropdown boxes.

murali_balreddy2
Active Participant
0 Kudos

As shown in the post http://scn.sap.com/message/14180360#14180360 and as Sjoerd mentioned, clearing all filters first (prior to setFilter and setItems) should reset the drop-down boxes. Did it not work?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nirupa,

Please try my example. Assume, you have 2 dropdown filters (in your case, 4 dropdown filters), one on region and one on country. In application startup script, I wrote

DROPDOWN_1.setItems(DS_1.getMemberList(

"CREGION", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT,20,"All"));

DROPDOWN_2.setItems(DS_1.getMemberList(

"CCOUNTRY", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT,20,"All"));

After that, onselect of first dropdown filter, I wrote,

DS_1.setFilter("CREGION",DROPDOWN_1.getSelectedValue());

DROPDOWN_2.setItems(DS_1.getMemberList(

"CCOUNTRY", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 20,"All")); 


DS_1.setFilter(

"CCOUNTRY", DROPDOWN_2.getSelectedValue());

and then

Onselect of second dropdown, I wrote

DS_1.setFilter("CCOUNTRY",DROPDOWN_2.getSelectedValue()); 

You can try this solution for your 4 filters. This may solve your problem.

Former Member
0 Kudos

Hi Nirupa,

What exactly is the moment when you wish to reset your filters?

If I understand correctly, I think

DROPDOWN_1.setSelectedValue("ALL"); should work in the OnSelect of the first dropdown box if you want to de-select a selected value in your dropdown boxes that are dependant of the dropdown you select a new value in.

When you want to reset all filters of a datasource, you can use DS_1.clearAllFilters();

regards,

Sjoerd