Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I have created a multi step wizard with jca.
Whenever the wizard is completed, the processor is called successfully and the code is executed, but the wizard returns to the first step, instead of closing the popup window. Also no feedback messages from the processor are displayed.
<jca:wizard buttonList="DefaultWizardButtonsNoApply" helpSelectorKey="AssignView_help" title="Batch Plot Wizard" type="wizard">
<jca:wizardStep action="createPDFActionStep1" type="createPDFObjectType" label="TDSP Create PDF" />
<jca:wizardStep action="createPDFActionStep2" type="createPDFObjectType" label="TDSP Create PDF" />
</jca:wizard>
Any idea what might be wrong here?
Thijs
Hi @tdeschepper,
Are you returning FormResult from the processor file. Would you mind sharing your form processor java file.
Regards,
Bhushan
Hi, below is the code I'm using.
public class TDSPFormProcessor extends DefaultObjectFormProcessor {
private Logger logger = Logger.getLogger("ext.savaco.batchplotTDSP");
@Override
public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException {
FormResult formResult = new FormResult(FormProcessingStatus.FAILURE);
FeedbackMessage feedbackMessage = new FeedbackMessage(FeedbackType.FAILURE, SessionHelper.getLocale(), "Error occurred", null,
WTMessage.getLocalizedMessage(reservationResource.class.getName(), reservationResource.CONSTRAINT_ERROR, null));
formResult.addFeedbackMessage(feedbackMessage);
return formResult;
}
@Override
public FormResult setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException {
super.setResultNextAction(result, clientData, objectBeans);
logger.debug("in the do setResultNextAction method");
result.setStatus(FormProcessingStatus.FAILURE);
FeedbackMessage fbm = new FeedbackMessage();
fbm.addMessage("Test feedback");
result.addFeedbackMessage(fbm);
return result;
}
@Override
public FormResult preProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException {
logger.debug("in the do preProcess method");
FormResult phaseResult = new FormResult();
phaseResult.setStatus(FormProcessingStatus.SUCCESS);
return phaseResult;
}
public void test()
{
WTPartHelper helper = new WTPartHelper();
WTPart part = helper.getLatestIterationWTPart("test", "test");
PlotObjectCollector poc = new PlotObjectCollector();
}
}
Could you please try below modified code ?
@Override
public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException {
FormResult formResult = new FormResult(FormProcessingStatus.SUCCESS);
try{
//Add create object code
}catch (WTException e){
FormResult formResult = new FormResult(FormProcessingStatus.FAILURE);
}
return formResult;
}
@Override
public FormResult setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException {
if(FormProcessingStatus.SUCCESS.equals(formResult.getStatus())) {
formResult.addExtraData("tableId", "cusotmized table id");
return formResult;
}
return super.setResultNextAction(formResult, clientData, objectBeans);
}
Hello Thijs,
Please try below code to close the entire wizard:
FeedbackMessage fb = new FeedbackMessage(FeedbackType.SUCCESS, Locale.getDefault(), "Confirmation popup header", null, "Confirmation popup details");
result.setStatus(FormProcessingStatus.FAILURE);
result.addFeedbackMessage(fb);
result.setNextAction(FormResultAction.JAVASCRIPT);
result.setJavascript("wfWindowClose();");