Curious: IF no persistence, not even flash, is to be used for person, THEN , how would we handle the case of person being NULL during onPrepareForSubmit?
Specifically, void onPrepareForSubmit() { if (this.person == null) { ///////////////////////////////////////////////////////////////////////////////////////////////// // if not persisting person, will come here during Create person // What can be done here? Or, how to avoid coming here (w/o persistence)? // person does not have Id yet to find it by service // MUST handle this to avoid submit error - // logs indicate empty person in onPrepareForRender is already null by this stage // form data may still be in session(?), but no person object available to bind it } else { ////////////////////////////////////////////////////////////////////////////////////////////// // this is what happens normally in Update Person // Using persistence, even the minimal flash persist, // will allow coming here as well in Create Person // Either way nothing to be done here since person is already in session, // either thanks to @PageActivationContext (update) or // thanks to onPrepareForRender empty person (create) } } Conclusion (possibly wrong?): Some form of persistence is essential - to support create - when onPrepareForRender sets up empty person. Use flash persist annotation - @Persist (PersistenceConstants.FLASH) private Person person -- View this message in context: http://tapestry.1045711.n5.nabble.com/Best-place-to-initialize-form-data-tp5685603p5692646.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org