cancel
Showing results for 
Search instead for 
Did you mean: 

Need to set the Vissible row count Dynamically

Former Member
0 Kudos

Hi,

I have requirement where i am supposed to set the Vissible row count for a table dynmaically, depending upon the number of rows in a table.

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi Delphi,

You can set visible row count to -1 and it will display all the rows as visible. Or alternatively, create an attribute say rowcount in context and set the no of rows before displaying it to the users

int noOfRows = <tablename>.getSize(); // this method returns the no. of rows in the the table.

wdContext.currentContextElement().setRowCount(noOfRows);

Hope this helps you.

Regards

Abhinav

Former Member
0 Kudos

Or use a calculated attribute.

Create an attribute in the context called calcVisibleRowCount of type integer and make it read only and calculated. Then bind that attribute to the visibleRowCount attribute of your table.

The method for the attribute looks something like this:

(this displays 10 rows per page if more than 10 records in the node, otherwise it displays the same number of rows in the table as in the context)

public int getCalcVisibleRowCount(IPrivateStartsida.ILayoutElement element)

{

//@@begin getCalcVisibleRowCount(IPrivateStartsida.ILayoutElement)

if (wdContext.nodeXXXX().size() > 10) {

return 10;

} else {

return wdContext.nodeXXXX().size();

}

//@@end

}

Note that this attribute is not created in the node that you want to count number of elements in.

Edited by: Richard Linnander on Apr 1, 2011 3:41 PM

Answers (0)