I hope to extend the property expression language ASR (after stable
release) to allow more OGNL type things (such as passing parameters to
methods).

This could be accomplished as well by creating a custom binding
prefix, i.e., "indirect-message:sender.address.addressLine1Label"
which would resolve sender.address.addressLine1Label as a property
expression and then use that to lookup the message.

On Feb 7, 2008 8:32 AM, Brian Long <[EMAIL PROTECTED]> wrote:
> Sorry about the ambiguous title, but I'll try to explain what it is I'm
> trying to achieve . . .
>
> in T4 it's possible to have properties/keys in an object that can be
> localized in the html file using the following expression
>
> <span [EMAIL PROTECTED] value="ognl:messages.getMessage(
> sender.address.addressLine1Label)">AddressLine1</span>
>
> tapestry will resolve what the contents of "sender.address.addressLine1Label"
> are before trying to find a match for that key in the appropriate
> .properties file.
>
> however in T5 we no longer have ognl: prefix (I'm guessing it's replaced by
> prop:?), so I tried (unsuccessfully) using certain combinations of the prop:
> and message: prefix to first extract the key from the required object before
> trying to localize it. The only solution I could come up with was to inject
> the messages bean into my class and add a method that can pass the key into
> my messages bean and return the localized text. This method is then called
> from the .tml. Ideally however I would like to find a way to do all of this
> work in my .tml file, so if anyone has any ideas, comments or criticism,
> please let me know.
>
> Regards, Brian.
>
>     @Inject
>     private Messages messages;
>
>     public final String getSenderAddressLine1Label() {
>         return messages.get(moneyTransfer.getSender
> ().getAddress().getAddressLine1Label());
>     }
>
>     <t:label t:for="senderAddressLine1"/>
>     <input t:type="textfield" t:id="senderAddressLine1" t:value="
> sender.address.addressLine1" t:label="prop:senderAddressLine1Label"
> size="30" disabled="readOnly"/>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

Reply via email to