You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by kp...@mysinamail.com on 2005/01/19 20:24:11 UTC

Ognl Variable Scope and access List

Hi,

I have just learnt tapestry and ognl for a week, still unfamiliar with.
I would like to generate an option list based on customized list data.

Here is the code:

<select jwcid="@Select" multiple="ognl:true">
<span jwcid="@Foreach" source="ognl: #list = {'Hello', 'Good', 'Bad'}" value="ognl:#var">
<option jwcid="@Option" selected="ognl:goSelected" label="ognl: #list.iterator.next()" />
</span>
</select>

When run, sure, robust error page always waits for me.
I just want to "try" the power of ognl in tapestry, I worked for a day "try and error"
but still robust error page. Since there is not that enough documents on the web, wish
someone can help me here. Thank you.






______________________________________

===================================================================
�ѫw�A�I�˾ǥ~�y
http://adimages.sina.com.hk/Lingua_0501.html
�@���j���S  �̷s�a������
http://news.sina.com.hk/focus/20041226/
MySinaMail�G�l�c + ��ï + �ӤH���� = 101MB
http://mysinamail.sina.com.hk/
===================================================================

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


Re: Ognl Variable Scope and access List

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 19, 2005, at 2:24 PM, <kp...@mysinamail.com> wrote:
> Here is the code:
>
> <select jwcid="@Select" multiple="ognl:true">
> <span jwcid="@Foreach" source="ognl: #list = {'Hello', 'Good', 'Bad'}" 
> value="ognl:#var">
> <option jwcid="@Option" selected="ognl:goSelected" label="ognl: 
> #list.iterator.next()" />
> </span>
> </select>

Each OGNL expression stands on its own and no context is carried over 
from one to another.  This should work for you:

<span jwcid="@Foreach" source="ognl:list" value="ognl:var">
<option jwcid="@Option" selected="ognl:goSelected" label="ognl:var" />
</span>

Where you define list and var in your specification file.

	Erik


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