Hi,

I don't believe so, source for @Persist only seems to support the value parameter to set the persistence type (client,session,flash). The approach I use is to set any persisted values I want defaults for in a pre-render stage (BeginRender usually). I like to group them all in one method. Of course your wrapper methods idea seems fine if you prefer a method-per-object convention.

-Rich

On 12/03/2010 09:39 AM, Richard Hill wrote:
Hi,

I was wondering whether it's possible to set or define a default value
for an object that is @Persist'd?

e.g something equivalent to:

public Object getPersistedObject() {

   if (object == null) {
       object = new Object();
       object.setSomeValues(...);
   }
   return object;
}

Obviously I can provide my own wrapper method(s) akin to the above for
accessing anything that's @Persist'd, just wondering whether there was
anything built into T5?

Thanks Richard.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to