// when we found wizard we have to associate this submit button
// with complete action on wizard.
if(null != wizard){
VolantisProtocol protocol = getProtocol(context);
ButtonScriptHandlerAttributes buttonAttributes = new ButtonScriptHandlerAttributes();
String submitId = protocolAttributes.getId();
if(null == submitId){
submitId = protocol.getMarinerPageContext().generateUniqueFCID();
protocolAttributes.setId(submitId);
}
buttonAttributes.setId(submitId);
//if xf:label element was not specified for xf:submit element
//then set label to the default value
if (null == caption) {
((XFFormFieldAttributes)protocolAttributes)
.setCaption(new LiteralTextAssetReference(
DEFAULT_SUBMIT_CAPTION));
}
// wizard is embracing this element
// wizard id is needed for proper action reference desciption
WizardAttributes wizardAttrs = (WizardAttributes)wizard.getProtocolAttributes();
final String wizardId = wizardAttrs.getId();
// associate button with complete action
final List memberList = new ArrayList();
memberList.add(ActionName.COMPLETE);
buttonAttributes.setActionReference(new ActionReference() {
public String getWidgetId() {return wizardId;}
public List getMemberNames() {return memberList;}
});
WidgetModule widgetModule = protocol.getWidgetModule();