If you have properly coded all of your models and subcomponents on the page,
you should be able to do something like:

add(new Link("editPerson", theModelOfThePersonThisLinkWouldEdit) {
  public void onClick() {
    // replace the page's model with the model given to this link
    getPage().setModel(getModel());
  }
});

There's probably not a huge advantage over just doing:
setResponsePage(new PersonEdit(getModel()));


-- 
Jeremy Thomerson
http://www.wickettraining.com

On Thu, Jan 15, 2009 at 6:22 PM, Phillip Rhodes
<[email protected]>wrote:

> I have been searching, but all the examples that I come across use a
> standalone page for editing an object.
>
> For example, clicking this link will take the user to a PersonEdit page.
>                add(new Link("editPerson") {
>                    public void onClick() {
>                        setResponsePage(new PersonEdit(person, peopleList));
>                    }
>                });
>
>
> I also have an edit link, but instead of going to another page, I just want
> a form that I have already have on the page to be updated to the selected
> person.
>
> Should I just still call "setResponsePage" using my current page's
> constructor, or is there a way that I can update the form on my page to be
> bound to a new person?
>
> Right now, in my onClick handler, while I can retrieve the new person, I
> can get the form model to reflect the new person.
>
>
> Day 2 with wicket!
> Phillip
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to