[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    RE: PropertySelection initialization
From:       "Dyson, Jimmi" <dysonj () quindell ! com>
Date:       2004-11-26 13:38:38
Message-ID: 5168BC246FB6D511890A0002A57546973768E4 () QUOBPDC
[Download RAW message or body]

Your declaration model="ognl:@worksheet@ORDER_MODEL" means that the model
attribute will map to the ORDER_MODEL static field of the worksheet class.
Check out the OGNL language guide
(http://ognl.org/2.6.7/Documentation/html/LanguageGuide/index.html) and
specifically the getting static fields page
(http://ognl.org/2.6.7/Documentation/html/LanguageGuide/staticFields.html).
I find the language guide extremely helpful indeed!

By declaring it as static and then setting it in your pageBeginRender method
(if indeed you need to do this - different model depending upon some form
inputs for example), make sure this is thread-safe...

If you change the declaration to model="orderModel" and implement a property
in your page class called orderModel (i.e. public IPropertySelectionModel
getOrderModel()) then you don't need to declare the property selection model
as static.
 
As an aside, as you use Tapestry more, I'm sure you will make the change to
using the page spec for all declarations. After all, this is one of the
points of Tapestry - separation of duty for the web designer and Java
developer. Even if you do both jobs (as I do), IMHO this separation
certainly makes it clearer what is going on.

-----Original Message-----
From: Andreas Vombach [mailto:andreas.vombach@psi.ch] 
Sent: 26 November 2004 13:15
To: Tapestry users
Subject: Re: PropertySelection initialization

I did it like in the simple component reference example - so I will 
study the way you do it, I do not have the declaration in the page but 
in the html:

<span jwcid="order@PropertySelection" 
model="ognl:@worksheet@ORDER_MODEL" value="ognl:page.order" 
submitOnChange="false"/>

In the page spec is only

    <property-specification name="order" type="java.lang.String"/>

It's not the first time I'm confused by the fact that the same behaviour 
can by accomplished differently, caused by the my lack of studying the 
framework.

Cheers Andreas

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

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic