Skip to main content
1-Visitor
July 12, 2018
Question

Custom Wizard doesn't close after completing in WT11.1

  • July 12, 2018
  • 2 replies
  • 3074 views

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 

2 replies

16-Pearl
July 12, 2018

Hi @tdeschepper,

 

Are you returning FormResult from the processor file. Would you mind sharing your form processor java file.

 

Regards,

Bhushan

1-Visitor
July 13, 2018

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();
}
}
 

 

16-Pearl
August 9, 2018

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);
}

15-Moonstone
August 9, 2018

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();");