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

            People

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

              Dates

              • Created:
                Updated: