cancel
Showing results for 
Search instead for 
Did you mean: 

Table Filter

Former Member
0 Kudos

hi

I am new in webdynpro and I developed a project that is connected to R/3 using RFC’s and I bind these output tables of RFC’s to the view, now I need to add table filter to these tables. I use TableFilter.java which I found it in How to get ready-made filter for your Web Dynpro Table with minimal coding ? blog for Kapil Kamble.

When I try to run my project I got NullPointer Exception in this line

wdContext.currentContextElement().getFilter().filter(wdEvent,wdContext.nodePostock_Dist(),wdContext.nodePostock_Dist(),wdContext.nodeTableFilter(),null);

please help me in this problem

best regards

Accepted Solutions (0)

Answers (3)

Answers (3)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Said Mohammad

R u binded the dataSource to the table.While creating TableFilter object pass the table reference exactly in wdModify method i mean pass the corrct id ,you are passing the two nodes references to the filter method is same,so you are losing the data of source node while invalide in that method,better you create the One Extra node which is just copy of the node you binded to the table as data source,whose attr and cardinality is same.Copy all elements in to the newly created node by using WDCopyService.copyElements(sourcenode,targetnode)And pass

DataSource node(binded to table)

ExtraNode (replica of the above)

FilterNode to your filter method

Dont forgrt to copy all elements before applying filtering(important)

null

as parameters

Hope this solves your problem.let me know the status

regards

venkatakalyan.k

Former Member
0 Kudos

Hi

Yes I write this code in the wdDoModifyView method. Also I tried wdContext.currentContextElement().getFilter() and it always give me null.

I have one question: to have a table filter we need to create to nodes one is the original node that is mapped to the RFC and the other node is the source node which is used to display information in the view. How I map the data from original node to source node?

Best regards

former_member182374
Active Contributor
0 Kudos

Hi Said,

In order to map data from the source to the table view I call the 'filter' method in my wdDoModifyView method. so my method look like this:

if (firstTime) {
IWDTable table = (IWDTable) view.getElement("Table");
wdContext.currentContextElement.setTableFilter(table,wdThis.wdGetFilterAction(),wdContext.nodeSource(), new HashTable()));
wdContext.currentContextElement.getTableFilter().filter(wdContext.nodeSource(),wdContext.nodeTable());
}

BTW, I'm using Peter Vignet's table filter:

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

Regards,

Omri

former_member182372
Active Contributor
0 Kudos

Said, try to check whether <i>wdContext.currentContextElement().getFilter();</i> is not null. Are you performing this piece of code in wdDoModifyView method:


if ( firstTime )
{
if ( null != view ) 
{ 
IWDTable table = (IWDTable) view.getElement("Table");
wdContext.currentContextElement().setTableFilter(new TableFilter(table,wdThis.wdGetFilterAction()));
}
}