@Override public void broadcast(FacesEvent event) throws AbortProcessingException { super.broadcast(event); if (event instanceof FlowEvent) { FlowEvent flowEvent = (FlowEvent) event; FacesContext context = getFacesContext(); MethodExpression me = getFlowListener(); if (me != null) { String step = (String) me.invoke(context.getELContext(), new Object[]{event}); setStep(step); } else { setStep(flowEvent.getNewStep()); } } } }
@Override public void decode(FacesContext context, UIComponent component) { Wizard wizard = (Wizard) component; if (wizard.isWizardRequest(context)) { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); String clientId = wizard.getClientId(context); String stepToGo = params.get(clientId + "_stepToGo"); String currentStep = wizard.getStep(); FlowEvent event = new FlowEvent(wizard, currentStep, stepToGo); event.setPhaseId(PhaseId.INVOKE_APPLICATION); wizard.queueEvent(event); } }
public String onFlowProcess(FlowEvent event) { if (!event.getOldStep().equals("competitionId")) { return event.getNewStep(); } if (validationPassed()) { return event.getNewStep(); } else { return event.getOldStep(); } } private boolean validationPassed() { // do your validation here. // return true if validation passed }
logger.info("Current wizard step:" + event.getOldStep()); logger.info("Next step:" + event.getNewStep()); return event.getNewStep();
public String onFlowProcess(FlowEvent event) throws Exception { if ((skip == true)) { skip = false; //reset in case user goes back generatePreview(); return CONFIRM_TAB_ID; } else { String newTab = event.getNewStep(); if (CONFIRM_TAB_ID.equals(newTab)) { generatePreview(); } return newTab; } }
@Override public void decode(FacesContext context, UIComponent component) { Wizard wizard = (Wizard) component; if (wizard.isWizardRequest(context)) { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); String clientId = wizard.getClientId(context); String stepToGo = params.get(clientId + "_stepToGo"); String currentStep = wizard.getStep(); FlowEvent event = new FlowEvent(wizard, currentStep, stepToGo); event.setPhaseId(PhaseId.INVOKE_APPLICATION); wizard.queueEvent(event); } }
@Override public void broadcast(FacesEvent event) throws AbortProcessingException { super.broadcast(event); if(event instanceof FlowEvent) { FlowEvent flowEvent = (FlowEvent) event; FacesContext context = getFacesContext(); MethodExpression me = this.getFlowListener(); if(me != null) { String step = (String) me.invoke(context.getELContext(), new Object[]{event}); this.setStep(step); } else { this.setStep(flowEvent.getNewStep()); } } } public String resolveWidgetVar() {