on 04-28-2007 9:45 AM
hi
I am new in webdynpro and I developed a project that is connected to R/3 using RFCs and I bind these output tables of RFCs 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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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()));
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.