facelets
  1. facelets
  2. FACELETS-326

Avoid UIRepeat calling getValue() when rendered is false.

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.14
    • Fix Version/s: 1.1.15
    • Component/s: impl
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      326

      Description

      UIRepeat is calling getValue() for child components even if the child is not
      rendered. If the child value expression is not valid JSF/EL will throw an
      exception.

      When handling heterogeneous objects (i.e. objects of different classes) in an
      <ui:repeat/> I try to use "rendered" on child components to avoid invalid
      expression evaluation.

      <ui:repeat value="#

      {bean.mixedObjects}

      " var="object">

      <h:panelGroup rendered="#

      {object.class.name EQ 'A'}

      ">
      ...
      <h:inputText value="#

      {object.fieldA}

      "/>
      ...
      </h:panelGRoup>

      <h:panelGroup rendered="#

      {object.class.name EQ 'B'}

      ">
      ...
      <h:inputText value="#

      {object.fieldB}

      "/>
      ...
      </h:panelGroup>

      </ui:repeat>

      In this example, fieldB is not present in class A and fieldA is not present in
      class B.

      The call to getValue() is located in UIRepeat.populate() when saving child state.

      UIRepeat.saveChildState() should propagate "rendered status" and avoid calling
      getValue() in populate() if child component is not rendered and assign "null".

        Activity

        Show
        adrianpj added a comment - This guy seems to have the same scenario: http://mail-archives.apache.org/mod_mbox/myfaces-users/200607.mbox/%3c20060725122000.F16D210FB001@asf.osuosl.org%3e

          People

          • Assignee:
            Unassigned
            Reporter:
            adrianpj
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: