Because rows and cols attribute EL expressions must evaluate to a
Number type, not a String type.
On 12/20/05, Kurt Edegger <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I ran into a problem by using the inputTextarea component of myfaces-1.1.1.
> I simply like to display some editable text by adding
>
> <h:inputTextarea id="patientHistory"
> rows="#{configBean.patientHistoryHeight}"
> cols="#{configBean.patientHistoryWidth}" value="#{bean.patientHistory}"/>
>
> to my jsp page. The application crashed with an ClassCastException [1] while
> retrieving the attribute cols for the tag.
> The two methods configBean.getPatientHistoryHeight and
> configBean.getPatientHistoryWidth are returning two Strings like "10" and
> "40" respectively. I double checked this by adding
>
> <h:outputText value="#{configBean.patientHistoryHeight}"/> by
> <h:outputText value="#{configBean.patientHistoryWidth}"/>
>
> to my page, which renders properly showing: 10 by 40
>
> If I replace the value bindings for rows and cols by actual numbers, the
> application works fine.
>
> Any ideas why I can't use value bindings, which are returning string values,
> with the inputTextarea component??
>
> Thank you for your help in advance,
>
> Kurt
>
> [1] here's the shortened stacktrace:
> javax.faces.FacesException: Could not get property rows of component
> buttonform:patientHistory
> at
> javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:226)
> at
> javax.faces.component._ComponentAttributesMap.get(_ComponentAttributesMap.java:128)
> [...snip...]
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:221)
> ... 71 more
> Caused by: java.lang.ClassCastException
> at
> javax.faces.component.html.HtmlInputTextarea.getRows(HtmlInputTextarea.java:321)
> ... 76 more
> ERROR: Servlet.service() for servlet Faces Servlet threw exception
> (2005-12-20 16:22:44,156
> http-8080-Processor24_org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sakai-ecgviewer-tool].[Faces
> Servlet])
> javax.faces.FacesException: Could not get property rows of component
> buttonform:patientHistory
> at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> at
> org.sakaiproject.jsf.app.SakaiViewHandler.renderView(SakaiViewHandler.java:140)
> [...snip...]
> Caused by: org.apache.jasper.JasperException: Could not get property rows of
> component buttonform:patientHistory
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> [...snip...]
> ERROR: Servlet.service() for servlet sakai.ecgviewer.tool threw exception
> (2005-12-20 16:22:44,171
> http-8080-Processor24_org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sakai-ecgviewer-tool].[sakai.ecgviewer.tool])
> javax.faces.FacesException: Could not get property rows of component
> buttonform:patientHistory
> at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> at
> org.sakaiproject.jsf.app.SakaiViewHandler.renderView(SakaiViewHandler.java:140)
> [...snip...]
> Caused by: org.apache.jasper.JasperException: Could not get property rows of
> component buttonform:patientHistory
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> [...snip...]
>
>