I found an example of re hydrating an entity in the Stripes docs. It uses a prebind method - same situation as we are talking about. This approach is very similar to what I have used in the past. I am still very much interested in the way that it's done in your example.
http://www.stripesframework.org/display/stripes/Binding+Into+Domain+Models sboulay wrote: > > Thanks for all the replies. Freedy, contact.id and contact.firstName are > both parameters at the same level. I totally understand the parameters > being bound before the event being called. I also understand why you put a > setContactId on the actionBean – it seems that stripes will collapse > contact.id to contactId and try to set it as a property on your actionbean > before calling getContact().setId(). > > > Form to be submitted for Update > > <s:form beanclass="ContactFormActionBean"> > <div><s:hidden name="contact.id"/></div> > <table> > <tr> > <td>FirstName:</td> > <td><s:text name="contact.firstName"/></td> > </tr> > </table> > ..... > </form> > > I am probably missing something in your explanation about the parameters. > If I changed the code like this – would it make any difference? Notice I > changed the order of the hidden field. If the answer is contact.id > parameter will always be set before the contact.firstname I definitely > missed something in your explanation. I thought that maybe properties of > the actionBean are set before nested objects .. but I can’t really > confirm. > > > <s:form beanclass="ContactFormActionBean"> > <table class="form"> > <tr> > <td>FirstName:</td> > <td><s:text name="contact.firstName"/></td> > </tr> > </table> > <s:hidden name="contact.id"/></div> > ...... > </form> > > Thank > -Serge- > > > Freddy D. wrote: >> >> Hi Serge, >> >>> Is there any guarantee that the hidden form value (contactId) would be >>> set >>> on the ActionBean before getContact is called? Is it the form order that >>> determines this? I have no idea. >> >> The way this is used, there is a guarantee in that first, parameters are >> bound and that includes the hidden form value. So setContactId is called. >> getContact() can then be used in the event handler to get the contact, >> and/or in the JSP to render the result, because event handling occurs >> after parameter binding, and rendering the view (resolution execution >> which is a forward to the JSP) occurs after event handling. >> >> Hope that helps. >> >> Cheers, >> Freddy >> >> >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Stripes-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/stripes-users >> >> > > -- View this message in context: http://www.nabble.com/Stripes-book-example-question-tp19213699p19237193.html Sent from the stripes-users mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
