ICEfaces
  1. ICEfaces
  2. ICE-3088

focus of input component is lost when tabbing through page and using ice:messages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      any
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      The solutions are:
      a) move ice:messages tag outside ice:form
      b) wrap ice:messages tag with a 'div' with ID
      Show
      The solutions are: a) move ice:messages tag outside ice:form b) wrap ice:messages tag with a 'div' with ID

      Description

      In the example jspx page when using the ice:messages component then the initial tab from one field to another (no matter if inputText or selectInputDate, please note that all inputText fields are set to required=true) causes the focus to be lost. When tabbing again the focus will be set to the previously selected component. Any subsequent tabbing works just fine, it's only the initial one that causes the focus to be lost.

        Activity

        Hide
        Michael Thiem added a comment -

        sample app

        Show
        Michael Thiem added a comment - sample app
        Hide
        Mircea Toma added a comment -

        The focus is lost because the ice:messages component is located inside the ice:form. Whenever a validation error occurs ice:messages component will render its markup which in turn will trigger an update for the entire form since there was no message container element present before. I believe this new behavior was introduced by ICE-1888.

        The solutions are:
        a) move ice:messages tag outside ice:form
        b) wrap ice:messages tag with a 'div' with ID
        c) change ice:messages renderer to always render its root element

        Show
        Mircea Toma added a comment - The focus is lost because the ice:messages component is located inside the ice:form. Whenever a validation error occurs ice:messages component will render its markup which in turn will trigger an update for the entire form since there was no message container element present before. I believe this new behavior was introduced by ICE-1888 . The solutions are: a) move ice:messages tag outside ice:form b) wrap ice:messages tag with a 'div' with ID c) change ice:messages renderer to always render its root element
        Hide
        Ken Fyten added a comment -

        We need to revisit the change in ICE-1888 to have the ice:messages always render it's root elements in a non-visible manner that will also not violate XHTML validation. Perhaps rendering an empty <div> tag?

        Show
        Ken Fyten added a comment - We need to revisit the change in ICE-1888 to have the ice:messages always render it's root elements in a non-visible manner that will also not violate XHTML validation. Perhaps rendering an empty <div> tag?
        Hide
        Adnan Durrani added a comment -

        trunk: revision 16748
        branch 1.7: revision 16749

        To not to violate XHTML validation, the component adds the empty child to its container if there is no faces message to be served.

        (e.g.)
        layout="table"
        <table style="display:none">
        <tr> <td></td> </tr>
        </table>

        layout="list"
        <ul style="display:none">
        <li></li>
        </ul>

        Show
        Adnan Durrani added a comment - trunk: revision 16748 branch 1.7: revision 16749 To not to violate XHTML validation, the component adds the empty child to its container if there is no faces message to be served. (e.g.) layout="table" <table style="display:none"> <tr> <td></td> </tr> </table> layout="list" <ul style="display:none"> <li></li> </ul>
        Hide
        Neil Griffin added a comment -

        Confimed that ice:messages if fixed in 1.7.1, but it's still broken with inline ice:message components as well, like this:

        <table>
        <tr>
        <td><ice:label for="firstName" /></td>
        <td><ice:inputText id="firstName" value="#

        {myBean.firstName}

        " /></td>
        <td><ice:message for="firstName" /></td>
        </tr>
        </table>

        Show
        Neil Griffin added a comment - Confimed that ice:messages if fixed in 1.7.1, but it's still broken with inline ice:message components as well, like this: <table> <tr> <td><ice:label for="firstName" /></td> <td><ice:inputText id="firstName" value="# {myBean.firstName} " /></td> <td><ice:message for="firstName" /></td> </tr> </table>

          People

          • Assignee:
            Adnan Durrani
            Reporter:
            Michael Thiem
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: