Hi, I'm new to wicket and I'm trying to do a sort of nested list of components, but each list's item (component) has not just info about the model, but also has links to delete/modify
itself from the list...

so I have this html code...

Group.html:
        <div>
                <dl wicket:id="personalList"">
                        
                </dl>
        </div>

and Person.html:
        <dt> <sub>-.</sub> </dt>
<dd><a wicket:id="delPerson" href="#"><img wicket:id="btn_del" src="res/btn_del.jpg"/></a></dd> <dd><a wicket:id="modPerson" href="#"><img wicket:id="btn_mod" src="res/btn_mod.jpg"/></a></dd>
        <dd><label wicket:id="idPerson">01</label></dd>

So the Group.java gets the PersonModel and adds a new Person component to the RepeatingView...

                RepeatingView personalList = new RepeatingView("personalList");
                for (Iterator iter = personalModelList.iterator(); 
iter.hasNext();)
                {
                        PersonModel personModel = (PersonModel) iter.next();
                        final Person oPerson = new Person("person", 
personModel);
                        personalList.add(oPerson);
                }
                add(personalList);

My question is this:

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

I was trying this code inside the Person.java so the component (item from the list) can activate the auto-remove
from the list, but doesn't work:

        final AjaxLink delPersonaRel = new AjaxLink("delPersonLink"){
                        public void onClick(final AjaxRequestTarget target)
                        {
                                getParent().remove(this);
                                System.out.println("person deleted");
                                target.addComponent(getParent());
                        }
                };

Any suggestion appreciated.

PD: Sorry for my english. :)


Felipe Piccolini M.
[EMAIL PROTECTED]




-------------------------------------------------------------------------
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