2 Replies Latest reply on Aug 11, 2009 2:54 PM by varussell

    Method Signature for Navigation

    varussell

      I am trying to use a method with a primitive parameter passed to it in the from-action attribute of the navigation element.  Yet SEAM does not recognize the method signature.  In other words I have the following




          <navigation from-action="#{myClass.myMethod(long)}">
             <rule if-outcome="success">
                  <redirect view-id="/myPage"/>
             </rule>
          </navigation>





      If I remove the parameter the navigation correctly re-directs to myPage.  As a note, I also have this problem when passing an Object.  Is there some specific way to identify the correct method signature?  Thanks.

        • 1. Re: Method Signature for Navigation
          asookazian

          Is the context/concern of your question method over-loading scenario?


          like myClass.myMethod(long) and myClass.myMethod(int)?


          public class foo{
                  public void m1(long l){
                    //
               }
               
               public void m1(int t){
                    //
               }
          }



          If that's the case, you could do myMethod(new Long(foo)), otherwise, rename the methods so the names are not the same.

          • 2. Re: Method Signature for Navigation
            varussell

            No since in that case they are both primitives resulting in the same signature.  The problem is that the navigation tag is not recognizing the method when a parameter is passed in and therefore does not correctly re-direct.