Cascading Filters on List Boxes in Design Studio

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 30, 2017 at 01:54 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 30, 2017 at 02:46 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content