MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-452

<t:messages> tag doesn't work for input fields found in dataTables

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      If you try to use an output label for an input field in a dataTable, the label will not be found due to an error in HtmlMessageRenderer.createOutputLabelMap()

      The input field's client id is originally added to FacesContext during the validation phase (if the validator fails) with input field's client id containing the row index (ex.: "body:cropYearForm:1:holdbackThreshold").

      When HtmlMessageRenderer.createOutputLabelMap() constructs the index of all HtmlOutputLabels on the page, the same input field's client id does not contain the row index (ex. "body:cropYearForm:holdbackThreshold").

      As a result, the indexed MessageLabelInfo is never found in HtmlMessageRenderer.findInputLabel(FacesContext facesContext, String inputClientId), b/c inputClientId contains the client id with the row index, whereas the key in outputLabelMap does not. (ex. "body:cropYearForm:1:holdbackThreshold" vs. "body:cropYearForm:holdbackThreshold").

      Perhaps something else should be used as the key in outputLabelMap?

        Issue Links

          Activity

          Hide
          Michael Heinen added a comment -

          I am facing the same problem. This is really annoying if UIs are created generically.

          Beside the fact that the rowindex is missing I encountered a second problem:
          If the for-attribute of the label contains a static part and an EL-expression (e.g. s_#

          {foo}

          ) then only the static part ( s_ )is returned

          Show
          Michael Heinen added a comment - I am facing the same problem. This is really annoying if UIs are created generically. Beside the fact that the rowindex is missing I encountered a second problem: If the for-attribute of the label contains a static part and an EL-expression (e.g. s_# {foo} ) then only the static part ( s_ )is returned

            People

            • Assignee:
              Unassigned
              Reporter:
              Val Blant
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development