You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kaspar Fischer <fi...@inf.ethz.ch> on 2008/01/03 12:45:38 UTC

Re: Temporary objects in OGNL

On 31.12.2007, at 09:07, <Ma...@bmw.ch>  
<Ma...@bmw.ch> wrote:

> Have a look at
>
> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/varref.html

I actually tried this before:

   <div jwcid="@Insert" value="ognl:#var='foo'"></div>
   <div jwcid="@Insert" value="ognl:#var"></div>

only outputs "foo" once. Shouldn't it emit this string twice?

> I tend to use complex ognl for rapid view development (dynamic  
> reload).
> After that, I move complex expressions into Java-code.

Thanks a lot for this hint! Would almost have been my next question ;-)

Kaspar


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


Re: Temporary objects in OGNL

Posted by Marcus Schulte <et...@googlemail.com>.
Oh, sorry, I didn't realize, you want to cache results between different
OGNL expressions. Different ognl expressions only share the page as common
context. So you'd need sth. like:
Page:
   ...
   public abstract Object getThat();
  ...

Template:

 ... xyz="ognl: that=components.table.tableRow.getProperty('title')" ....

 ... condition="ognl: that != null && ..."...



Maybe, instead of "public abstract Object getThat();" you could use a map as
a "symbol table" like
@InitialValue("new java.util.HashMap()")
public abstract Map<Strin,Object> getTmp();
and put it in you base-class for pages.
Of course, your shortcuts won't be writable/settable ...


2008/1/3, Kaspar Fischer <fi...@inf.ethz.ch>:
>
> On 31.12.2007, at 09:07, <Ma...@bmw.ch>
> <Ma...@bmw.ch> wrote:
>
> > Have a look at
> >
> > http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/varref.html
>
> I actually tried this before:
>
>    <div jwcid="@Insert" value="ognl:#var='foo'"></div>
>    <div jwcid="@Insert" value="ognl:#var"></div>
>
> only outputs "foo" once. Shouldn't it emit this string twice?
>
> > I tend to use complex ognl for rapid view development (dynamic
> > reload).
> > After that, I move complex expressions into Java-code.
>
> Thanks a lot for this hint! Would almost have been my next question ;-)
>
> Kaspar
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Marcus Schulte
http://marcus-schulte.blogspot.com