on 03-30-2011 5:58 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.