setreuseitems(true) on listview... OR use a model to contain your
arraylist...
Fabien D. wrote:
I've investigued the ListView, and i have succeded for doing my dynamic
adding item.
The problem now is that when i add a Item, all the fields are reseted, It
don't keep the information in the field.
The is my code :
this.test = new ArrayList();
CheckBox toto = new CheckBox("selected");
FileUploadField upload = new FileUploadField("upload");
TextField description = new TextField("description");
test.add(new CUploadArticle(toto,upload,description));
ajout_site = new ListView("list_site", test) {
protected void populateItem(ListItem item) {
CUploadArticle p = (CUploadArticle)
item.getModelObject();
item.add(p.getRadio());
item.add(p.getId());
item.add(p.getName());
}
};
this.form_ajoutinfcommunautaire.add(ajout_site);
Link lien = new Link("ajout_site") {
public void onClick() {
CheckBox toto = new CheckBox("selected");
FileUploadField upload = new FileUploadField("upload");
TextField description = new TextField("description");
test.add(new CUploadArticle(toto,upload,description));
ajout_site.setList(test);
}
};
lien.add(new Label("name","Upload another file"));
lien.setVisible(true);
this.form_ajoutinfcommunautaire.add(lien);
How can i do this???
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]