On Feb 18, 2008 10:26 AM, Chris Poulsen <[EMAIL PROTECTED]> wrote: > Hi, > > I've been trying to persist a couple of page properties that are being > used by a couple of DateField's in a component, but without success so far. > > I would like to have the following: > > 1) The properties bound to the DateField's value parameter should be > stored in a cookie upon successful submit. > > 2) When rendering a page containing DateFields where the value parameter > properties are backed by cookies; an attempt to load the last saved > value from the cookie should be made (falling back to the "usual" > default value in case of a missing cookie or invalid persisted values). > > I've tried injecting "Cookies" and using the read method in > beforeRender() and the write method called from page onSuccess(), but > without success.
That's somewhat surprising, but may be a side-effect of Tapestry's sending client-side redirects (I have to check to make sure cookies work in that situation... they should). Perhaps its the method name: beginRender() not beforeRender(). > > How would I go about implementing 1) and 2) ? > > TIA! > > PS. This is something that we use all over the place in the applications > I do in my day job (reporting software). It would be really nice if it > was possible to simply annotate the class fields in some way and have > the framework generate the necessary persistence code. But that is just > a crazy idea, I have no idea whether it would actually be possible to > implement such an annotation ;) > > -- > Chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]