Skip to Content
0

Multiple filter for multiple tables in single view

Feb 27 at 01:06 AM

66

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Julio Alberto Martinez Real Feb 28 at 08:08 AM
0

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);

Share
10 |10000 characters needed characters left characters exceeded