It persists it in the session for that specific page. -----Original Message----- From: Nima Boustanian [mailto:[EMAIL PROTECTED] Sent: Friday, March 10, 2006 11:21 AM To: Tapestry users Subject: Re: @Persist("problems")
Maybe I am way off here, but @Persist("session") should save the content throughout the session right? It might be difficult to determine what's wrong with the code if you just see it by mail, but I've grasped the concept correctly haven't I? Maybe I should just go back to my deprecated visit class :p Nima Boustanian wrote: > Hey all > > I am trying to get the @Persist annotation to work but no dice :( > I can output the person.username in Main.html but the component in > Main.html - Placeholder.html - can't output it. > Am I doing something wrong with the @Persist annotation? As you can > see I've included it in both Home.java and > Main.java just as a safety-newbie-move, but it still won't output > anything! Main.html can output person.username because > of "nextpage.setPerson(person)" but if I remove the line " > nextpage.setPerson(person); " person will be null and Tapestry will > throw an exception. > > Is there anything else that I have forgotten that is required to make > @Persist work? Thanks! > > //Home.java > @Persist("client") > public abstract Person getPerson(); > public abstract void setPerson(Person person); > > public IPage onSubmit(IRequestCycle cycle) { > ... > setPerson(person); //Doesn't work > nextpage.setPerson(person); > cycle.activate(main); > } > > > //Main.html > <span jwcid="@Insert" value="ognl:person.username"/> //Will output the > username > > //Main.java ("this is the nextpage") > @Persist("client") > public abstract Person getPerson(); > public abstract void setPerson(Person person); > > > //Placeholder.java ("a component in Main") > public abstract Person getPerson(); > > //Placeholder.html > <span jwcid="@Insert" value="ognl:person.username"/> //Doesn't work > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]