cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically setting table properties

MarkusKlein
Active Contributor
0 Kudos

Hello everybody,

in an example application im displaying the results of a RFC-FM call in a table. This works fine. Now i want to set the table property 'visibleRowCount' of the table dynamically depending on the amount of entries the RFC call returns.

I know how to set the property during runtime, what i dont know where to place the code, as it has to be done after the results of the RFC call are available (so the wdDoInit Method of the View Context isnt the right place).

I also dont know how to determine the amount of rows.

I appreciate any hints

regards,

Markus

Message was edited by: Markus Klein

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

How do you trigger the RFC? Probably, there is some action handler, so after executing the RFC and retrieving the result, you can place the code to set the number of visible table rows.

To set the visible row count from a controller method: Bind the Table.visibleRowCount property to a context attribute and set the value of this context attribute.

Armin

P.S: You appreciate any "hits"? Probably wrong place here

MarkusKlein
Active Contributor
0 Kudos

Hello Armin,

ok now i know where to place the code, but still not how to determine the amount of rows the RFC delivers. I know i could do it all on the ABAP side and giving the amount of rows as export paramter to the WD application and then bind it to a context attribute, but my intension is to do it on the webdynpro side

So the question remains, how do i determine the amount of rows the RFC gives back after i executed the RFC

This is the code for the RFC execution (standard generation code)

IWDMessageManager manager = wdComponentAPI.getMessageManager();
	try{
wdContext.currentZxss_Get_Employees_InputElement().modelObject().execute();
	wdContext.nodeOutput().invalidate();
	} catch(WDDynamicRFCExecuteException ce) {
		manager.reportException(ce.getMessage(), false);
	}

The Context structure looks is like this:

[code]

- Zxss_Get_Employees_input (root node, 0..1)

--Output (node, 0..1)

---Employees (node, 0..n)

-


Name (attributes)

-


Pernr (attributes)

regards,

Markus

Former Member
0 Kudos

You bound the table UI element to a context node (data source), size of this node is the number of rows.

If you always want to display all rows, simply set visibleRowCount = -1.

Armin

Message was edited by: Armin Reichert

Answers (0)