cancel
Showing results for 
Search instead for 
Did you mean: 

TableFilter Class

Former Member
0 Kudos

HI,

I followed the below mentioned blog for creating the filtering functionality for a table.

/people/kapil.kamble/blog/2006/12/21/how-to-get-ready-made-filter-for-your-web-dynpro-table-with-minimal-coding

I am able to see the filter icon but filtering is not working.

Do i need to do anything else apart from what is mentioned in the blog

please help me in resolving this issue

Thanks

Bala Duvvuri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am using BAPI_FLIGHT_GETLIST to display the table structure in my webdynpro application

wdDOModifyView

if ( firstTime )

{

if ( null != view )

{

IWDTable table = (IWDTable) view.getElement("Table");

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User:3"+table);

wdContext.currentContextElement().setTableFilter(new TableFilter(table,wdThis.wdGetFilterAction()));

}

}

onactionfilter()

public void onActionfilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionfilter(ServerEvent)

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User:33");

wdContext.currentContextElement().getTableFilter().filter(wdEvent,wdContext.nodeOutput_1(),

wdContext.nodeOutput(),

wdContext.nodeVoFilter());

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User:31");

//@@end

}

I am not able to filter the results after writing the above code.Please let me know where i went wrong

Thanks

Bala Duvvuri

Former Member
0 Kudos

hi,

for table filter we need table columns , filter is not worked for Grouped columns so change all grouped columns to column then it will work.

Regards

Trilochan

former_member201361
Active Contributor
0 Kudos

Hi,

Table filter wont work for the grouped columns.

Please check whether u have populated the source node , as the filter takes place in the source node.

U might have populated the table node -- wdContext.nodeOutput_1()

and in the same way u have to populate the Source node ---wdContext.nodeOutput().

Please check whether u have binded the Table filter value to the Column.

Hope ur problem will get resolved

Thanks and Regards

Fazal

Former Member
0 Kudos

Trilochan\Fazal,

Thanks for the replies

I dont understand

for table filter we need table columns , filter is not worked for Grouped columns so change all grouped columns to column then it will work.

can you please elaborate and tell me where do i need to change the code

Thanks

Bala Duvvuri

former_member201361
Active Contributor
0 Kudos

hi,

we no need to change any code . just go to the outlineView of ur View and Check whether ur table has grouped columns or Only Columns.

if it is Grouped Columns , Change that to Columns.

have to populated the source node (Refer my previous post).

Thanks and Regards

fazal

former_member201361
Active Contributor
0 Kudos

Hi,

just populate the source node in the same way as u did to the Table Node .

are u binding the Model node to the Table or Value Node.

Thanks and Regards

Fazal

Former Member
0 Kudos

Hi,

I dont find that grouped columns property for the table.could you please mention the exact table property which i need to change

I am using Model node for the table.is it the right one

Here is my context .

Bapi_Flight_Getlist_Input-Model Node

Destination_From

Destination_To

Output

Flight_List

Output_1 -Model Node

VoFilter -Value Node

and my code is

public static void wdDoModifyView(IPrivateFlightView wdThis, IPrivateFlightView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if ( firstTime )

{

if ( null != view )

{

IWDTable table = (IWDTable) view.getElement("Table");

wdContext.currentContextElement().setTableFilter(new TableFilter(table,wdThis.wdGetFilterAction()));

}

}

//@@end

}

public void onActionfilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionfilter(ServerEvent)

wdContext.currentContextElement().getTableFilter().filter(wdEvent,wdContext.nodeOutput_1(),

* wdContext.nodeOutput(),*

* wdContext.nodeVoFilter());*

//@@end

}

correct me if i am doing anything wrong.

Thanks

Bala Duvvuri

Former Member
0 Kudos

Fazal,

Please help me understand

Please check whether u have populated the source node , as the filter takes place in the source node.

U might have populated the table node -- wdContext.nodeOutput_1()

and in the same way u have to populate the Source node ---wdContext.nodeOutput().

Thanks

Bala Duvvuri

Former Member
0 Kudos

Blog which i mentioned talks about value nodes not model nodes.

But in my case i have to go with model nodes because i am using adaptive RFC model.

Is there anything i need to change

Thanks

Bala Duvvuri

former_member201361
Active Contributor
0 Kudos

Hi,

Bind the Datasource property of the Table to the value node .

and copy the data from th model node to the Value Node .

Note : Please dont bind the Model nodes to the Table DataSource Property.

Create a Value Node and Attribute for the Table .

Finally bind the Value Node to Table data Source Property.

In the Doinit method of the View , execute the model .

Finally copy the Data from the Model Node to the Value Node .

Thanks and Regards

fazal

Former Member
0 Kudos

hi,

filter is not worked for model node(here use value node) and its not working for grouped column(use column).

when we use template for creating UI Elements in your case table then it will automaticlly come with Grouped columns, so first delete these Grouped columns from table and add column to table .means don,t use template for creating table here and add column one by one.

make 3 nodes each have same data,

First node is source node which have original data,

Second node is the copy of that node (this node is binded with the table datasourse)

Third node is filter node according to which we can filter the table.

(all filter node attributes should be string).

Note 😆 the copy node and filternode should node be ModelNode.if source node is model node than take care of copy nodeu2026create it manually which have the same attribute name and type.

here WfRecRequestSearchResult() is model node.

public static void wdDoModifyView(IPrivateRequestor wdThis, IPrivateRequestor.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if(firstTime)

{

IWDTable table = (IWDTable) view.getElement("Table");

wdContext.currentContextElement().setTableFilter(new TableFilter(table,wdThis.wdGetFilterAction(), wdThis.wdGetHrrec_reqController().wdGetAPI().getMessageManager()));

wdContext.currentContextElement().getTableFilter().filter(null,wdContext.nodeWfRecRequestSearchResult(),wdContext.nodeWfRecRequest(),wdContext.nodeWfRecRequestFilterNode());

}

//@@end

}

public void onActionfilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionfilter(ServerEvent)

wdContext.currentContextElement().getTableFilter().filter(wdEvent,wdContext.nodeWfRecRequestSearchResult(),wdContext.nodeWfRecRequest(),wdContext.nodeWfRecRequestFilterNode());

//@@end

}

Regards

Trilochan

Former Member
0 Kudos

Hi,

Please let me know how to copy the data from model node to value node.

Former Member
0 Kudos

Hi Trilochan,

If I do this

First node is source node which have original data,

Second node is the copy of that node (this node is binded with the table datasourse)

how do i populate the table with values because source node is the one which contains data.

How do i copy the data from source node(model node) to second node(value node)

Former Member
0 Kudos

Hi Bala,

You do not have to worry about copying data from source node to second node as it is being done in the code of TableFilter.java.

Regards,

Gopal

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

Gopal s right the table filter class take care of this.

Regards

Trilochan

Former Member
0 Kudos

Try Peter Vignets Blog. It even works on grouped columns... Notice the comments at the end of the blog regarding the NPE.

/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter

Martin