on 05-23-2008 4:53 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
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)
hi,
Gopal s right the table filter class take care of this.
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.