You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by SiSi'mon <s_...@purpleblade.net> on 2007/05/24 21:29:18 UTC

Hot to logic in rendered tag

If someone could help me with this, it is quite puzzeling.  I see examples
using && || in the rendered tag but it does not work for me.

I have the following:

193 <t:commandLink
194        rendered="#{myBean.showBtn && myBean.anchor.anchored}"

MyBean (myBean) has a class called Anchor that has a method isAnchored()
which returns a boolean.
There is also a method that returns a boolean called getShowBtn().

I get the following error
SEVERE: Error Rendering View[/web/gro/PtGroGroup.xhtml]
com.sun.facelets.FaceletException: Error Parsing /web/Page.xhtml: Erro
r Traced[line: 194] The entity name must immediately follow the '&' in the
entit
y reference.
        at
com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)



---
any ideas?

thanks
-- 
View this message in context: http://www.nabble.com/Hot-to-logic-in-rendered-tag-tf3812254.html#a10790964
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Hot to logic in rendered tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Facelets requires page code to be valid xml, unlike jsp page code.

The simplest solution is to use "and" instead of && and "or" instead
of "||" (and "gt", "lt", "ge", "le" etc).

Or you can try to figure out the correct escaping.

Probably something like &amp;&amp;

On 5/24/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
> If someone could help me with this, it is quite puzzeling.  I see examples
> using && || in the rendered tag but it does not work for me.
>
> I have the following:
>
> 193 <t:commandLink
> 194        rendered="#{myBean.showBtn && myBean.anchor.anchored}"
>
> MyBean (myBean) has a class called Anchor that has a method isAnchored()
> which returns a boolean.
> There is also a method that returns a boolean called getShowBtn().
>
> I get the following error
> SEVERE: Error Rendering View[/web/gro/PtGroGroup.xhtml]
> com.sun.facelets.FaceletException: Error Parsing /web/Page.xhtml: Erro
> r Traced[line: 194] The entity name must immediately follow the '&' in the
> entit
> y reference.
>         at
> com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
>
>
>
> ---
> any ideas?
>
> thanks
> --
> View this message in context: http://www.nabble.com/Hot-to-logic-in-rendered-tag-tf3812254.html#a10790964
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>