简体   繁体   English

ui:repeat中的数据表中的selectBooleanCheckbox

[英]selectBooleanCheckbox in a DataTable in ui:repeat

I'm having some problem using multiple selectBooleanCheckBox in multiple DataTables in ui:repeat. 我在ui:repeat的多个DataTables中使用多个selectBooleanCheckBox时遇到问题。

Something like this 像这样

<ui:repeat var="f" value="#{mybean.values}">
    <rich:dataTable value="#{f.values}" var="v">
        <rich:column>
            <h:selectBooleanCheckbox value="#{mybean.selected[v.id]}"/>
        </rich:column>
    </rich:dataTable>
</ui:repeat>

In the backing bean, in the selected map, I found the wrong ids. 在支持bean的选定映射中,我找到了错误的ID。

Anothery strange behaviour is that when i sort the column using the sortBy attribute, it sorts all the column rendered. 另一个奇怪的行为是,当我使用sortBy属性对列进行排序时,它将对所有呈现的列进行排序。

I've found the bug on the jira 我发现了吉拉上的错误

RichFaces JIRA RichFaces JIRA

If I use the 如果我使用

<c:forEach />

tag instead of 标签代替

<ui:repeat />

Is a little better (no sorting between tables, more values are right in the backing bean), but sometimes it's still wrong. 稍微好一点(在表之间不进行排序,在后备Bean中有更多的值是正确的),但有时仍然是错误的。

Any ideas? 有任何想法吗?

Thanks, 谢谢,

Try using the a4j:repeat . 尝试使用a4j:repeat

I often have problems updating values on the backend using Richfaces from within ui:repeat (although normally with a4j:commandLink/commandButton ). 我经常在ui:repeat使用Richfaces在后端更新值时遇到问题(尽管通常使用a4j:commandLink/commandButton )。

EDIT: And do you have a well defined equals() and hashcode() for the Class that you are adding to the list/set? 编辑:并且对于添加到列表/集合的类,您是否具有定义明确的equals()和hashcode()?

I've resolved ordering the values, since I was binding to a Set. 自从绑定到Set以来,我已经解决了对值进行排序的问题。 I've used the SortedSet. 我用过SortedSet。 Thanks anyway. 不管怎么说,还是要谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM