[ 
https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832475#action_12832475
 ] 

Martin Koci commented on MYFACES-2541:
--------------------------------------

Problem with variableMapper:
1) template client:
<h:body >
    <ui:decorate template="template.xhtml">
      <ui:param name="bean" value="#{beanA}" />
    </ui:decorate>
</h:body>

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

a) if bean.processAction is method with actionEvent there is no problem and 
method is called

b) id bean.processAction is method without actionEvent param -> 
javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' 
resolved to null
        at org.apache.el.parser.AstValue.getTarget(AstValue.java:67)
        at org.apache.el.parser.AstValue.invoke

Explanation: TagAttribute.getMethodExpression creates a MethodExpression with 
variableMapper (because it is aware of facelets context, but 
ExpressionFactory.createMethodExpression() used in 
MethodExpressionActionListener cannot reach to facelets mapping. It can be easy 
seen while debugging: first MethodExpression has a orig.varMapper attribute 
with "bean = beanA", but second MethodExpression created in 
MethodExpressionActionListener has this attribute null.


> Support for actionlistener method without ActionEvent parameter
> ---------------------------------------------------------------
>
>                 Key: MYFACES-2541
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2541
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: myfaces trunk
>            Reporter: Martin Koci
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2541.patch
>
>
> With JSF 2.0 is possible to have actionListener method without ActionEvent 
> param: 
> https://javaserverfaces.dev.java.net/nonav/docs/2.0/javadocs/javax/faces/event/MethodExpressionActionListener.html#MethodExpressionActionListener

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to