On Fri, 18 Nov 2011 07:31:48 -0800 (PST)
massizigao <fha...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to