javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-3075

HTML input elements without type attribute should be recognized as text inputs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Works as designed
    • Affects Version/s: 2.2.4
    • Fix Version/s: 2.2.5
    • Component/s: None
    • Labels:
      None
    • Environment:

      GlassFish 4.0

      Description

      Consider the following form:

      <form jsf:id="form">
        <label jsf:for="input">Foo</label>
        <input type="text" jsf:value="#{testBean.foo}" jsf:id="input"/>
        <h:message for="input"/>
        <input type="submit" jsf:action="#{testBean.save()}" value="Save"/>
      </form>

      When the type attribute is removed from the input element, the input element is not recognized anymore. The foo property of testBean is not set and the log shows 2 warnings because the label and h:message do not find the component with the ID "input".

      I'm not sure if this requires a JSF spec change. IIRC the JSF spec says input elements with any type value (other than those with other meanings like button, submit etc.) should be rendered like h:inputText. One could argue the type attribute does not have any value when it's not specified, but the HTML 4.01 specification clearly states The default value for this attribute is "text" and it's very common in HTML to omit this attribute.

        Activity

        Hide
        Manfred Riem added a comment -

        You are indeed pointing out something that would nice to have unfortunately we have to implement what is specified at http://docs.oracle.com/javaee/7/api/javax/faces/view/facelets/TagDecorator.html

        Please feel free to file this as a spec issue at the spec issue tracker at https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC

        Thanks!

        Show
        Manfred Riem added a comment - You are indeed pointing out something that would nice to have unfortunately we have to implement what is specified at http://docs.oracle.com/javaee/7/api/javax/faces/view/facelets/TagDecorator.html Please feel free to file this as a spec issue at the spec issue tracker at https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC Thanks!
        Show
        kithouna added a comment - Spec issue: https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1234

          People

          • Assignee:
            Manfred Riem
            Reporter:
            kithouna
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: