I think you can set the user property in your pageBeginRender() method, implementing PageRenderListener interface. It will be called both before the page starts rendering and rewinding.
On 5/17/05, Javier Molina <[EMAIL PROTECTED]> wrote: > Hello all, > > this is my first Tapestry application. I have used Hibernate before in a > standalone (GUI) application. I will try to explain the situation as > clearly as possible, so this message might get a bit long. > > I have been looking at Tapestry and find it great that it works in an > object oriented fashion rather than worrying about urls, parameters, > etc. I have used <property-declaration> and ognl bindings in forms, so > far so good. > > I have not found an easy way to have Tapestry update hibernate domain > objects. I can load the object, let's say, a NewsItem, use > setNewsItem(item) and display it in a form for editing. I want the edit > page to be stateless because it's easy to find users opening several > edit windows at the same time, so it must be self contained. To this > effect, I'm encoding the primary key in a Hidden field. > > Here comes the problem: the only way I have found that will work is to > have <property-declaration>s for each field in the form, load the object > from the database in the submit listener and copy the properties from > the page to the domain object. I would rather have the ognl bindings > point directly to the object instead of having to do some mechanical > coding like domainObject.setWhatever(getWhatever()); but for this to > work, I'd have to be able to load the object before rewinding, so the > bindings could be applied. > > I am experimenting with a custom DataSqueezer which encodes the class > and primary key of the object so I can pass it around. However, if I > wanted to load the object from the database in unsqueeze, I'd need > access to the hibernate session, which could mean opening the session at > the beginning of unsqueeze and closing it at the end, which would not be > acceptable. I'd like to open the session before the processing of the > form starts and close it when it's done so all the work could be done in > one session. > > Am I missing something obvious? the mechanical > domainObject.setWhatever(getWhatever()); seems to go against the spirit > of Tapestry. How could I work as explained above? > > Thanks in advance. > > --------------------------------------------------------------------- > 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]
