我认为这很简单,但我对此感到困惑。想法是想使用liferay wizard
,如:https://www.primefaces.org/showcase/ui/panel/wizard.xhtml。我在xhtml上有这个:
<h:form id="frmCreate">
<p:wizard flowListener="#{flowWizard.onFlowProcess}">
<p:tab id="header" title="Header">
<p:panel>
/*1*/
</p:panel>
</p:tab>
<p:tab id="detail" title="Detail">
<p:panel>
/*2*/
</p:panel>
</p:tab>
<p:tab id="confirmation" title="Confirmation">
<p:panel>
/*3*/
</p:panel>
</p:tab>
</p:wizard>
</h:form>
在豆子上:
@ManagedBean
@ViewScoped
public class FlowWizard {
public String onFlowProcess(FlowEvent event) {
return event.getNewStep();
}
}
但是当我尝试单击“下一步”按钮时,它不会将页面更改为下一个选项卡,并且我在控制台上收到此错误消息:
11:16:21,663 ERROR [ExceptionHandlerAjaxImpl:62] java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
javax.faces.FacesException: java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
at com.sun.faces.renderkit.ResponseStateManagerImpl.getViewState(ResponseStateManagerImpl.java:137)
...
Caused by: java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
...
Jul 13, 2013 11:16:21 AM org.apache.catalina.core.ApplicationDispatcher invoke
怎么了?感谢。
答案 0 :(得分:3)
堆栈跟踪建议您需要在Serializable
FlowWizard