cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Java Table Filter: 1) Filter does nothing! 2) Where does TableFilter get filter value from??

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Hi Jana,

Just a small thought: have you bound your table's 'Filter' event to your Filter action?

Former Member
0 Kudos

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

Qualiture
Active Contributor
0 Kudos

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:

  • you have a TableNode which is bound to your table, and all table cell editors are bound to the table editor's text attributes?
  • You have a FilterNode which attributes are bound to the column's filterValue properties?
  • Your table's onFilter event is bound to a Filter action?
  • Your UIElement node, does it has cardinality 1..1?
  • I don't think you need to specify an argument for the filter() method, I normally use a line of code in the event handler such as:
    wdContext.currentContextElement.getTablefilter.filter();


junwu
Active Contributor
0 Kudos

i think you are following a wrong version of tutorial.

table filter changed in nw7 nw7.1 ..... No source node needed in new NW.

please search in SCN.

How to Implement a Web Dynpro for Java Table With Sorting And Filtering Capabilities

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Answers (0)