I am using rich faces data table tag in my jsf:
<r:dataTable id="dataTable" var="user" preserveDataModel="false"
value="#{ListUsersManagedBean.users}" rows="10"
rowId="#{user.firstName}" rowKeyVar="index"
width="500" style开发者_如何学运维="float:centre" reRender="ds" columnClasses="center">
Here i have configured rowsize as 10 in static way.I want to give the user a dropdown in the table so he can select number of rows 100,200,300,400 etc below the column.How can i do this.Or any better solution?
Thanks
You can do that by binding a variable to rows like rows = #{yourBean.noOfRows}
and same to the combo box, and reRender
your datatable
onChange of comboBox
.
This can be done if you are strict to use <rich:dataTable>
or you can use jQuery datatable easy to integrate and easy to use for the functionality you need.
精彩评论