[jboss-user] [JBoss Seam] - selectOneMenu binding to session object

joeyxxx do-not-reply at jboss.com
Thu Jun 21 19:20:35 EDT 2007


I'm trying to bind the currentPersona attribute of the user session object to the selected item in the drop down. Most solutions for this issue on the forum seem to focus on db, persistence context, entity manager etc but my application doesn't use a db directly. I need to have the currentPersona update triggered onChange. If that won't work, an update button will suffice.

I tried the ff because its similar to what worked for me in WO.(I can't shake my past :-)

SelectOneMenu

  | <h:selectOneMenu value="#{user.currentPersona}">
  |   <s:selectItems value="#{user.personaList}" var="per" label="#{per.selectLabel}" hideNoSelectionLabel="true" />
  |  </h:selectOneMenu>
  | 


User Class

  | @Name("user")
  | @Scope(SESSION)
  | public class User implements Serializable{
  | 
  | @DataModel
  | @Out
  | private List<Persona> personaList;
  | 
  | @DataModelSelection
  | @Out(required=false)
  | private currentPersona;
  | 
  | ...
  | 
  | //Mutators
  | public Persona getCurrent Persona() {
  |         return current Persona;
  | }
  | 
  | 
  | public void setCurrentPersona(Persona selected Persona){
  |        log.info("Current Persona:", selectedPersona);
  |        this.current Persona = selectedPersona;
  | }
  |     
  | public List<Persona> getPersonaList() {
  |       return personaList;
  | }
  | 
  | 


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

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



More information about the jboss-user mailing list