0

I think it's simple but I got stuck with this. The idea is would like to use the liferay wizard as in: https://www.primefaces.org/showcase/ui/panel/wizard.xhtml. I have this on the 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>

And on the bean:

@ManagedBean
@ViewScoped
public class FlowWizard {
    public String onFlowProcess(FlowEvent event) {
        return event.getNewStep();
    }
}

But when I tried to click NEXT button, it doesn't change the page to the next tab, and I got this error message on the console:

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

What's wrong? Thanks.

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
mrjimoy_05
  • 3,452
  • 9
  • 58
  • 95
  • What's the scope of the bean ? – Andy Jul 13 '13 at 04:26
  • @Andy: It's `ViewScoped`.. – mrjimoy_05 Jul 13 '13 at 04:26
  • CDI or Managed ? what's the JSF version also ? sorry I'm not able to duplicate your error. – Andy Jul 13 '13 at 04:28
  • @Andy: `Managed`. The JSF is 2.0.. – mrjimoy_05 Jul 13 '13 at 04:29
  • Hmmm. Weird. I can't duplicate it, and you're running this code ? I'm getting a warning but you can get rid of it by implementing Serializable in your class. – Andy Jul 13 '13 at 04:32
  • 1
    I'm unable to duplicate the error on my end sorry. The stacktrace suggest that you need to implement `Serializable` at `FlowWizard`. Perhaps you're serializing it ? So try that. – Andy Jul 13 '13 at 04:56
  • @Andy: Wow thanks, it works by adding implement `Serializable`!! :), thank you.. Please add your comment as an answer so I can accept it as an answer. Thanks, Andy! :) – mrjimoy_05 Jul 13 '13 at 05:04

1 Answers1

3

The stacktrace suggest that you need to implement Serializable at FlowWizard

Andy
  • 5,900
  • 2
  • 20
  • 29