You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Filip Balas <fb...@IMVProjects.com> on 2004/12/08 18:43:12 UTC

Can Initial-Value be a Constant?

I hava a class: 

public abstract class foo extends BasePage {
  public static final int MOJO = 0;
  public static final int MOREMOJO = 10;

}

And I would like to create a foo.page with a property
in the foo.page:

<property-specification name="howMuchMojo" type="int" initial-value="foo.MOJO" persistent="no"/>

This does not work, I recieve an error:
Unable to initialize property howMuchMojo of com.bobnet.stuff.foo$Enhance_67@9486a5[]: 
Unable to read expression '<parsed expression>' of com.bobnet.stuff.foo$Enhance_67@9486a5[].
I have tried the following initial-value combinations:
MOJO
foo.MOJO
com.bobnet.stuff.foo.MOJO
Is it even possible to initialize a property with a constant?
Any Suggestions?
Filip


Re: Can Initial-Value be a Constant?

Posted by Bryan Lewis <br...@maine.rr.com>.
Try this syntax:

   <property-specification ...  initial-value="@foo@MOJO" ... />

http://www.ognl.org/2.6.3/Documentation/html/staticFields.html



----- Original Message ----- 
From: "Filip Balas" <fb...@IMVProjects.com>
To: "Tapestry (E-mail)" <ta...@jakarta.apache.org>
Sent: Wednesday, December 08, 2004 12:43 PM
Subject: Can Initial-Value be a Constant?


I hava a class:

public abstract class foo extends BasePage {
  public static final int MOJO = 0;
  public static final int MOREMOJO = 10;

}

And I would like to create a foo.page with a property
in the foo.page:

<property-specification name="howMuchMojo" type="int"
initial-value="foo.MOJO" persistent="no"/>

This does not work, I recieve an error:
Unable to initialize property howMuchMojo of
com.bobnet.stuff.foo$Enhance_67@9486a5[]:
Unable to read expression '<parsed expression>' of
com.bobnet.stuff.foo$Enhance_67@9486a5[].
I have tried the following initial-value combinations:
MOJO
foo.MOJO
com.bobnet.stuff.foo.MOJO
Is it even possible to initialize a property with a constant?
Any Suggestions?
Filip



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org