You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Philippe Lamote <ph...@mac.com> on 2006/02/15 17:55:54 UTC
bean prop resolution in expression
Hi List,
Does anyone know how to make this work:
(in a jsf page)
<t:div rendered = "#{bean.property}==aValue" >
...
</t:div>
More concrete:
I have a portal bean, "portalbean", that keeps the current use case.
("useCase" being a String property of portalbean)
Depending on this value, I would like to show or hide stuff on a
page, using div like e.g.
<t:div rendered="#{portalbean.useCase}==defineNew">
The Stack trace gives me a java.lang.String error.
Is this impossible, or is my syntax wrong?
Philippe
Re: bean prop resolution in expression
Posted by Bruno Aranda <br...@gmail.com>.
You are welcome, Philippe. MyFaces is a great community ;-)
You can check this page [1], for instance. We do not have information
like the one you need in the wiki now. Feel free to add it if you have
some time to spare. Thanks!
Regards,
Bruno
[1] http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/help/jsp-jsfel/jsf_expression_language_intro.html
On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> Wow, the speed at which you get reaction here is phenomenal.
> Thanks Bruno.
> & It worked like a charm this way.
> Would you know of a place where rules like this one are shown?
> (useful material - not pages of specs but a fistful short statements
> + an example, ideally - to get on speed quickly) Is there a section
> on the MyFaces site for this?
>
> Philippe
>
> On 15 Feb 2006, at 18:04, Bruno Aranda wrote:
>
> Yes, your syntax is wrong, as you are putting values outside the
> expression. You should use it like this:
>
> <t:div rendered = "#{bean.property eq 'aValue'}" >
>
> HTH,
>
> Bruno
>
> On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> > Hi List,
> >
> > Does anyone know how to make this work:
> > (in a jsf page)
> >
> > <t:div rendered = "#{bean.property}==aValue" >
> > ...
> > </t:div>
> >
> > More concrete:
> > I have a portal bean, "portalbean", that keeps the current use case.
> > ("useCase" being a String property of portalbean)
> > Depending on this value, I would like to show or hide stuff on a
> > page, using div like e.g.
> > <t:div rendered="#{portalbean.useCase}==defineNew">
> > The Stack trace gives me a java.lang.String error.
> > Is this impossible, or is my syntax wrong?
> >
> > Philippe
> >
>
>
Re: bean prop resolution in expression
Posted by Mike Kienenberger <mk...@gmail.com>.
http://wiki.apache.org/myfaces/ provides things like this, and allows
you to add new material as well. You could start a "new-user tips"
page if you wanted.
On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> Wow, the speed at which you get reaction here is phenomenal.
> Thanks Bruno.
> & It worked like a charm this way.
> Would you know of a place where rules like this one are shown?
> (useful material - not pages of specs but a fistful short statements
> + an example, ideally - to get on speed quickly) Is there a section
> on the MyFaces site for this?
>
> Philippe
>
> On 15 Feb 2006, at 18:04, Bruno Aranda wrote:
>
> Yes, your syntax is wrong, as you are putting values outside the
> expression. You should use it like this:
>
> <t:div rendered = "#{bean.property eq 'aValue'}" >
>
> HTH,
>
> Bruno
>
> On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> > Hi List,
> >
> > Does anyone know how to make this work:
> > (in a jsf page)
> >
> > <t:div rendered = "#{bean.property}==aValue" >
> > ...
> > </t:div>
> >
> > More concrete:
> > I have a portal bean, "portalbean", that keeps the current use case.
> > ("useCase" being a String property of portalbean)
> > Depending on this value, I would like to show or hide stuff on a
> > page, using div like e.g.
> > <t:div rendered="#{portalbean.useCase}==defineNew">
> > The Stack trace gives me a java.lang.String error.
> > Is this impossible, or is my syntax wrong?
> >
> > Philippe
> >
>
>
Re: bean prop resolution in expression
Posted by Philippe Lamote <ph...@mac.com>.
Wow, the speed at which you get reaction here is phenomenal.
Thanks Bruno.
& It worked like a charm this way.
Would you know of a place where rules like this one are shown?
(useful material - not pages of specs but a fistful short statements
+ an example, ideally - to get on speed quickly) Is there a section
on the MyFaces site for this?
Philippe
On 15 Feb 2006, at 18:04, Bruno Aranda wrote:
Yes, your syntax is wrong, as you are putting values outside the
expression. You should use it like this:
<t:div rendered = "#{bean.property eq 'aValue'}" >
HTH,
Bruno
On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> Hi List,
>
> Does anyone know how to make this work:
> (in a jsf page)
>
> <t:div rendered = "#{bean.property}==aValue" >
> ...
> </t:div>
>
> More concrete:
> I have a portal bean, "portalbean", that keeps the current use case.
> ("useCase" being a String property of portalbean)
> Depending on this value, I would like to show or hide stuff on a
> page, using div like e.g.
> <t:div rendered="#{portalbean.useCase}==defineNew">
> The Stack trace gives me a java.lang.String error.
> Is this impossible, or is my syntax wrong?
>
> Philippe
>
Re: bean prop resolution in expression
Posted by Bruno Aranda <br...@gmail.com>.
Yes, your syntax is wrong, as you are putting values outside the
expression. You should use it like this:
<t:div rendered = "#{bean.property eq 'aValue'}" >
HTH,
Bruno
On 2/15/06, Philippe Lamote <ph...@mac.com> wrote:
> Hi List,
>
> Does anyone know how to make this work:
> (in a jsf page)
>
> <t:div rendered = "#{bean.property}==aValue" >
> ...
> </t:div>
>
> More concrete:
> I have a portal bean, "portalbean", that keeps the current use case.
> ("useCase" being a String property of portalbean)
> Depending on this value, I would like to show or hide stuff on a
> page, using div like e.g.
> <t:div rendered="#{portalbean.useCase}==defineNew">
> The Stack trace gives me a java.lang.String error.
> Is this impossible, or is my syntax wrong?
>
> Philippe
>