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

Support for zero-arg action/valueChangeListener does not work with EL VariableMapper

    Details

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

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      Template client:
      <h:body >
      <ui:decorate template="template.xhtml">
      <ui:param name="bean" value="#

      {beanA}" />
      </ui:decorate>
      </h:body>

      Template:
      <f:subview xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
      <h:form >
      <h:inputText value="value" valueChangeListener="#{bean.processValueChange}" />
      <h:commandButton value="Click" actionListener="#{bean.processAction}" />
      </h:form>
      </f:subview>

      if processValueChange/processAction are methods without event param, a exception
      "javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean'
      resolved to null" is thrown.
      Description
      Template client:
      <h:body >
      <ui:decorate template="template.xhtml">
      <ui:param name="bean" value="#{beanA}

      " />
      </ui:decorate>
      </h:body>
      Template:

      <f:subview xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
      <h:form >
      <h:inputText value="value" valueChangeListener="#

      {bean.processValueChange}

      " />
      <h:commandButton value="Click" actionListener="#

      {bean.processAction}

      " />
      </h:form>
      </f:subview>

      if processValueChange/processAction are methods without event param, a exception "javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null" is thrown.
      Show »

      ADDITIONAL COMMENTS:

      Problem can be solved in
      com.sun.faces.facelets.tag.jsf.ActionSourceRule.ActionListenerMapper2.applyMetadata:
      MethodExpression methodExpressionOneArg = this.attr.getMethodExpression(ctx,
      null,ActionSourceRule.ACTION_LISTENER_SIG);
      MethodExpression methodExpressionZeroArg = this.attr.getMethodExpression(ctx,
      null,ActionSourceRule.ACTION_SIG);

      .. new MethodExpressionActionListener(methodExpressionOneArg,
      methodExpressionZeroArg)

      and probably similarly in Rule for ValueChangeListener.

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated: