Felipe Piccolini <felipe.piccolini <at> bluesoft.cl> writes:

> How can I do to make the "delete this person" works in order to 
> get it removed from the RepeatingView?

Several issues:
1) The repeating view should be associated with each item in the list,
not the list itself.
2) If you delete an item from the list, you have to refresh the whole
list.
3) To delete an item, you need to delete your "person" component (the
parent of the ajax link), not the ajax link itself.

Here is some sample code that works:

<html>
<head></head>
<body>
<div>
<dl wicket:id="personalList">
<span wicket:id="person">
<dt> <sub>-.</sub> </dt>
<dd><a wicket:id="delPerson" href="#">delete</a></dd>
<dd><label wicket:id="idPerson">01</label></dd>
</span>
</dl>
</div> 
</body>
</html>

public class Group extends WebPage {
        public Group() {
                final WebMarkupContainer pl = 
                        new WebMarkupContainer("personalList");
                pl.setOutputMarkupId(true);
                final RepeatingView v = new RepeatingView("person");
                for (int i = 0; i < 3; i++) {
                        WebMarkupContainer p = 
                        new WebMarkupContainer(Integer.toString(i));
                        p.add(new AjaxLink("delPerson") {

                                public void onClick(
                                        AjaxRequestTarget target) {
                                        v.remove(getParent());
                                        target.addComponent(pl);
                                }

                        });
                        p.add(new Label("idPerson", Integer.toString(i)));
                        v.add(p);
                }
                pl.add(v);
                add(pl);
        }
}



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to