on 08-15-2012 3:45 PM
Hello,
at the moment Web Dynpro Table Filter devils me. My task is to create a table filter where no one is, copying from a well working filter in another component.
The only thing that might be special about my WD component (though I cannot imagine any effect) is that it has no own application, so it's only embedded in several other components.
I really did all alike the working example, and also all alike the tutorials:
* creating 3 different kind of context nodes: SourceNode, TableNode, FilterNode
* creating an onActionFilter method
* initializing the TableFilter in mehtod wdDoModifyView
* connecting the column texts to TableNode attributes
* connecting FilterValue of columns to FilterNode attributes
* the FilterTable class is okay, I'm using the same class like those working filtered tables
The code is:
public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view,
boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime) {
wdContext.currentUIElement().setTableFilter(
new TableFilter(table, wdThis.wdGetFilterAction(),
wdContext.nodeSourceNode(), null));
wdThis.onActionFilter(null);
}
//@@end
}
public void onActionFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent
wdEvent )
{
//@@begin onActionFilter(ServerEvent)
if (wdContext.currentUIElement().getTableFilter() != null)
wdContext.currentUIElement().getTableFilter().filter
(wdContext.nodeSourceNode(),
wdContext.nodeTableNode());
//@@end
}
Problem / Symptoms:
The result is that in my table, no strings for the entries are shown. But the entries are there! I can interact with them and still select a row, but no texts are there and the filter is disabled. It looks like this: (first 3 rows still are there, table isn't empty)
In the end I even assigned the Event Property of the table, "onFilter", to the Filter action (though it's nowhere said to be necessary or actually set). But nothing happened.
There's another question that strikes me:
What the hell do I need the FilterNode for? I mean, how does the TableFilter get the typed filter value? Nothing like that is passed to the TableFilter.
Please have a look at this problem. I appreciate every idea.
Regards
Jana
Hi Jana,
Just a small thought: have you bound your table's 'Filter' event to your Filter action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robin,
Yes, I assigned the "onFilter" event of the table to a "Filter" action, which has the "onActionFilter" event handler method like above.
(though the working referee table doesn't have it assigned)
By the way: I'm using Netweaver 7.3, forgot to mention that before.
Regards
Jana
-------------------------------------------------------------------------------------------------------------
Additions:
Don't know why or whether my edits for above vanished, I'll add it again to be sure:
* I assigned the column text property to TableNode attribute.
* I assigned the column filterValue property to FilterNode attribute.
* Here's how the table looks like now:
(The first 3 rows still exist! You can select them, but no text content is shown.)
Message was edited by: Jana Neujahr
Hi Jana,
I don't think you need to bind the column text property to your tablenode attribute, you need to bind the celleditor text property to your tablenode attribute.
So, as a checklist:
Hi Robin,
you're right, I also found out that the problem was that (though the columns were bound properly) the table itself had still been bound to the source node! That's why there actually were entries (from SourceNode).
The TableNode I hadn't filled properly (that's why there was no text) - that has been a problem with beeing an embedded util view. It was no use filling the node in wdDoInit or wdDoModifyView (firstTime=true), because the interface was filled from outside somewhen after these events and the node I got the values from was still empty. I found the filling method from the Component interface and added to fill the TableNode as well.
Thanks so much for your help, also to Jun!
Regards
Jana
Addition:
To also answer my question "Where does TableFilter get filter values from":
The attributes that are for filtering (in the FilterNode and bound to the filter row) seem to must have exactly the same name as the one in the SourceNode and TableNode.
Also, the two nodes TableNode and SourceNode which are passed to the TableFilter routine shall both have all necessary attributes that are needed to be shown or used in the table. Then these same-named attributes will be filtered. Some unnecessary attributes that you won't ever need in the table (e.g. for more sorting etc.) you don't have to copy to the TableNode.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.