开发者

JSF 2.1 + RichFaces 4 - Paging dataGrid

I have List<Product> products in my backEnd Bean which contains about 70 items.

I need to show it as 3 X 4 table with option to navi开发者_C百科gate between pages "next", "Previous" and option to click on page number.

How can it be done? I have no problem to use Datagrid, but how to combine it with paging?

Update: I did the following:

  <h:form>
        <rich:dataGrid value="#{productBean.products}" var="product" columns="4" id="productsList">
      <h:outputText value="#{product.sku}"/>
<f:facet name="footer">       
    </f:facet>
    </rich:dataGrid>
<rich:dataScroller for="productsList" maxPages="10"/>
   </h:form>

but my problem is that now I have a table with 4 columns and 18 rows. how Can change it to 3 rows per page?


Put the <rich:dataScroller> in any of the <f:facet> of the <rich:dataGrid> .

For example:

<rich:dataGrid>
        ........................
        ........................
    <f:facet name="footer">
        <rich:dataScroller/>
    </f:facet>
</rich:dataGrid>

Then , the paging control is at the bottom of the data grid.


Note that the real tag looks like this:

<rich:dataScroller />

(Big S, if someone copy paste the previous example will get error!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜