You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by h b <hb...@gmail.com> on 2008/03/20 18:50:14 UTC
getIsDisabled/setIsDisabled
Hello,
I have the following backing bean:
//not actual code
public class Foo { private boolean isBar; public Foo() {}; public boolean
isBar() {return this.isBar;} public void setBar(boolean isBar) {
this.isBar= isBar;} }
in my jsf I the following:
<h:commandLink disabled="#{foo.isBar}"/>
It is complaining because it can't find the property isBar...I have to
actually change my foo class to getIsBar() and setIsBar() then it work.
I'm new to JSF & MyFaces...am I missing something?
Thanks
Re: getIsDisabled/setIsDisabled
Posted by Christoph Ebner <ch...@gmail.com>.
Try <h:commandLink disabled="#{foo.bar}"/>
getters for boolean properties are supposed to be named 'isProperty()'
for all other objects or primitive types it's 'getProperty()'.
regards
christoph
On Thu, Mar 20, 2008 at 6:50 PM, h b <hb...@gmail.com> wrote:
> Hello,
>
> I have the following backing bean:
> //not actual code
> public class Foo { private boolean isBar; public Foo() {}; public boolean
> isBar() {return this.isBar;} public void setBar(boolean isBar) {
> this.isBar = isBar;} }
>
> in my jsf I the following:
> <h:commandLink disabled="#{foo.isBar}"/>
>
> It is complaining because it can't find the property isBar...I have to
> actually change my foo class to getIsBar() and setIsBar() then it work.
>
> I'm new to JSF & MyFaces...am I missing something?
>
> Thanks
>
Re: getIsDisabled/setIsDisabled
Posted by Bryan Basham <bb...@stillsecure.com>.
EL uses the JavaBeans standard. So, the disable EL attribute should be
"#{foo.bar}" and EL will use the isBar():boolean method to retrieve the
value. You must not include the "is" portion of the method name.
Regards,
Bryan
h b wrote:
> Hello,
>
> I have the following backing bean:
> //not actual code
> public class Foo { private boolean isBar; public Foo() {}; public
> boolean isBar() {return this.isBar;} public void setBar(boolean isBar)
> { this.isBar = isBar;} }
>
> in my jsf I the following:
> <h:commandLink disabled="#{foo.isBar}"/>
>
> It is complaining because it can't find the property isBar...I have to
> actually change my foo class to getIsBar() and setIsBar() then it work.
>
> I'm new to JSF & MyFaces...am I missing something?
>
> Thanks