You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2006/03/23 13:33:53 UTC

How to use Java 1.5 enum type in HTML templates

Hi all,

I'm stuck with the problem below :
I've created an enum in a separate class (Headings.java) in my project

    public enum Headings { value1, value2, value3 }

And i would like to use this values in an ognl expression in one of my 
html templates ...

<span jwcid="@If" 
condition='ognl:getPage().isHeadingEquals(Headings.value1)'><img 
jwcid="@Image" image="asset:user" alt="User" title="User" 
src="images/user.gif"/></span>

This is the error returned
Unable to read OGNL expression '<parsed OGNL expression>' of 
$Border_431@d2766[community/bb/BB/$Border]: $Border_431.Headings

Thanks in advance for any idea ...

-- 
Stéphane Decleire



Re: How to use Java 1.5 enum type in HTML templates

Posted by Rudolf Baloun <Ru...@atron.de>.
My idea (without testing it):

.... condition='ognl:getPage().isHeadingEquals(Headings.value1)' ...

should look like:

.... condition="ognl:headingEquals(@path.to.class.Headings@value1)" ...

You will find the answer here: http://www.ognl.org/



Stephane Decleire schrieb:
> Hi all,
>
> I'm stuck with the problem below :
> I've created an enum in a separate class (Headings.java) in my project
>
>    public enum Headings { value1, value2, value3 }
>
> And i would like to use this values in an ognl expression in one of my 
> html templates ...
>
> <span jwcid="@If" 
> condition='ognl:getPage().isHeadingEquals(Headings.value1)'><img 
> jwcid="@Image" image="asset:user" alt="User" title="User" 
> src="images/user.gif"/></span>
>
> This is the error returned
> Unable to read OGNL expression '<parsed OGNL expression>' of 
> $Border_431@d2766[community/bb/BB/$Border]: $Border_431.Headings
>
> Thanks in advance for any idea ...
>



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