/scripts/ahub.form.attachments.js
0

Cascading Filters on List Boxes in Design Studio

Mar 30, 2017 at 10:57 AM

106

avatar image

Dear Gurus,

I am trying to implement a cascading filter on two list boxes showing Region> Customer.

I have used the following script at the application startup.

LISTBOX_1.setItems(DS_REGION.getMemberList("Region", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 20)); LISTBOX_2.setItems(DS_Customer.getMemberList("Customer", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100));

Now, at the Listbox-1 on select event which is showing the Region, I have written the following code:

DS_Customer.setFilter("Region", LISTBOX_1.getSelectedValue()); LISTBOX_2.setItems(DS_Customer.getMemberList("Customer", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100));

However, I don't get the selected customers based on Region and I could see all the Customer values.

Any suggestions?

Regards

Sumit

10 |10000 characters needed characters left characters exceeded

What type of data source are you using Sumit?

0

Hi Bensan,

I am using CSV data.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Agata L. Mar 30, 2017 at 01:54 PM
0

Sumit,

Your code seems to work for me. It thought it might be a question of having "Region" in your DS_Customer as a background filter, but your code works for me whether I have this in filter or not.

I copied your code exactly:

On Startup:

LISTBOX_1.setItems(DS_REGION.getMemberList("0REGION", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 20));

LISTBOX_2.setItems(DS_CUSTOMER.getMemberList("0CUSTOMER", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100));

OnClick event on ListBox_1:

DS_CUSTOMER.setFilter("0REGION", LISTBOX_1.getSelectedValue()); /*it does filter the data source correctly, as I have added a crosstab to show me this as well*/

LISTBOX_2.setItems(DS_CUSTOMER.getMemberList("0CUSTOMER", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100)); /*my listbox gets updated nicely*/

Silly question: I assume you have "Only Posted Values" selected in your initial views?

A.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Agata. let me give a try on this. I will update you on the same.

Many Thanks

Sumit

0
Lakshmikanth Adharapurapu Mar 30, 2017 at 02:46 PM
0

Hello sumit,

It excutes for me as well...ideally setfilter works but can you try with DS_2.setfilterext?

DS_Customer.setFilter("Region", LISTBOX_1.getSelectedValue()); LISTBOX_2.setItems(DS_Customer.getMemberList("Customer", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100));

BR,

Lakshmikanth

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Laxmikanth. Let me give a try on this and I will get back to you on this.

Regards

Sumit

0
Skip to Content