-
1. RichFaces begginer's questions.
lfryc May 9, 2011 4:31 AM (in response to kardanov)1 of 1 people found this helpfulHello,
1. actually @rows attribute should limit displayed number of rows and you need to use dataScroller (or other way) to scroll through your model. When it is not working for you, could you please post your sample (managed bean + XHTML) or directly a sample application source?
1b. According to extra rows - this is not built-in feature - you have several options: a) customize component to your requirements, b) trigger a feature request in RichFaces JIRA, c) wrap your model that EDT will get empty extra data model items on the end of data collection
2. Disabling of features like resizing/disabling horizontal scrollbar are reasonable feature requests - could you please fire a Feature Request in RichFaces JIRA?
-
2. RichFaces begginer's questions.
kardanov May 10, 2011 7:50 AM (in response to lfryc)Hello and thank you for your reply.
1. Yes, @rows attributes limit number of displayed rows, and if I set it to 10, only 10 of them per page are shown. But some times I have e.g. 5 rows, but I want 10 rows to be displayed (5 rows with actual data and 5 extra empty rows). As I understood there are no built-in possibility to do this. If you can describe how to customize component (or follow me to some place where it is already described), it will be really appreciated.
Here is my sample as you asked me, but there is nothing exciting in it:
Part of my index.xhtml:
<rich:extendedDataTable rows="10" id="myElements" style="width:100%" var="element" value="#{myBean.elements}">
<rich:column width="364px" label="Element field 1">
<f:facet name="header">
<h:outputText value="Field 1" id="field1" />
</f:facet>
<h:outputText value="#{element.field1}" />
</rich:column>
<rich:column sortable="true" width="364px" sortBy="#{element.field2}" label="Element field 2" filterBy="#{element.field2}" filterEvent="onkeyup">
<f:facet name="header">
<h:outputText value="Field 2" id="field2" />
</f:facet>
<h:outputText value="#{element.field2}" />
</rich:column>
</rich:extendedDataTable>
<rich:dataScroller for="myElements" maxPages="3" />
As you can see there is data scroller, which splits data into (max) 3 pages by 10 rows in each. But the point is to handle situations with less than 10 rows as i described above.
My managed bean is really simple with list of elements, each with two fields as specified.
Thanks in advance for any help.
-
3. RichFaces begginer's questions.
lfryc May 10, 2011 9:46 AM (in response to kardanov)My point was use your dataModel (#{myBean.elements}) as the entry point for adding empty rows.
Say you will create separated method (#{myBean.elementsIncludingEmpty}) that will internally use (wrap) MyBean#getElements() and in cases there are too many elements, it will add relevant number of empty elements.
This is simplest solution and it presumes that there will be no errors when using empty elements.
-
4. RichFaces begginer's questions.
kardanov May 11, 2011 12:49 AM (in response to lfryc)Thank you for the reply and for help.
That was an idea I thought about,so will do it in this way.