Java Reference
In-Depth Information
@ManagedBean
@SessionScoped
public class CustomerController implements Serializable {
/** Creates a new instance of CustomerController */
public CustomerController() {
}
public void saveCustomer(ActionEvent actionEvent) {
//In a real application, we would save the data,
//In this example we simply show a message.
FacesMessage facesMessage = new FacesMessage(
"Data Saved Successfully");
facesMessage.setSeverity(FacesMessage.SEVERITY_INFO);
FacesContext.getCurrentInstance().addMessage(null,
facesMessage);
}
}
As we can see, the saveCustomer() method simply adds a faces message that is
displayed as a confirmation message in our page. In a real application, we of course
would save the data to a database.
At this point we are ready to see the wizard component in action.
 
Search WWH ::




Custom Search