Hello,
Someone can help me please?
Im trying to create a page with a lot of HtmlSelectManyCheckbox, and i need to value-bind then to the same Object in my BackingBean.
First i attemped to bind all HtmlSelectManyCheckbox with a single ArrayList, but only the last SelectMany had their values inserted on the ArrayList...
So, now im trying to bind all the HtmlSelectManyCheckbox with a HashMap<String,ArrayList>, because i would have just one object and for each entry I would have the checkboxes that were cheked in a single HtmlSelectManyCheckbox.
Now my question: there is a way to make this work?
my code example
Backing bean
private HashMap<String, ArrayList> respostaMatrizCheck = new HashMap<String, ArrayList>();
public HashMap<String, ArrayList> getRespostaMatrizCheck() {
return respostaMatrizCheck;
}
public void setRespostaMatrizCheck(HashMap<String, ArrayList> respostaMatrizCheck) {
this.respostaMatrizCheck = respostaMatrizCheck;
and the bindings
<h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['1'] }">
...
<h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['2'] }">
And the error message given when i tryed this is the following:
javax.servlet.ServletException: ValueBinding for UISelectMany must be of type List or Array
Any help would be welcome.
Thanks,
Ferry