[jboss-user] [JBoss Seam] - Re: Parameter passing for page action

milli do-not-reply at jboss.com
Fri May 11 02:55:50 EDT 2007


That's what even I thought but may be I'm doing something wrong.

Here is the simple code I'm trying to run but it does not seem to work with event scope. Both category and id are always null unless I change the scope of categoryAction to session. Could you spot anything wrong with this approach? Thanks


  | @Name("home")
  | Class Home
  | {
  | private String category;
  | 
  | public getCategory()
  | {
  |     if (null == category)
  |           category = new String("Testing Event Scope");
  |     return category;
  | }
  | }	

home.xhtml: 
  | <h:commandLink action="#{categoryAction.action}" value="#{home.category}"> 
  | <f:param name="category" value="#{home.category}" />
  | </h:commandLink>
  | 


  | @Name(categoryAction)
  | @Scope(ScopeType.Event)
  | Class CategoryAction
  | {
  | @RequestParameter("category")
  | private String category;
  | 
  | public String getId()
  | {
  |     if (null == id)
  |        System.out.println("id is null");
  |     return Id;
  | }
  | 
  | public String getCategory()
  | {
  |      if (null == category)
  |         System.out.println("category is null");
  |      return category;
  | }
  | 
  | public void setCategory(String category)
  | {
  |        this.category = category;
  | }
  | 
  | public String action()
  | {
  | this.id = 1;
  | return "category.xhtml"
  | }
  | }	

category.xhtml:
  | 
  | <h:outputText value="categoryAction.id" />
  | <h:outputText value="categoryAction.category" />

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

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



More information about the jboss-user mailing list