Re: Listview Checkbox checked by default and disapearing after submit

2012-12-08 Thread Pat
Thank you so much, I would never have found that! Everything works perfectly
now

cheers



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Listview-Checkbox-checked-by-default-and-disapearing-after-submit-tp4654605p4654610.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Listview Checkbox checked by default and disapearing after submit

2012-12-07 Thread Pat
Hi,

I have searched for this problem and read many entries but I can't seem to
figure it out. I have two problems:

1. When instantiate my ListView with Check checkboxes they are always
checked by default. I can't manage to uncheck them by default.

2. Once I have chosen items from my list via the checkboxes and submitted
the form depending on how many checkboxes have been checked, that amount of
rows just disappears from the bottom of my list. It doesn't matter which
boxes I check, it's always the rows from the bottom up that disappear.

It would be really great if anyone could help, thanks you in advance.

Here is my code:

// initialize CheckGroup
this.checkGroup = new CheckGroup("checkgroup", new
CompoundPropertyModel(this.someList));
someForm.add(checkGroup);

// initialize ListView
this.listView = new ListView("someList", new
CompoundPropertyModel(this.someList)) {

@Override
protected void populateItem(ListItem item) {
String[] array = (String[]) item.getModelObject();
item.add(new Check("checkbox", item.getModel()));
item.add(new Label("label1", array[0]));
item.add(new Label("label2", array[1]));
item.add(new Label("label3", array[2]));
}
};
this.listView.setReuseItems(true);
checkGroup.add(this.listView);


protected void onSubmit() {
LinkedList list =
((LinkedList)checkGroup.getModelObject());

for(int i=0; ihttp://apache-wicket.1842946.n4.nabble.com/Listview-Checkbox-checked-by-default-and-disapearing-after-submit-tp4654605.html
Sent from the Users forum mailing list archive at Nabble.com.

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