You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Koci (JIRA)" <de...@myfaces.apache.org> on 2010/02/09 13:44:27 UTC

[jira] Created: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

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


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.


[jira] Updated: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Martin Koci (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Koci updated MYFACES-2541:
---------------------------------

    Status: Patch Available  (was: Open)

> 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
>         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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832460#action_12832460 ] 

Jakob Korherr commented on MYFACES-2541:
----------------------------------------

Just take a look at some other classes on MyFaces core for the style infos. And sorry, I did not know that from trinidad...

> 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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Martin Koci (JIRA)" <de...@myfaces.apache.org>.
    [ 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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Martin Koci (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832459#action_12832459 ] 

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

Yes, this patch was done before you directed me to http://wiki.apache.org/myfaces/MyFaces_Developer_Notes. Next patch will be better, I promise. Can you please write those rules on wiki in a form of checklist like "class must conform: 1) no unused imports 2) static (even private) variables at the top of class 3) ...". It's very difficult to remember those rules over projects, trinidad for example wants all private members at the bottom of the class and with "_" in name, other rules in EclipseLink, Spring etc...



> 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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832477#action_12832477 ] 

Jakob Korherr commented on MYFACES-2541:
----------------------------------------

OK cool, I was not aware of that. Thanks!

> 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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832453#action_12832453 ] 

Jakob Korherr commented on MYFACES-2541:
----------------------------------------

Martin,

PLEASE try to write the code in a constant style and also really try to follow the code style guidelines. Your { } brackets are mostly set wrong (especially in the test case) and you also tend to include lots of unnecessary blanks (e.g. EasyMock.aryEq(  new Object [] {})). Of course, this is not wrong, but it looks very odd. Furthermore the license information was missing in the test case. I also noticed two static variables at the bottom of the class. Static variables and methods should always be at the top of the class.

I also noticed that you did not write the tearDown() method as supposed (set all instances created in setUp() to null) and I also completed the last test case testRestoreState() by using reflection to verify that the state is restored correctly.

> 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.


[jira] Updated: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Korherr updated MYFACES-2541:
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-beta-2
           Status: Resolved  (was: Patch Available)

> 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
>             Fix For: 2.0.0-beta-2
>
>         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.


[jira] Commented: (MYFACES-2541) Support for actionlistener method without ActionEvent parameter

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832457#action_12832457 ] 

Jakob Korherr commented on MYFACES-2541:
----------------------------------------

I also don't see the problem with the VariableMapper. Maybe you could explain that to me, please.

For now I'll commit an altered version of your patch without the changes in ActionSourceRule.

> 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.