5 Replies Latest reply on Dec 20, 2007 11:58 AM by Pete Muir

    seam events

    Sven Mueller Newbie

      hi,

      i'm having problems with seam events definied in components.xml. if a certain events occurs a method with a string as an argument shall be called.

      example:

      <components>
       <event type="say">
       <action execute="#{exampleListener.saySomething}"/>
       </event>
      </components>
      



      @Name("example")
      public class Example {
       public void saySomething() {
       FacesMessages.instance().add("Hello World");
       Events.instance().raiseEvent("say", "Hello World");
       }
      }
      



      @Name("exampleListener")
      public class ExampleListener {
       public void saySomething(String text) {
       FacesMessages.instance().add(text);
       }
      }
      


      this example does'nt work because seam tries to find a method named 'saySomething' without any argument. but how can i define that a method with an argument (e.g. string) shall be executed? is this possible via components.xml?

      cheers,
      sven