javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-1222

ValueChange method in POJO doesn't resolve correctly when POJO is a ui:param

    Details

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

      OS X 10.8.3

      Description

      Normally a composite component can resolve a valueChange method in a POJO that is a property of managed bean.

      This is often used to pass a POJO to a <ui:include>:

      <ui:include src="part.xhtml">
          <ui:param name="pojo" value="#{managedColors.unmanaged}"/>
      </ui:include>
      

      The using page would be:

      <custom:list list="#{pojo.colors}"
                   selected="#{pojo.color1}"
                   valueChangeListener="#{pojo.onColorChange}">
          <f:ajax event="valueChange" execute="@this" render="@this"/>
      </custom:list>
      

      However, when the unmanaged bean (POJO) is passed as a <ui:param>, attempting to change the value will result in the following exception:

      javax.faces.event.AbortProcessingException
      /part.xhtml @10,62 valueChangeListener="#{pojo.onColorChange}":
      The class 'com.custom.beans.PojoColors' does not have the property 'onColorChange'.
      

      The valueChange method seems to only be resolved correctly be writing out the complete EL expression:

      <custom:list selected="#{managedColors.unmanaged.color1}"
                   list="#{managedColors.unmanaged.colors}"
                   valueChangeListener="#{managedColors.unmanaged.onColorChange}">
          <f:ajax event="valueChange" execute="@this" render="@this"/>
      </custom:list>
      

      A simple example project for NetBeans has been attached detailing this issue.

        Issue Links

          Activity

          Thomas Lee created issue -
          Manfred Riem made changes -
          Field Original Value New Value
          Link This issue is related to JAVASERVERFACES-2839 [ JAVASERVERFACES-2839 ]
          Manfred Riem made changes -
          Attachment cc-ui-param.zip [ 52244 ]
          Manfred Riem made changes -
          Assignee Manfred Riem [ mriem ]
          Manfred Riem made changes -
          Project javaserverfaces [ 10204 ] javaserverfaces-spec-public [ 10222 ]
          Key JAVASERVERFACES-2835 JAVASERVERFACES_SPEC_PUBLIC-1222
          Affects Version/s 2.1.6 [ 15346 ]
          Component/s composite components [ 14361 ]
          Manfred Riem made changes -
          Assignee Manfred Riem [ mriem ]
          Manfred Riem made changes -
          Link This issue is related to JAVASERVERFACES-2812 [ JAVASERVERFACES-2812 ]
          Manfred Riem made changes -
          Link This issue is related to JAVASERVERFACES-2839 [ JAVASERVERFACES-2839 ]
          Ed Burns made changes -
          Priority Major [ 3 ] Trivial [ 5 ]
          Ed Burns made changes -
          Priority Trivial [ 5 ] Minor [ 4 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Thomas Lee
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: