2 Replies Latest reply on May 6, 2009 9:51 PM by Israel Fonseca

    Outjection

    Israel Fonseca Apprentice
      I have the following action inside a datable colunm:

      <a4j:commandButon value="Select" action="#{bean.select(item)}"/>

      my Method:


      @Out("person")
      public Person select(Person p){
      return p;
      }

      it gives me an error "wrong number of parameters", why is it happening?

      thks,
        • 1. Re: Outjection
          Arbi Sookazian Master

          Not sure exactly why until we see stack trace but try this.  (Root cause may be improprer usage of @Out annotation)


          Assuming your class is a JavaBean and not an EJB component:


          @Name("bean")
          public class Foo {
             
              @Out(required=false)
              private Person person;
          
              public void select(Person p){
                   person = p;
              }
          
          }



          By default, scope for a JavaBean is EVENT.


          same example as a SFSB:


          @Name("bean")
          @Stateful
          public class Foo implements FooLocal {
             
              @Out(required=false)
              private Person person;
          
              public void select(Person p){
                   person = p;
              }
          
              @Destroy @Remove
              public void destroy(){}
          
          }

          • 2. Re: Outjection
            Israel Fonseca Apprentice

            Thks for the feedback, the problem was @Out in the method signature... I put it global and worked. Weird anyway.


            Thks again!