Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 28 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 comment
    10|10000 characters needed characters exceeded