whoops I copied and pasted two times! Here :
> "A getter method which is used to obtain the value of the property
> from a bean. The name is usually of the form getPropertyName. For
> example, the getter method for the String property whiskey is public
> String getWhiskey(). For boolean properties, those whose type is
> boolean, the convention is to use the naming pattern isPropertyName.

On 2/10/06, Alexandre Poitras <[EMAIL PROTECTED]> wrote:
> The convention for a boolean is different.
>
> "A getter method which is used to obtain the value of the property
> from a bean. The name is usually of the form getPropertyName. For
> example, the getter method for the String property whiskey is public
> String getWhiskey(). For boolean properties (those whose type is
> boolean, the convention is to use the naming pattern isPropertyName.A
> getter method which is used to obtain the value of the property from a
> bean. The name is usually of the form getPropertyName. For example,
> the getter method for the String property whiskey is public String
> getWhiskey(). For boolean properties (those whose type is boolean, the
> convention is to use the naming pattern isPropertyName."
>
> On 2/10/06, Philippe Lamote <[EMAIL PROTECTED]> wrote:
> > Ah, that's the trick indeed, now it works.
> > I had adapted the page as well to #{bean.getShowThisOne}
> > Pointing to #{bean.showThisOne} as you say, all works fine.
> > Thanks Jamie, this is going to be used a lot :-)
> > Philippe
> > On 10 Feb 2006, at 12:44, Cash, Jamie wrote:
> >
> > Does the rendered property still point to #{bean.showThisOne} or have
> > you changed it to point to #{bean.getShowThisOne}? The first is correct.
> >
> > If this still doesn't work, try adding a setShowThisOne that doesn't
> > do anything.
> >
> > If I recall correctly, I have had to do this is the past!
> >
> > Regards
> >
> > Jamie
> >
> > -----Original Message-----
> > From: Philippe Lamote [mailto:[EMAIL PROTECTED]
> > Sent: 10 February 2006 11:41
> > To: MyFaces Discussion
> > Subject: Re: property vs method
> >
> >
> > I tried that already, it gave me back this stack trace then: (seems
> > like that only makes it look for a property getShowPreviousBT, not a
> > method called getShowPreviousBT() Btw BT stand for a BuTton the page,
> > that aside)
> > Phil
> >
> > javax.faces.el.PropertyNotFoundException: Bean:
> > be.mnemonica.web.beans.RegisterCalBean, property: getShowPreviousBT
> >         at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor
> > (PropertyResolverImpl.java:483)
> >         at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor
> > (PropertyResolverImpl.java:454)
> >         at org.apache.myfaces.el.PropertyResolverImpl.getProperty
> > (PropertyResolverImpl.java:417)
> >         at org.apache.myfaces.el.PropertyResolverImpl.getValue
> > (PropertyResolverImpl.java:82)
> >         at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate
> > (ELParserHelper.java:532)
> >         at 
> > org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> >         at org.apache.myfaces.el.ValueBindingImpl.getValue
> > (ValueBindingImpl.java:383)
> >         at javax.faces.component.UIComponentBase.isRendered
> > (UIComponentBase.java:1076)
> >         at javax.faces.webapp.UIComponentTag.isSuppressed
> > (UIComponentTag.java:853)
> >         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:
> > 313)
> >         at
> > org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp._jspx_me
> > th_h_commandButton_0
> > (org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp:569)
> >         at
> > org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp._jspx_me
> > th_h_form_0
> > (org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp:271)
> >         at
> > org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp._jspx_me
> > th_f_view_0
> > (org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp:191)
> >         at
> > org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp._jspServ
> > ice(org.apache.jsp.WEB_002dINF.resources.pages.registerCalendar_jsp:132)
> >         at 
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >         at org.apache.jasper.servlet.JspServletWrapper.service
> > (JspServletWrapper.java:322)
> >         at org.apache.jasper.servlet.JspServlet.serviceJspFile
> > (JspServlet.java:314)
> >         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.ApplicationDispatcher.invoke
> > (ApplicationDispatcher.java:672)
> >         at org.apache.catalina.core.ApplicationDispatcher.processRequest
> > (ApplicationDispatcher.java:463)
> >         at org.apache.catalina.core.ApplicationDispatcher.doForward
> > (ApplicationDispatcher.java:398)
> >         at org.apache.catalina.core.ApplicationDispatcher.forward
> > (ApplicationDispatcher.java:301)
> >         at
> > org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch
> > (ServletExternalContextImpl.java:416)
> >         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> > (JspViewHandlerImpl.java:234)
> >         at org.apache.myfaces.lifecycle.LifecycleImpl.render
> > (LifecycleImpl.java:372)
> >         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter
> > (ExtensionsFilter.java:137)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:202)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.StandardWrapperValve.invoke
> > (StandardWrapperValve.java:213)
> >         at org.apache.catalina.core.StandardContextValve.invoke
> > (StandardContextValve.java:178)
> >         at org.apache.catalina.core.StandardHostValve.invoke
> > (StandardHostValve.java:126)
> >         at org.apache.catalina.valves.ErrorReportValve.invoke
> > (ErrorReportValve.java:105)
> >         at org.apache.catalina.core.StandardEngineValve.invoke
> > (StandardEngineValve.java:107)
> >         at org.apache.catalina.connector.CoyoteAdapter.service
> > (CoyoteAdapter.java:148)
> >         at org.apache.coyote.http11.Http11Processor.process
> > (Http11Processor.java:868)
> >         at org.apache.coyote.http11.Http11BaseProtocol
> > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
> >         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > (PoolTcpEndpoint.java:527)
> >         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
> > (LeaderFollowerWorkerThread.java:80)
> >         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > (ThreadPool.java:684)
> >         at java.lang.Thread.run(Thread.java:613)
> > 2006-02-10 12:37:30,537 ERROR [org.apache.catalina.core.ContainerBase.
> > [Catalina].[localhost].[/Mnemonica].[Faces Servlet]] - Servlet.service
> > () for servlet Faces Servlet threw exception
> > javax.faces.FacesException: Bean:
> > be.mnemonica.web.beans.RegisterCalBean, property: getShowPreviousBT
> >         at
> > org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch
> > (ServletExternalContextImpl.java:422)
> >         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> > (JspViewHandlerImpl.java:234)
> >         at org.apache.myfaces.lifecycle.LifecycleImpl.render
> > (LifecycleImpl.java:372)
> >         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter
> > (ExtensionsFilter.java:137)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:202)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.StandardWrapperValve.invoke
> > (StandardWrapperValve.java:213)
> >         at org.apache.catalina.core.StandardContextValve.invoke
> > (StandardContextValve.java:178)
> >         at org.apache.catalina.core.StandardHostValve.invoke
> > (StandardHostValve.java:126)
> >         at org.apache.catalina.valves.ErrorReportValve.invoke
> > (ErrorReportValve.java:105)
> >         at org.apache.catalina.core.StandardEngineValve.invoke
> > (StandardEngineValve.java:107)
> >         at org.apache.catalina.connector.CoyoteAdapter.service
> > (CoyoteAdapter.java:148)
> >         at org.apache.coyote.http11.Http11Processor.process
> > (Http11Processor.java:868)
> >         at org.apache.coyote.http11.Http11BaseProtocol
> > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
> >         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > (PoolTcpEndpoint.java:527)
> >         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
> > (LeaderFollowerWorkerThread.java:80)
> >         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > (ThreadPool.java:684)
> >         at java.lang.Thread.run(Thread.java:613)
> > Caused by: org.apache.jasper.JasperException: Bean:
> > be.mnemonica.web.beans.RegisterCalBean, property: getShowPreviousBT
> >         at org.apache.jasper.servlet.JspServletWrapper.service
> > (JspServletWrapper.java:370)
> >         at org.apache.jasper.servlet.JspServlet.serviceJspFile
> > (JspServlet.java:314)
> >         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.ApplicationDispatcher.invoke
> > (ApplicationDispatcher.java:672)
> >         at org.apache.catalina.core.ApplicationDispatcher.processRequest
> > (ApplicationDispatcher.java:463)
> >         at org.apache.catalina.core.ApplicationDispatcher.doForward
> > (ApplicationDispatcher.java:398)
> >         at org.apache.catalina.core.ApplicationDispatcher.forward
> > (ApplicationDispatcher.java:301)
> >         at
> > org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch
> > (ServletExternalContextImpl.java:416)
> >         ... 20 more
> >
> >
> >
> >
> > On 10 Feb 2006, at 12:32, Cash, Jamie wrote:
> >
> > If you named the method getShowThisOne it should work, you do not
> > need to have the actual property declared in the bean.
> >
> > Regards
> >
> > Jamie
> >
> > -----Original Message-----
> > From: Philippe Lamote [mailto:[EMAIL PROTECTED]
> > Sent: 10 February 2006 11:29
> > To: MyFaces Discussion
> > Subject: property vs method
> >
> >
> > Hi List,
> >
> > I have a basic question:
> >
> > What I would like to do, is write a bean method that returns boolean
> > and use this return value to render (or not) a JSF component.
> >
> > So my page has smth like: <h:... rendered= "#{bean.showThisOne}" />
> > & with the bean having a "public boolean showThisOne(){....}"
> >
> > The stack trace complains: "showThisOne" is not a property. (Which
> > tells me it will not accept a method there (?))
> >
> > --> The question: can you, for such cases, use a method this way, or
> > do I have to make boolean property in my bean for this, and provide
> > setters & getters as well for it? Thus coding 2 extra things I will
> > never use - so it seems at least.
> > (Kinda like is done with the "action" attribute but then for
> > rendering in this case)
> >
> >
> > Thanks,
> > Philippe
> >
> >
> > INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
> > ********************** N O T I C E *********************************
> >
> > This message and any attachments is intended only for the individual
> > or company to which it is addressed and may contain
> > information which is privileged, confidential or prohibited from
> > disclosure or unauthorised use. If the recipient of this
> > transmission is not the intended recipient, or the employee or agent
> > responsible for delivering such materials to the
> > intended recipient, you are hereby notified that any use, any form of
> > reproduction, dissemination, copying, disclosure,
> > modification, distribution and/or publication of this e-mail message
> > or its attachments other than by it's intended
> > recipient is strictly prohibited by the sender. If you have received
> > it in error, please notify us immediately by
> > telephone on the number above and destroy the message and all copies
> > in your possession.
> >
> > International Financial Data Services (UK) Ltd is authorised and
> > regulated by the Financial Services Authority.
> >
> > This footnote also confirms that this email message has been swept by
> > MIMEsweeper for the presence of computer viruses.
> >
> > **********************************************************************
> >
> >
> >
> >
> > INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
> > ********************** N O T I C E *********************************
> >
> > This message and any attachments is intended only for the individual
> > or company to which it is addressed and may contain
> > information which is privileged, confidential or prohibited from
> > disclosure or unauthorised use. If the recipient of this
> > transmission is not the intended recipient, or the employee or agent
> > responsible for delivering such materials to the
> > intended recipient, you are hereby notified that any use, any form of
> > reproduction, dissemination, copying, disclosure,
> > modification, distribution and/or publication of this e-mail message
> > or its attachments other than by it's intended
> > recipient is strictly prohibited by the sender. If you have received
> > it in error, please notify us immediately by
> > telephone on the number above and destroy the message and all copies
> > in your possession.
> >
> > International Financial Data Services (UK) Ltd is authorised and
> > regulated by the Financial Services Authority.
> >
> > This footnote also confirms that this email message has been swept by
> > MIMEsweeper for the presence of computer viruses.
> >
> > **********************************************************************
> >
> >
> >
>
>
> --
> Alexandre Poitras
> Qu�bec, Canada
>


--
Alexandre Poitras
Québec, Canada

Reply via email to