here is the component in session scope:
| @Stateful | @Name("userSetting") | @Scope(ScopeType.SESSION) | public class UserSettingAction implements UserSetting { | | private Log logger = LogFactory.getLog(SearchResultAction.class); | | private List<String> selectedItems; | | private List<String> categoryList; | | private HtmlSelectOneMenu selectOneCategory; | | private SelectItem categorySelectItem[]; | private SelectItem selectedCategory; | private HtmlSelectManyPicklist picklist; | private boolean sorted = false; | | @Out | private String headerName; | | private ColumnHeaderList<ColumnHeader> columns; | | @Out | private Map<Class, ColumnHeaderList<ColumnHeader>> columnHeaders; | | @Create | @Begin(join=true) | public void build() { | logger.debug("Populating column headers...."); | selectedItems = new ArrayList<String>(); | categoryList = new ArrayList<String>(); | columnHeaders = new HashMap<Class, ColumnHeaderList<ColumnHeader>>(); | try { | int j = 0; | categorySelectItem = new SelectItem[Infrastructure.getStructure() | .keySet().size()]; | for (Class cat : Infrastructure.getStructure().keySet()) { | IndexRoot indexRoot = Infrastructure.getStructure().get(cat); | SelectItem selectItem = new SelectItem(indexRoot.getClassName().getName(), indexRoot.getName()); | categorySelectItem[j] = selectItem; | headerName = indexRoot.getName(); | ColumnHeaderList<ColumnHeader> columns = new ColumnHeaderList<ColumnHeader>(); | int i = 1; | for (FieldData f : indexRoot.getFields()) { | if (f.isExpanded()) | columns.add(new ColumnHeader(f.getOriginalName(), f | .getAlias(), i, i <= 3)); | else | columns.add(new ColumnHeader(f.getName(), | f.getAlias(), i, i <= 3)); | ++i; | } | columnHeaders.put(indexRoot.getClassName(), columns); | j++; | } | | //set defaults... | Class clazz = getClassFromName((String)categorySelectItem[0].getValue()); | selectOneCategory = new HtmlSelectOneMenu(); | picklist = new HtmlSelectManyPicklist(); | selectOneCategory.setValue((String)categorySelectItem[0].getValue()); | //columns = columnHeaders.get(clazz); | setCurrentFields(clazz); | } catch (Exception e) { | logger.error("exception in loading column names:"); | e.printStackTrace(); | } | } | | rest of the codes ....... | } | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043436#4043436 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043436 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user