cancel
Showing results for 
Search instead for 
Did you mean: 

Java WD table attributes

Former Member
0 Kudos

Hello all,

I'll explain the issue first:

I made a screen where I can search some Business Partners (via RFC). Each time I push the "Search" button I get a result table with my Business Partners. But when I go to the next pages of my result table and then push "Back" and search again, the result table is on the page I last visited.

The question is obvious: how can I have the first page instead of the last page I visited.

I know there's a table property "firstVisibleRow" but I don't know how to get and set it. BTW, it is set on 0.

I found that there's an interface that has methods to bind and set the first visible row (see link) but when I want to implement it (public class Anything implements IWDTable) it doesn't work. I don't know the import I have to make to be possible to implement this interface.

[http://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/api/IWDTable.html#getFirstVisibleRow()]

I thought I could put the correct code that is setting the "firstVisibleRow" to zero in the wdDoInit()-method and thus call it every time the page is called. Would this be OK or shouldI solve the issue in another way?

Kr,

RS

Accepted Solutions (1)

Accepted Solutions (1)

nikhil_bose
Active Contributor
0 Kudos

hi Rob,

try

 
wdContext.nodePartners().setLeadSelection( 0);

or go to context - node properties, set initializeLeadSelection to false

plz let me know the status.

Former Member
0 Kudos

It doesn't work. I tested it also by setting some other integer in setLeadSelection (for example: wdContext.nodePartners().setLeadSelection( 6);). The first time it works and the requested row is displayed but the next time I perform the search, the first row of the table is selected but the last page you visited is displayed (and not the one with the lead selection thus).

Should I place the functionality in another method than wdDoInit()?

Thanks,

RS

Former Member
0 Kudos

Please read my post and set the context attribute to the desired row index in the action handler that reads the new table data.

Armin

Former Member
0 Kudos

Armin,

I created a Value Node (FirstRowNode) and a value attribute (FirstRowAttr, type integer) and assigned FirstRowNode.FirstRowAttr as value for the attribute firstVisibleRow from my table.

I call the value attribute like this in my wdDoInit() method: this.wdContext.currentFirstRowNodeElement().setFirstRowAttr(0);

I get a NullPointerException in my application even if I try to place it in the OnActionGoBack() method linked to my "Back" button.

Greetz and thanks allready,

RS

Former Member
0 Kudos

Either put the attribute directly under the context root, or give the value node cardinality=1:1, selection=1:1.

Armin

Former Member
0 Kudos

Thank you very much for your help!

Answers (1)

Answers (1)

Former Member
0 Kudos

To control the first visible row you have to create a context attribute A (integer), bind the "firstVisibleRow" property of the Table UI element to A and set the value of A to the index (zero-based) of the row.

Armin