This content has been marked as final.
Show 3 replies
-
1. Re: problem with h:selectBooleanCheckbox in rich:dataTable
gena777 Nov 27, 2007 8:36 PM (in response to crisyag)Try value="#{true}"
Gena -
2. Re: problem with h:selectBooleanCheckbox in rich:dataTable
ilya_shaikovsky Nov 28, 2007 6:23 AM (in response to crisyag)known bug. Will works fine with EL binding.
-
3. Re: problem with h:selectBooleanCheckbox in rich:dataTable
crisyag Nov 28, 2007 11:53 AM (in response to crisyag)Thanks Gena, it worked fine
Now I have another problem when I need to change the value of h:selectBooleanCheckbox dynamically. Here is the code:<h:selectOneMenu id="selectGroup" valueChangeListener="#{ContactList.showGroupContacts}"> <f:selectItems value="#{ContactList.selectGroupList}" /> <a4j:support event="onchange" reRender="groupContactsPanel"/> </h:selectOneMenu> <a4j:outputPanel id="groupContactsPanel"> <rich:dataTable id="groupContacts" value="#{ContactList.allContacts}" var="contact"> <rich:column> <h:selectBooleanCheckbox value="#{contact.check}" /> </rich:column> <rich:column> <h:outputText value="#{contact.name}" /> </rich:column> </rich:dataTable> </a4j:outputPanel>
The method showGroupContacts change the value of contact.check to true considering the contacts of the group chosen in h:selectOneMenu. However, when the datatable is rendered, h:selectBooleanCheckbox values do not change, even though they are changed by method showGroupContacts:public void showGroupContacts(ValueChangeEvent event) { String selectedGroup = (String) event.getNewValue(); List groupContacts = (List) this.groups.get(selectedGroup); for (Iterator i = groupContacts.iterator(); i.hasNext();) { Contact c1 = (Contact) i.next(); for (Iterator j = allContacts.iterator(); j.hasNext();) { Contact c2 = (Contact) j.next(); if (c1.getId() == c2.getId()) c2.setCheck(true); } } }
Is there any problem with the code? How can I fix it?
Thanks a lot for the help,
Cristiane Yaguinuma.