[jboss-user] [JBoss Seam] - seam events

skanky78 do-not-reply at jboss.com
Wed Dec 19 17:23:36 EST 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114424#4114424

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114424



More information about the jboss-user mailing list