You're not detaching your model, for one.  You either need to set it
as the "default" model (which will automatically be detached) on the
page or manually detach it in an onDetach() method.

how are you reloading the page?  How are you getting to this page in
the first place?

On Fri, Sep 10, 2010 at 5:57 PM, Mike Dee <mdichiapp...@cardeatech.com> wrote:
>
> I tried this with a detachable model.  I created two versions of the page,
> one uses a detachable model and the other doesn't.  I put a printout  in the
> constructor of the page.  The printout appears only the first time the page
> is loaded in both cases.  Here is the code.  What am I doing wrong?
>
> // Detachable model
> public PersonPage( int id )
> {
>  PersonDetachableModel model = new PersonDetachableModel( id );
>
>  System.out.println( "** HERE I AM **" );   // This doesn't appear upon
> RELOAD OF PAGE.
>
>  add( new Label( "name", model.getObject().getName()  ) );
> }
>
> public class PersonDetachableModel extends LoadableDetachableModel<Person>
> {
>  private int personId;
>
>  public PersonDetachableModel( int id )
>  {
>    personId= id;
>  }
>
>  public Person load()
>  {
>    Person person = db.findPerson( personId );
>    return person;
>  }
> }
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Demystifying-page-serialization-tp2533538p2535132.html
> Sent from the Wicket - User 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
>
>

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

Reply via email to