[jboss-user] [JBoss Seam] - multiple component instances in one page

soudmaijer do-not-reply at jboss.com
Tue Feb 6 09:22:26 EST 2007


Allright, I might be asking something dumb, but: I have build a simple helloworld application. Below is the component:


  | @Name("helloworld")
  | public class Helloworld {
  | 
  | 	private DumbUser dumbUser;
  | 	
  | 	public String sayHello() {
  | 		System.out.println("sayHello");
  | 		return "success";
  | 	}
  | 
  | 	public DumbUser getDumbUser() {
  | 		System.out.println("retrieving user");
  | 		return dumbUser;
  | 	}
  | 
  | 	public void setDumbUser(DumbUser dumbUser) {
  | 		System.out.println("setting user");
  | 		this.dumbUser = dumbUser;
  | 	}
  | }
  | 

And this simple class


  | 
  | public class DumbUser {
  | 	
  | 	private String name;
  | 		
  | 	public DumbUser() {
  | 	}
  | 
  | 	public String getName() {
  | 		return name;
  | 	}
  | 
  | 	public void setName(String name) {
  | 		this.name = name;
  | 	}
  | }
  | 
  | 

This is the JSF page:


  |     <h:form id="helloworld">
  |         <div>
  |         	<h:inputText value="#{helloworld.dumbUser.name}"/>
  |             <h:commandButton type="submit" value="sayHello!" action="#{helloworld.sayHello}"/>     			  
  |         </div>
  |     </h:form>
  | 
  | 

When I hit the button, the helloworld.sayHello is never triggered. I can`t figure out why. helloworld.getDumbUser is called but then execution stops. 

Uhm, what am I doing wrong?

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

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



More information about the jboss-user mailing list