Skip to Content
author's profile photo Former Member
Former Member

Multiple filter for multiple tables in single view

Hello,

We have implemented multiple tables in the view, but client wants to add filter for each table. we have also successfully implemented filter to one table, but when implementing the second, the filter is not working for the two tables.

in WdDoModifyView:

IWDTable tbl1= (IWDTable) view.getElement("DesktopTbl"); wdContext.currentContextElement().setTableFilter(new TableFilter(tbl1, wdThis.wdGetFilterDesktopAction(), sourceNode, null,1));

IWDTable tbl2= (IWDTable) view.getElement("LaptopTbl"); wdContext.currentContextElement().setTableFilter(new TableFilter(tbl2, wdThis.wdGetFilterLaptopAction(), sourceNode2, null,1));

in onActionFilterDesktop:

wdContext.currentContextElement().getTableFilter().filter(sourceNode, resultNode);

in onActionFilterLaptop:

wdContext.currentContextElement().getTableFilter().filter(sourceNode1, resultNode1);

Please help. When implementing Desktop, filter is working fine. but when adding the filter for the Laptop everything is wrong.

Regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 28, 2018 at 08:08 AM

    Hi

    You are using same TableFilter class.

    Create two Tablefilter in context.

    IWDTable tbl1= (IWDTable) view.getElement("DesktopTbl"); wdContext.currentContextElement().setTableFilterDesktop(new TableFilter(tbl1, wdThis.wdGetFilterDesktopAction(), sourceNode, null,1));

    IWDTable tbl2= (IWDTable) view.getElement("LaptopTbl"); wdContext.currentContextElement().setTableFilterLaptop(new TableFilter(tbl2, wdThis.wdGetFilterLaptopAction(), sourceNode2, null,1));

    in onActionFilterDesktop:

    wdContext.currentContextElement().getTableFilterDesktop().filter(sourceNode, resultNode);

    in onActionFilterLaptop:

    wdContext.currentContextElement().getTableFilterLaptop().filter(sourceNode1, resultNode1);

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.