Also with this line, you are not taking advantage of a model itself, this is label have an static value on it. >add( new Label( "name", model.getObject().getName() ) ); try something like: >add( new Label( "name", model) );
After loading your page first time, change your Person table in the db and then hit refresh in your web browser, the component label should reflect your changes On Fri, Sep 10, 2010 at 6:57 PM, Mike Dee [via Apache Wicket] < ml-node+2535132-587425177-65...@n4.nabble.com<ml-node%2b2535132-587425177-65...@n4.nabble.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 message @ > http://apache-wicket.1842946.n4.nabble.com/Demystifying-page-serialization-tp2533538p2535132.html > To unsubscribe from Apache Wicket, click > here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>. > > > -- Sincerely, JC (http://www.linkedin.com/in/jcgarciam) Work smarter, not harder!. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Demystifying-page-serialization-tp2533538p2535303.html Sent from the Wicket - User mailing list archive at Nabble.com.