on 12-10-2011 10:26 AM
Hi
I am working on implementing Table Filtering in my WD Java application in CE7.2 environment.
Filter functionality is working fine but the issue is I don't get my original data back in to my table after filtering.
Once filtered, my table always shows filtered values only.
Below is the code I have written.
wdDoModifyView
public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
//Logic to Sort
if(firstTime){
viewName=view;
IWDTable table = (IWDTable)view.getElement("tblRequests");
setSortandFilterAttributes();
wdContext.currentContextElement().setTableFilter( new TableFilter( table, wdThis.
wdGetFilterAction(),
(IWDNode)wdContext.nodeResultSet(), null ) );
}
//@@end
}
onActionViewAllRequests: To get original data back in my table.
public void onActionViewAllRequests(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionViewAllRequests(ServerEvent)
//Remove Any Filter Attributes
wdContext.nodeFilterAttributes().invalidate();
//Invalidate table node
wdContext.nodeResultSet().invalidate();
wdContext.currentContextElement().setRequestId("");
wdContext.currentFilterAttributesElement().setRequestStatus("");
WDCopyService.copyCorresponding(wdContext.nodeRequestsFindByUser(), wdContext.nodeResultSet());
//@@end
}
I am not sure where am I going wrong.
I followed tutorial at below link.
[url] http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33f... [url]
I also noticed that in CE7.2, wdContext.currentContextElement().getTableFilter().filter(); does not accept arguments, where as in tutorial which is actually for CE7.1 environment, it accepts arguments.
Any help will be highly appreciated.
Thank you.
Regards
Vineet
Hi vineet,
Please have a look at the following tutorial:
[How to Implement a Web Dynpro for Java Table with Sorting and Filtering Capabilities|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0cf0997-2e08-2d10-b08e-964a2c04c47a]
It's newer than the one you mentioned. It explains how to use the new filtering possibilities where you don't have to create a node for the original data and one for the filtered data. It's much simpler now compared to older WebDynpro versions.
Marcel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcel
Link sent by you was helpful and good but did not solve my problem.
I figured out a workaround for my issue.
I invalidated the filter node and called filter action.
This way, data is getting filtered based on blank filter values and is giving original data set back in the table.
Thank you for the help.
Regards
Vineet
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.