You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by massizigao <fh...@online.de> on 2011/11/18 16:31:48 UTC

Problem with check / uncheck all using CheckGroupSelector

Hello,

i am implementing a dataview table with a checkbox column. At the top of the
column i place a checkbox to select/unselect all rows. But It is not working
as i want.
Using the class Check:  checking and unchecking all rows works, but the
collection to hold the selected rows is not getting populated.
Using the classes CheckBox and AjaxCheckBox: checking and unschecking does
not work, but the collection is getting populated.
Sorry for eventual duplication, but i search this forum and the web and i
couldn't get a hint to fix this problem. I will highly appreciate your help.
Here are some code snippet that  could help:

*My Form*



*Markup:*


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-check-uncheck-all-using-CheckGroupSelector-tp4083663p4083663.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Problem with check / uncheck all using CheckGroupSelector

Posted by massizigao <fh...@online.de>.
Perhaps it can help:

when using CheckBox or AjaxCheckBox the "WICKET AJAX DEBUG" is showing this
error:


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-check-uncheck-all-using-CheckGroupSelector-tp4083663p4092093.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Problem with check / uncheck all using CheckGroupSelector

Posted by massizigao <fh...@online.de>.
Hello Carl-Eric,

Thank you for your answer. I already tried the 1) approch. The problem is
that the check and uncheck all is working, but the Set of the selected
values (selectedValues) is not getting populated.
When i use the CheckBox/AjaxCheckBox class the check and uncheck all does
not work but the Set (selectedValues) is populated.

Thank you for any hint!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-check-uncheck-all-using-CheckGroupSelector-tp4083663p4091287.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Problem with check / uncheck all using CheckGroupSelector

Posted by Carl-Eric Menzel <cm...@wicketbuch.de>.
On Fri, 18 Nov 2011 07:31:48 -0800 (PST)
massizigao <fh...@online.de> wrote:

> Hello,
> 
> i am implementing a dataview table with a checkbox column. At the top
> of the column i place a checkbox to select/unselect all rows. But It
> is not working as i want.
> Using the class Check:  checking and unchecking all rows works, but
> the collection to hold the selected rows is not getting populated.
> Using the classes CheckBox and AjaxCheckBox: checking and unschecking
> does not work, but the collection is getting populated.
> Sorry for eventual duplication, but i search this forum and the web
> and i couldn't get a hint to fix this problem. I will highly
> appreciate your help. Here are some code snippet that  could help:

You need to use the appropriate combination of checkbox, group and
selector.

1) If you use a CheckGroup, then you have to build your checkboxes with
Check instances, and they need to be children of the CheckGroup. In
your example, add your dataview to the CheckGroup, so the Check
instances are also underneath that. Then you can use CheckGroupSelector.

2) You can also use CheckBox instances - these don't need to be grouped
together, they are just all separate boolean checkboxes. To
select/unselect all of these you need to use CheckBoxSelector.

3) You can also use a CheckboxMultipleChoice together with
CheckboxMultipleChoiceSelector. 

For your case I recommend option 1, since you are using listview.

I hope this helps.

Carl-Eric
www.wicketbuch.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org