Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SelectMany checkbox value-binded with HashMap<String,ArrayList>

843842Jan 26 2007 — edited Nov 17 2007
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2007
Added on Jan 26 2007
9 comments
401 views