Hmmm... I have used custom classes several times and they persist OK.
I guess maybe you're doing something else to the property in your
.java?



On 7/21/05, Richard V. <[EMAIL PROTECTED]> wrote:
> What do you mean by abstract properties? Do you mean to define the javabeans
> functions as abstracts in the page class? Something like:
> 
> public abstract String getMyValue(); public abstract void setMyValue(String
> value);
> 
> But these functions are related to accessing the properties in the page
> class implementation declared from the .page file. I only make use of
> "myValue" property from within the .page file, so I don't need those
> abstract functions from above.
> 
> Richard
> 
> 
> >From: "Patrick Casey" <[EMAIL PROTECTED]>
> >Reply-To: "Tapestry users" <[email protected]>
> >To: "'Tapestry users'" <[email protected]>
> >Subject: RE: Custom class persistent objects are not persistent
> >Date: Thu, 21 Jul 2005 18:56:55 -0700
> >
> >
> >       If memory serves, the "persistent=yes" tag only works on abstract
> >properties. Concrete properties like you use are going to require you
> >persist them yourself.
> >
> >       --- Pat
> >
> > > -----Original Message-----
> > > From: Richard V. [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 21, 2005 6:48 PM
> > > To: [email protected]
> > > Subject: Custom class persistent objects are not persistent
> > >
> > > Hello everyone,
> > >
> > > I have a problem with Tapestry 3.0.3 in regard to persistent properties
> >in
> > > a
> > > page. I noticed that for java simple class objects such as String,
> > > Integer,
> > > Boolean, etc. used as persistent properties in a page behave as
> >expected;
> > > i.e. they are part of the http session. However, this does not seem to
> > > hold
> > > if you use complex classes (i.e. created by composition of other simple
> > > classes). For example the following class:
> > >
> > > public class VString implements Serializable {
> > >   String value = null;
> > >
> > >   public VString() {}
> > >   public VString(String str) {
> > >     setValue(str);
> > >   }
> > >   public void setValue(String str) {
> > >     value = new String(str);
> > >   }
> > >   public String getValue() {
> > >     return value;
> > >   }
> > > }
> > >
> > >
> > > And to use it in a page, I will define the following:
> > >
> > > <property-specification name="myValue" persistent="yes" type="VString"
> > > initial-value="new VString('default')"/>
> > >
> > > <component id="inputValue" type="TextField">
> > >     <binding name="value" expression="myValue.value"/>
> > > </component>
> > >
> > > The property myValue will not persist and resets to "default" on the
> >next
> > > refresh of the page. However, it will stay if you change the type from
> > > VString to String.
> > > So, my question would be: is this normal behavior from Tapestry or am I
> > > missing something to get this work?
> > >
> > > Many thanks in advanced.
> > >
> > > Richard
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Communism is man's exploitation of man. Capitalism is just the opposite.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to