[jboss-user] [JBoss Seam] - SelectOneRadio

yohann49 do-not-reply at jboss.com
Mon Aug 27 10:54:17 EDT 2007


hello !

I have a page with radio buttons. But when I click on the submit button, I don't know what button has been selected. 

My bean : 

  | @Stateful
  | @Scope(SESSION)
  | @Name("PackageManager")
  | public class PackageManager implements com.pingwy.web.front.PackageManagerLocal, Serializable {
  |     
  |     /**
  |      * Creates a new instance of PackageManager
  |      */
  |         
  |     @In
  |     private EntityManager em;
  |     
  |     @In(required = false) @Out(required = false) private List<Package> packages = new ArrayList<Package>();
  |     
  |     //@In(required = false) @Out(required = false) private List<Package> packageLine = new ArrayList<Package>();
  |     
  |     @In(required = false) @Out(required = false) private Package packageLine;
  |     
  |     @Factory(value ="packages")
  |     public void findPackage(){
  |         
  |         System.out.println("bonjour");
  |         
  |         Query query;
  |                 
  |         query = em.createQuery("Select p From Package p");
  |         packages = (List<Package>) query.getResultList();
  |         
  |         
  |     } 
  |     
  |   @Remove @Destroy
  |     public void destroy(){
  |     }
  | 
  |     public Package getPackageLine() {
  |         return packageLine;
  |     }
  | 
  |     public void setPackageLine(Package packageLine) {
  |         this.packageLine = packageLine;
  |     }
  | 
  |     public List<Package> getPackages() {
  |         return packages;
  |     }
  | 
  |     public void setPackages(List<Package> packages) {
  |         this.packages = packages;
  |     }
  |    
  | }
  | 

My jsf page : 

  | <html xmlns="http://www.w3.org/1999/xhtml"
  |       xmlns:ui="http://java.sun.com/jsf/facelets"
  |       xmlns:h="http://java.sun.com/jsf/html"
  |       xmlns:f="http://java.sun.com/jsf/core"
  |       xmlns:s="http://jboss.com/products/seam/taglib"
  |       xmlns:rich="http://richfaces.ajax4jsf.org/rich">
  |     
  | 
  |         
  |         <ui:composition template="templates/client.xhtml">
  | 
  |            <ui:define name="servicesclients">
  |                
  |                 <h:form>
  |                     
  |                    
  |                 <h:selectOneRadio value="#{PackageManager.packageLine}" layout="pageDirection" >
  |                     <s:selectItems value="#{packages}" var="pack" label="#{pack.packName} : #{pack.descriptionPa.ck}"/>
  |                 </h:selectOneRadio>
  |                     
  |                 <h:commandButton  value="Next" type="submit"/>
  |                     
  |                 </h:form>
  |                 
  |             </ui:define>
  | 
  |             
  | 
  |         </ui:composition>
  | 
  | 

thanks in advance.
Yohann

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

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



More information about the jboss-user mailing list