I'm trying to use <p:wizard> in a composite component.
I cloned the example from the showcase, and after adding the title attribute to the <p:tab> components, got it to display.
However, when I push the "Next" button, the code in the backing bean does not have a value for the current step and the next step is pointing to the first step.
Here is the backing bean code for the "flowListener":
Code: Select all
public String onFlowProcess(FlowEvent event) {
System.out.println("Event:" + event);
System.out.println("Current wizard step:" + event.getOldStep() );
System.out.println("Next step:" + event.getNewStep());
if(skip) {
skip = false; //reset in case user goes back
return "confirm";
}
else {
return event.getNewStep();
}
}
}
Here is what I in the server log after I push "Next":
Code: Select all
INFO: Event:org.primefaces.event.FlowEvent[source=org.primefaces.component.wizard.Wizard@2ea0c364]
INFO: Current wizard step:undefined
INFO: Next step:Profile
The "oldStep" value is not being filled in (event.getOldStep() = "undefined") and.
The "newStep" value still has the value of my initial tab id (event.getNewStep() = "Profile")
I didn't see anything in the forun about this problem, so I am wondering if I am missing something in my definition.
Anyone know what I am doing wrong, or is this a known problem with <p:wizard>??
Here is the wizard code in the .xhtml composite component:
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.prime.com.tr/ui">
<!-- INTERFACE -->
<cc:interface>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<p:wizard widgetVar="wiz" style="position: relative; left: 10px; top: 20px; width: 700px;"
flowListener="#{sessionBean1.onFlowProcess}" >
<p:tab id="Profile" title="Profile" >
<p:panel header="Customer Profile Information">
<h:messages errorClass="error"/>
<h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">
<h:outputText value="Customer ID: " />
<p:inputText required="false" style="width: 300px;" label="Firstname"
value="" />
<h:outputText value="Description: " />
<p:inputText required="false" style="width: 300px;" label="Lastname"
value="" />
<h:outputText value="Email: " />
<p:inputText value="" style="width: 300px;" />
<h:outputText value="Please Note: " />
<h:outputText value="You must enter either a Customer ID, Description, or Email. " />
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab id="payment" title="Payment" >
<p:panel header="Payment Pofile Information">
<h:messages errorClass="error"/>
<h:panelGrid columns="2" columnClasses="label, value">
<h:outputText value="Customer Type: " />
<p:inputText value="" />
<h:outputText value="First Name: " />
<p:inputText value="" />
<h:outputText value="Last Name: " />
<p:inputText value="" />
<h:outputText value="Address: " />
<p:inputText value="" />
<h:outputText value="City: " />
<p:inputText value="" />
<h:outputText value="State/Province: " />
<p:inputText value="" />
<h:outputText value="Zip: " />
<p:inputText value="" />
<h:outputText value="Country: " />
<p:inputText value="" />
<h:outputText value="Phone: " />
<p:inputText value="" />
<h:outputText value="Fax: " />
<p:inputText value="" />
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab id="contact" title="Credit Card" >
<p:panel header="Credit Card Information">
<h:messages errorClass="error"/>
<h:panelGrid columns="2" columnClasses="label, value">
<h:outputText value="Card Type: " />
<p:inputText required="false" label="Email"
value="" />
<h:outputText value="Number: " />
<p:inputText value=""/>
<h:outputText value="Expiration Date: " />
<p:inputText value=""/>
<h:outputText value="Card Code: " />
<p:inputText value=""/>
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab id="confirm" title="Bank" >
<p:panel header="Bank Account Information">
<p:growl id="growl" sticky="true" showDetail="true"/>
<h:panelGrid id="confirmation" columns="6">
<h:outputText value="Firstname: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText value="Lastname: " />
<h:outputText styleClass="outputLabel"
value=""/>
<h:outputText value="Age: " />
<h:outputText styleClass="outputLabel"
value="" />>
<h:outputText value="Street: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText value="Postal Code: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText value="City: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText value="Email: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText value="Phone " />
<h:outputText styleClass="outputLabel"
value=""/>
<h:outputText value="Info: " />
<h:outputText styleClass="outputLabel"
value="" />
<h:outputText />
<h:outputText />
</h:panelGrid>
<p:commandButton value="Submit" update="growl"
/>
</p:panel>
</p:tab>
</p:wizard>
<p:ajaxStatus>
<f:facet name="start">
<h:outputText value="grrrrr" />
<!-- h:graphicImage value="../design/ajaxloading.gif" / -->
</f:facet>
<f:facet name="complete">
<h:outputText value="zzzz" />
</f:facet>
</p:ajaxStatus>
</cc:implementation>
</html>