[jboss-user] [JBoss Seam] - Re: Selectable linklist without <h:dataTable>

knuwu do-not-reply at jboss.com
Mon Mar 26 06:40:57 EDT 2007


I changed the list to DataModel using DataModel Annotation:

@Stateful
  | @Name("configSelector")
  | @Scope(ScopeType.SESSION)
  | public class ConfigurationSelectorImpl implements ConfigurationSelector {
  |   
  |   @Logger private Log log;
  |   
  |   @DataModel
  |   private ArrayList<Module> moduleList = new ArrayList<Module>();
  |   
  |   @DataModelSelection
  |   @Out(required=false)
  |   private Module selectedModule;
  |   
  |   @SuppressWarnings("unused")
  |   @Create
  |   public void initModuleList() {
  |     moduleList.add(AdminModule.getInstance());
  |     moduleList.add(TestModule.getInstance());
  |   }
  |   
  |   public ArrayList<Module> getModuleList () {
  |     return this.moduleList;
  |   }
  |   
  |   public void selectModule(Module pModule) {
  |     this.selectedModule = pModule;
  |     log.info("#0 selected", this.selectedModule.getName());
  |   }
  |   
  |   @Destroy @Remove
  |   public void destroy() {}
  | 
  | }

The first entry of the DataModel is automatically stored in variable selectedModule (DataModelSelection annotated). This is not may prefered behavior but would be acceptable if there's no other possiblity.

Unfortunatly the parameter pModule is still null in Methode selectModule() when I click another link in the list. The variable selected Module still points to the first list element.

Any idea?

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

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



More information about the jboss-user mailing list