You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/06/26 23:04:00 UTC
DirectLink static-binding
This one is stupid...
How can I pass more than one paremeter using static-binding?
<component id="brazil" type="DirectLink">
<binding name="listener" expression="listeners.changeLocale"/>
<static-binding name="parameters" value="pt"/>
<static-binding name="parameters" value="BR"/>
</component>
String language = (String)cycle.getServiceParameters()[0];
String country = (String)cycle.getServiceParameters()[1];
Locale locale = new Locale(language,country);
Regards
Vinicius
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: DirectLink static-binding
Posted by Andreas Andreou <an...@di.uoa.gr>.
Vinicius Carvalho wrote:
>This one is stupid...
>How can I pass more than one paremeter using static-binding?
>
><component id="brazil" type="DirectLink">
> <binding name="listener" expression="listeners.changeLocale"/>
><static-binding name="parameters" value="pt"/>
> <static-binding name="parameters" value="BR"/>
> </component>
>
>
try <binding name="parameters" expression="{'param1', 'param2'}"/>
static binding treats values as text,
while binding as ognl expressions. This allows us to create an ognl array
using {..., ..., ..., ...}
>String language = (String)cycle.getServiceParameters()[0];
>String country = (String)cycle.getServiceParameters()[1];
>Locale locale = new Locale(language,country);
>
>Regards
>
>Vinicius
>
>---------------------------------------------------------------------
>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: DirectLink static-binding
Posted by Pablo Ruggia <pr...@gmail.com>.
You have two chances:
* You can create an array using ognl syntax.
* You can have a method that returns Object[].
On 6/26/05, Vinicius Carvalho <ja...@gmail.com> wrote:
>
> This one is stupid...
> How can I pass more than one paremeter using static-binding?
>
> <component id="brazil" type="DirectLink">
> <binding name="listener" expression="listeners.changeLocale"/>
> <static-binding name="parameters" value="pt"/>
> <static-binding name="parameters" value="BR"/>
> </component>
>
> String language = (String)cycle.getServiceParameters()[0];
> String country = (String)cycle.getServiceParameters()[1];
> Locale locale = new Locale(language,country);
>
> Regards
>
> Vinicius
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
Re: DirectLink static-binding
Posted by Norbert Sándor <de...@erinors.com>.
You should use OGNL binding to pass multiple parameters, like:
<component id="brazil" type="DirectLink">
<binding name="listener" expression="listeners.changeLocale" />
<binding name="parameters" expression="{'pt', 'BR'}" />
</component>
String language = (String)cycle.getServiceParameters()[0];
String country = (String)cycle.getServiceParameters()[1];
Locale locale = new Locale(language,country);
Br,
Norbi
----- Original Message -----
From: "Vinicius Carvalho" <ja...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Sunday, June 26, 2005 11:04 PM
Subject: DirectLink static-binding
This one is stupid...
How can I pass more than one paremeter using static-binding?
<component id="brazil" type="DirectLink">
<binding name="listener" expression="listeners.changeLocale"/>
<static-binding name="parameters" value="pt"/>
<static-binding name="parameters" value="BR"/>
</component>
String language = (String)cycle.getServiceParameters()[0];
String country = (String)cycle.getServiceParameters()[1];
Locale locale = new Locale(language,country);
Regards
Vinicius
---------------------------------------------------------------------
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