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 S. Adamsen" <fi...@stubkjaer-adamsen.dk> on 2004/04/20 18:34:15 UTC

Parameterized/formatted message-bindings

Is it somehow possible to reference a parameterized locale-specific message
from within a page-/component-specification, and pass any parameters along?

Something like

   ...
  <message-binding name="foobar" key="foobar" format="true">
    <*-binding name="foo">foo</*-binding>
    <*-binding name="bar">foo</*-binding>
  </message-binding>
   ...

would be nice. Of course the name-parameters should just be discarded, and
the values should then be passed as an Object[] to format(String key,
Object[] arguments)? Or would I be better off creating a non-visual
component to do the dirty work? It's just that I'd like something like this
to exist in the framework.



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


RE: Parameterized/formatted message-bindings

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Thanks again - this effectively removes the need for my previously described
approach. Now all we need is release of OGNL 3.0, which I personally look
forward to - I read about some quite dramatic improvements in performance...

-----Original Message-----
From: Paul Ferraro [mailto:pmf8@columbia.edu] 
Sent: Tuesday, April 20, 2004 7:26 PM
To: Tapestry users
Subject: Re: Parameterized/formatted message-bindings

<binding name="foobar" expression="format('foobar', new java.lang.Object[] {
foo, bar })"/>


Paul

Filip S. Adamsen wrote:

>Yes, and thanks to both of you, that's definitely an option, as long as you
>only have three or less parameters. The other way would allow for more
>parameters, since, as far as I know, there is no way to create arrays in
>OGNL - or have I missed something (again)?



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


Re: Parameterized/formatted message-bindings

Posted by Paul Ferraro <pm...@columbia.edu>.
<binding name="foobar" expression="format('foobar', new java.lang.Object[] { foo, bar })"/>


Paul

Filip S. Adamsen wrote:

>Yes, and thanks to both of you, that's definitely an option, as long as you
>only have three or less parameters. The other way would allow for more
>parameters, since, as far as I know, there is no way to create arrays in
>OGNL - or have I missed something (again)?
>
>-----Original Message-----
>From: Paul Ferraro [mailto:pmf8@columbia.edu] 
>Sent: Tuesday, April 20, 2004 7:12 PM
>To: Tapestry users
>Subject: Re: Parameterized/formatted message-bindings
>
>Correct me if I'm wrong, but isn't this what you're trying to do?
>
><binding name="foobar" expression="format('foobar', foo, bar)"/>
>
>Paul
>
>-----Original Message-----
>From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
>Sent: Tuesday, April 20, 2004 7:13 PM
>To: Tapestry users
>Subject: Re: Parameterized/formatted message-bindings
>
>You could just use an expression binding with the expression 
>'format(key, param1, param2)'  (or any of the other overloaded 'format' 
>signatures).  This would be as clean or cleaner than your proposed 
>solution.
>
>I agree that having parameter capability to <message-binding> would be 
>a nice addition though.
>
>	Erik
>
>On Apr 20, 2004, at 12:34 PM, Filip S. Adamsen wrote:
>
>  
>
>>Is it somehow possible to reference a parameterized locale-specific 
>>message
>>from within a page-/component-specification, and pass any parameters 
>>along?
>>
>>Something like
>>
>>   ...
>>  <message-binding name="foobar" key="foobar" format="true">
>>    <*-binding name="foo">foo</*-binding>
>>    <*-binding name="bar">foo</*-binding>
>>  </message-binding>
>>   ...
>>
>>would be nice. Of course the name-parameters should just be discarded, 
>>and
>>the values should then be passed as an Object[] to format(String key,
>>Object[] arguments)? Or would I be better off creating a non-visual
>>component to do the dirty work? It's just that I'd like something like 
>>this
>>to exist in the framework.
>>
>>
>>
>>---------------------------------------------------------------------
>>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
>
>
>
>
>---------------------------------------------------------------------
>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


RE: Parameterized/formatted message-bindings

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Yes, and thanks to both of you, that's definitely an option, as long as you
only have three or less parameters. The other way would allow for more
parameters, since, as far as I know, there is no way to create arrays in
OGNL - or have I missed something (again)?

-----Original Message-----
From: Paul Ferraro [mailto:pmf8@columbia.edu] 
Sent: Tuesday, April 20, 2004 7:12 PM
To: Tapestry users
Subject: Re: Parameterized/formatted message-bindings

Correct me if I'm wrong, but isn't this what you're trying to do?

<binding name="foobar" expression="format('foobar', foo, bar)"/>

Paul

-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Sent: Tuesday, April 20, 2004 7:13 PM
To: Tapestry users
Subject: Re: Parameterized/formatted message-bindings

You could just use an expression binding with the expression 
'format(key, param1, param2)'  (or any of the other overloaded 'format' 
signatures).  This would be as clean or cleaner than your proposed 
solution.

I agree that having parameter capability to <message-binding> would be 
a nice addition though.

	Erik

On Apr 20, 2004, at 12:34 PM, Filip S. Adamsen wrote:

> Is it somehow possible to reference a parameterized locale-specific 
> message
> from within a page-/component-specification, and pass any parameters 
> along?
>
> Something like
>
>    ...
>   <message-binding name="foobar" key="foobar" format="true">
>     <*-binding name="foo">foo</*-binding>
>     <*-binding name="bar">foo</*-binding>
>   </message-binding>
>    ...
>
> would be nice. Of course the name-parameters should just be discarded, 
> and
> the values should then be passed as an Object[] to format(String key,
> Object[] arguments)? Or would I be better off creating a non-visual
> component to do the dirty work? It's just that I'd like something like 
> this
> to exist in the framework.
>
>
>
> ---------------------------------------------------------------------
> 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




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


Re: Parameterized/formatted message-bindings

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
You could just use an expression binding with the expression 
'format(key, param1, param2)'  (or any of the other overloaded 'format' 
signatures).  This would be as clean or cleaner than your proposed 
solution.

I agree that having parameter capability to <message-binding> would be 
a nice addition though.

	Erik

On Apr 20, 2004, at 12:34 PM, Filip S. Adamsen wrote:

> Is it somehow possible to reference a parameterized locale-specific 
> message
> from within a page-/component-specification, and pass any parameters 
> along?
>
> Something like
>
>    ...
>   <message-binding name="foobar" key="foobar" format="true">
>     <*-binding name="foo">foo</*-binding>
>     <*-binding name="bar">foo</*-binding>
>   </message-binding>
>    ...
>
> would be nice. Of course the name-parameters should just be discarded, 
> and
> the values should then be passed as an Object[] to format(String key,
> Object[] arguments)? Or would I be better off creating a non-visual
> component to do the dirty work? It's just that I'd like something like 
> this
> to exist in the framework.
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Parameterized/formatted message-bindings

Posted by Paul Ferraro <pm...@columbia.edu>.
Correct me if I'm wrong, but isn't this what you're trying to do?

<binding name="foobar" expression="format('foobar', foo, bar)"/>

Paul

Filip S. Adamsen wrote:

>Is it somehow possible to reference a parameterized locale-specific message
>from within a page-/component-specification, and pass any parameters along?
>
>Something like
>
>   ...
>  <message-binding name="foobar" key="foobar" format="true">
>    <*-binding name="foo">foo</*-binding>
>    <*-binding name="bar">foo</*-binding>
>  </message-binding>
>   ...
>
>would be nice. Of course the name-parameters should just be discarded, and
>the values should then be passed as an Object[] to format(String key,
>Object[] arguments)? Or would I be better off creating a non-visual
>component to do the dirty work? It's just that I'd like something like this
>to exist in the framework.
>
>
>
>---------------------------------------------------------------------
>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