You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Strand <do...@gmail.com> on 2007/01/01 03:50:43 UTC

Re: dynamic ognl expr

If you generate the expression dynamically, you can use an  
ExpressionEvaluator:

public Object getValue()
{
   String expression = "components.tableRows.tableRow." + getColumnName();
   return getExpressionEvaluator().read(getPage(), expression);
}

@InjectObject("service:tapestry.ognl.ExpressionEvaluator")
public abstract ExpressionEvaluator getExpressionEvaluator();

Happy new year

Martin

On Sun, 31 Dec 2006 18:18:29 +0100, ra <ry...@gazeta.pl> wrote:

>
> I'd like to read object's property value but the property name is known
> during runtime only
> so finally the ognl expression should looks like this
>
> value="ognl:components.tableRows.tableRow.clientId"
>
> but clientId is generated and can be read i.e. from page's property:
> columnName
>
> So I'd like to write sth like this:
> value="ognl:('components.tableRows.tableRow.' + ognl:columnName)"



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


Re: dynamic ognl expr

Posted by andyhot <an...@di.uoa.gr>.
Check out some ognl docs for expression syntax, e.t.c.

IIRC, you can do

value="ognl:components.tableRows.tableRow[columnName]"

And happy new year from greece as well !


Martin Strand wrote:
> If you generate the expression dynamically, you can use an
> ExpressionEvaluator:
>
> public Object getValue()
> {
>   String expression = "components.tableRows.tableRow." + getColumnName();
>   return getExpressionEvaluator().read(getPage(), expression);
> }
>
> @InjectObject("service:tapestry.ognl.ExpressionEvaluator")
> public abstract ExpressionEvaluator getExpressionEvaluator();
>
> Happy new year
>
> Martin
>
> On Sun, 31 Dec 2006 18:18:29 +0100, ra <ry...@gazeta.pl> wrote:
>
>>
>> I'd like to read object's property value but the property name is known
>> during runtime only
>> so finally the ognl expression should looks like this
>>
>> value="ognl:components.tableRows.tableRow.clientId"
>>
>> but clientId is generated and can be read i.e. from page's property:
>> columnName
>>
>> So I'd like to write sth like this:
>> value="ognl:('components.tableRows.tableRow.' + ognl:columnName)"
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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