WackyWizardFormpublic class WackyWizardForm extends ActionForm
Fields Summary |
---|
private int | page | private String[] | pageFormNames | private ActionForm[] | pageForms |
Constructors Summary |
---|
public WackyWizardForm()
pageFormNames[0] = "FirstPageForm";
pageFormNames[1] = "SecondPageForm";
|
Methods Summary |
---|
private ActionForm | createActionForm(ModuleConfig mconfig, java.lang.String formName)
FormBeanConfig fbconfig = mconfig.findFormBeanConfig(formName);
ActionForm form = null;
try {
if (fbconfig.getDynamic()) {
DynaActionFormClass dafc = DynaActionFormClass.createDynaActionFormClass(fbconfig);
form = (ActionForm) dafc.newInstance();
}
else {
form = (ActionForm) Class.forName(fbconfig.getType()).newInstance();
}
}
catch (Exception e) {
e.printStackTrace();
}
return form;
| public int | getPage()
return page;
| public void | reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
super.reset(mapping, request);
ModuleConfig mconfig = mapping.getModuleConfig();
for (int i=0; i<pageFormNames.length; i++) {
pageForms[i] = createActionForm(mconfig, pageFormNames[i]);
}
| public void | setPage(int page)
this.page = page;
| public ActionErrors | validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
ActionErrors errors = super.validate(mapping, request);
for (int i=0; i<=page; i++) {
errors.add( pageForms[i].validate(mapping, request) );
}
return errors;
|
|