This content has been marked as final.
Show 2 replies
-
1. Re: Selectable linklist without <h:dataTable>
gavin.king Mar 23, 2007 6:16 PM (in response to knuwu)It must be a DataModel, not a plain List.
-
2. Re: Selectable linklist without <h:dataTable>
knuwu Mar 26, 2007 6:40 AM (in response to knuwu)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?