cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

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

tdeschepper
3-Visitor

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

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 

4 REPLIES 4
BhushanNehe
14-Alexandrite
(To:tdeschepper)

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

 

schen-7
14-Alexandrite
(To:tdeschepper)

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

Cassie
14-Alexandrite
(To:tdeschepper)

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

Top Tags