1 package com.tonbeller.wcf.test; 2 3 import com.tonbeller.wcf.controller.RequestContext; 4 import com.tonbeller.wcf.form.ActionReferenceException; 5 import com.tonbeller.wcf.form.FormBean; 6 import com.tonbeller.wcf.form.FormComponent; 7 8 11 public class WizardTestBean implements FormBean { 12 13 String stringValue = "XX"; 14 int intValue; 15 boolean booleanValue; 16 FormComponent form; 17 18 public void onNext(RequestContext context) throws Exception { 19 if (!"AB".equals(stringValue)) { 20 form.setError("errorElementID", "Please enter AB"); 21 throw new ActionReferenceException(); 22 } 23 form.setError("errorElementID", null); 24 } 25 26 public void setFormComponent(RequestContext context, FormComponent form) { 27 if (this.form == null) 30 this.form = form; 31 } 32 33 public boolean isBooleanValue() { 34 return booleanValue; 35 } 36 public void setBooleanValue(boolean booleanValue) { 37 this.booleanValue = booleanValue; 38 } 39 public int getIntValue() { 40 return intValue; 41 } 42 public void setIntValue(int intValue) { 43 this.intValue = intValue; 44 } 45 public String getStringValue() { 46 return stringValue; 47 } 48 public void setStringValue(String stringValue) { 49 this.stringValue = stringValue; 50 } 51 } 52 | Popular Tags |