[ 
http://issues.apache.org/jira/browse/MYFACES-261?page=comments#action_66645 ]
     
Bryan Headley commented on MYFACES-261:
---------------------------------------

This from, "JavaServerFaces in Action"...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>

<f:view>
  <html>
    <head>
      <title>
        JSF in Action - Hello, world!
      </title>
    </head>
    <body>
      <h:form id="welcomeForm">
        <h:outputText id="welcomeOutput" value="Welcome to JavaServer Faces!"
                       style="font-family: Arial, sans-serif; font-size: 24; 
color: green;"/>
        <p>
          <h:outputLabel for="helloInput" >
            <h:outputText id="helloInputLabel"
                          value="Enter number of controls to display:"/>
          </h:outputLabel>
          <h:message id="errors" for="helloInput" style="color: red"/>
        </p>
        <p>
          <h:inputText id="helloInput" 
                       value="#{helloBean.numControls}"
                       required="true">
            <f:validateLongRange minimum="1" maximum="500"/>
          </h:inputText>
        </p>
        <p>
          <h:panelGrid id="controlPanel" binding="#{helloBean.controlPanel}"
                       columns="20" border="1" cellspacing="0"/>
        </p>
        <h:commandButton id="redisplayCommand" type="submit" value="Redisplay"
                         actionListener="#{helloBean.addControls}"/>

        <h:commandButton id="goodbyeCommand" type="submit" value="Goodbye"
                         action="#{helloBean.goodbye}" immediate="true"/>
      </h:form>
    </body>
  </html>
</f:view>


> MyFaces unable to find component referenced with 'for' tag
> ----------------------------------------------------------
>
>          Key: MYFACES-261
>          URL: http://issues.apache.org/jira/browse/MYFACES-261
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build, 1.0.9 beta
>  Environment: Linux, and Windows XP; Tomcat 5.0.18 and Weblogic 8.1SP3
>     Reporter: Bryan Headley
>     Assignee: Martin Marinschek

>
> In our JSP we have,
> [snip]
>      <p>
>      <h:message id="errors" for="helloInput" style="color: red"/>
>      </p>
>      <p>
>      <h:outputLabel for="helloInput" >
>             <h:outputText id="helloInputLabel"
>                           value="Enter number of controls to display:"/>
>           </h:outputLabel>
>           <h:message id="errors" for="helloInput" style="color: red"/>
> [snip]
> (This is the "hello world" from _JavaServer Faces In Action_ example.) As the 
> 'for' tag refers to helloInput, a component that hasn't yet been defined, we 
> get an exception and the app won't deploy (below),
> Changing the order of the components, so the "helloInput" outputLabel is 
> defined first works, although we lose the ordering. Also, the notion of 
> wrapping the two components as children in a panelGroup does not appear to 
> work, either.
> Behavior seen in 1.0.9 and nightly snapshot 20050530, running with WLS 8.1SP3 
> and Tomcat 5.0.18.
> javax.faces.FacesException: Could not render Message. Unable to find 
> component 'helloInput' (calling findComponent on component 
> 'welcomeForm:errors')
>                at 
> org.apache.myfaces.renderkit.html.HtmlMessageRendererBase.renderMessage(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(HtmlMessageRendererBase.java:105)
>                at 
> org.apache.myfaces.renderkit.html.HtmlMessageRenderer.encodeEnd(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(HtmlMessageRenderer.java:53)
>                at 
> javax.faces.component.UIComponentBase.encodeEnd(Ljavax.faces.context.FacesContext;)V(UIComponentBase.java:341)
> ... etc ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to