Hi, looks like I have to make it @Persist if Long usrID is private, if just the default it might be persisted even without a @Persist but a warning during run time, am I right?
A.C. Angelo Chen wrote: > > Hi, > > I got a little confused with need to @Persist, example as follow, the > usrID as not persisted, but when user Submit a form, that value is still > accessible inside OnSuccess, my understanding is, after rendering the > page, the variable is gone, when form submitted, only persisted variable > retains their value, any help on clarifying this question? Thanks, > > A.C. > > public class EditPhoto { > > Long usrID; > > public Long getUsrID() { > return usrID; > } > > public void setUsrID(Long usrID) { > this.usrID = usrID; > } > > Object onSuccess() { > System.out.println(getUsrID()); > return resources.createPageLink(... ); > } > > > above page is invoked by the following code > > @InjectPage > private EditPhoto editPhoto; > > Object onActionFromEdit(Long id) > editPhoto.setUsrID(currentUser.getId()); > return editPhoto; > } > > > -- View this message in context: http://www.nabble.com/T5%3A-Persist-or-not--help-me-understand-this-tf4718768.html#a13506749 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]