Wizard problem
darmstadter Mar 9, 2009 6:29 AMI create a wizard with modelPanel. In step1, I use a combbox, so that the user can select the next step.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:dim="http://dimetis.de/jsf"> <rich:panel styleClass="backgroundNet" style="height:275px"> <a4j:outputPanel id="createTaskType"> <h:panelGrid style="margin-left:60px; margin-top:10px;"> <h:selectOneMenu style="width : 360px;" ajaxSingle="true" value="#{createTaskDialogBean.taskType}"> <f:selectItems value="#{createTaskDialogBean.taskTypes}" /> <a4j:support event="onchange"/> </h:selectOneMenu> <rich:separator height="1px" style="margin-top:7px;"/> </h:panelGrid> </a4j:outputPanel> </rich:panel> <h:panelGrid columns="3" style="margin-top:8px;vertical-align:bottom"> <rich:spacer width="190px" /> <a4j:commandButton action="#{createTaskDialogBean.refreshBean}" reRender="createTaskType" onclick="Richfaces.hideModalPanel('taskWizard');" value="Cancel" style="float:right; width:110px; height:30px;"/> <a4j:commandButton value="Next >>" immediate="true" style="float:right; width : 110px; height:30px;" styleClass="createTaskStep1Object" action="#{createTaskDialogBean.getTaskType}"/> </h:panelGrid> </ui:composition>
java bean: the bean will be keepalive
private String taskType = null; /** * select item list for play type combbox */ private List<SelectItem> t_list = null; public List<SelectItem> getTaskTypes() { if(t_list != null){ return t_list; } t_list = new ArrayList<SelectItem>(); SelectItem item = new SelectItem(Constants.IN, "Recording"); SelectItem item2 = new SelectItem(Constants.OUT, "Playout"); t_list.add(item); t_list.add(item2); setTaskType(Constants.IN); return t_list; } public String getTaskType() { return taskType; } public void setTaskType(String taskType) { this.taskType = taskType; }
But aperiodic the wizard doesn't work, because of the null value of the selectOneMenu(with debug found, that the getter method getTaskType() return null value). I don't know the reason and difficult to find out. Anybody hat ideas? Thanks in advance.