Skip to Content
author's profile photo Former Member
Former Member

Table data not getting populated after filtering

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-c0ed7d33fe65?QuickLink=index&overridelayout=true [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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 12, 2011 at 09:58 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.