Hi,
All I need to do is check/uncheck some checkboxes based on a condition when a "select" checkbox is checked/unchecked.
I created an ArrayList of beans and accessed them from the jsp page
using datatable. After displaying the jsp page, i will click on the "select"
checkbox. Here I have a valueChangeListener, which calls a method
from my backing bean. Here is my code which explains the problem
better:
jsp page:
<dataTable value="#{handler.arraylist} var="bean">
...
<h:selectBooleanCheckbox value="#{bean.isChecked}"
valueChangeListener="#{handler.processValueChange}"
immediate="true" onclick="submit()"/>
....
</dataTable>
handler.java:
processValueChange(ValueChangeEvent event) {
bean = arraylist.get(index);
if (condition){
bean.setIsChecked(true);
arraylist.set(index, bean);
}
}
This code is not changing the value of the checkbox. But when I display
the value of "bean.isChecked", it is displaying "true". And the result is
not reflected in the jsp page.
Can anyone please help me with this?
Thanks in advance.