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
我在jira上发现了这个bug
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,
2 个解决方案
#1
Try using the a4j:repeat
.
尝试使用a4j:重复。
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()?
#2
I've resolved ordering the values, since I was binding to a Set. I've used the SortedSet. Thanks anyway.
我已经解决了对值的排序,因为我绑定了一个Set。我使用过SortedSet。不管怎么说,还是要谢谢你。
#1
Try using the a4j:repeat
.
尝试使用a4j:重复。
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()?
#2
I've resolved ordering the values, since I was binding to a Set. I've used the SortedSet. Thanks anyway.
我已经解决了对值的排序,因为我绑定了一个Set。我使用过SortedSet。不管怎么说,还是要谢谢你。