开发者

Primefaces Pagination Rows can Columns Must be equal?

I'm experimenting with Primefaces navigation and selection and only if my rows and columns values match exactly (both 3 can't be rows=1 columns=3) then I have no problem passing the selected element. When the columns and rows values are not equal the bookmarkletBean.selectedImage setter is never called in the debugger. Why is this?

<p:dataGrid value="#{bookmarkletBean.imageURLs}" var="img" columns="3"
            paginator="true" rows="3" effectSpeed="fast" pageLinks="5" 
            paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" paginatorPosition="bottom">  
            <p:column> 
                 <p:commandLink actionListener="#{bookmarklet.next}">
                       <p:graphicImage value="#{img.u开发者_开发问答rl}" width="125" height="100"/>  
                            <f:setPropertyActionListener value="#{img.url}" target="#{bookmarkletBean.selectedImage}"/>
                </p:commandLink>
            </p:column>  
</p:dataGrid>


As documented in User's Guide, rows refer to the number of data do display per page, this property is inherited from UIData so rows does not mean the number of rows to display.(Special case for datagrid). If you have 12 rows(elements) to display and 3 columns, datagrid will render them in 4 rows which is calculated.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜