VwpFAQConfigureRowsinTable

How to Configure the Number of Rows in a Table Component


The following describes how you can configure a Table component in VWP so that it will display a different number of rows than specified by the default. The process ensures that when the application redisplays the Table component (such as when it is opened at a later point in the application) it will not revert to the default number of rows.


In some instances the way the page displays in the Visual Designer and the Table Layout dialog are not synchronized in terms of a table's default number of rows. For example, you may modify the page size of a table using the Table Layout dialog, but the change does not seem to take effect when you open the page containing the Table component in the Visual Designer. You can handle this situation in either of two ways:


1. Edit the JSP source for the Table component
2. Use the Table Layout dialog


Edit the JSP Source for the Table Component


You can edit the Table component's JSP source. Such editing entails adding the following attributes:


* paginateButton
* paginationControls
* rows


Here is how to modify the JSP source for a page with a Table component. Open the page so that it appears in the Design window. Then, click the JSP tab in the Design window to open the JSP source editor.


Examine the source code and locate the ui:table and ui:tableRowGroup properties. You should see code similar to the following for the Table component. (The position co-ordinates of your table will probably be different than shown here.)


      <ui:table augmentTitle="false" binding="#{Page1.table1}" id="table1"
		style="position: absolute; left: 48px; top: 72px" title="Table"
		width="360">
      <ui:tableRowGroup binding="#{Page1.tableRowGroup1}" id="tableRowGroup1"
		rows="10" sourceData="#{Page1.defaultTableDataProvider}"
		sourceVar="currentRow">



Now, add the paginateButton and paginateControls attributes to the ui:table property and change the value of the rows attribute for the ui:tableRowGroup property. Set both paginateButton and paginateControls to true and change the default value of rows from 10 to 5. After you make these changes, the JSP code should look like this:


     <ui:table augmentTitle="false" binding="#{Page1.table1}" id="table1"
		paginateButton="true" paginationControls="true"
		style="position: absolute; left: 48px; top: 72px" title="Table"
		width="360">
     <ui:tableRowGroup binding="#{Page1.tableRowGroup1}" id="tableRowGroup1"
		rows="5" sourceData="#{Page1.defaultTableDataProvider}"
		sourceVar="currentRow">



To see these changes, return to the Design view of the page by clicking the Design tab. Refresh the display from the context menu.


Using Table Layout Dialog


You can also get the same results using the Table Layout dialog. Select the Table component on the page, then click Table Layout from the Table component's context menu. Click the Options tab in the Table Layout dialog, then check Enable Pagination. You should also specify the number of rows to display. When finished, click OK.


If you should re-open the Table Layout Options tab, it is possible that the number of rows may revert to the default number, which is 10. To avoid this problem, refresh the page in the Design window using the context menu immediately after closing the Table Layout dialog. If you should happen to re-open the Table Layout dialog without doing the refresh, click Cancel in the dialog and then refresh the page in the Design window.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo