1 18 package net.sf.uitags.tag.formGuide; 19 20 import javax.servlet.jsp.JspException ; 21 22 import net.sf.uitags.tag.AbstractUiTag; 23 import net.sf.uitags.tagutil.validation.RuntimeValidator; 24 25 31 public class ObserveForNullTag extends AbstractUiTag { 32 36 39 private static final long serialVersionUID = 100L; 40 41 42 43 47 50 protected String elementId; 51 54 protected String elementName; 55 56 57 58 62 65 public ObserveForNullTag() { 66 super(); 67 } 68 69 70 71 75 80 public void setElementId(String val) { 81 this.elementId = val; 82 } 83 84 89 public void setElementName(String val) { 90 this.elementName = val; 91 } 92 93 94 95 99 106 public final int doEndTag() throws JspException { 107 RuntimeValidator.assertAttributeExclusive( 108 "elementId", this.elementId, "elementName", this.elementName); 109 RuntimeValidator.assertEitherSpecified( 110 "elementId", this.elementId, "elementName", this.elementName); 111 112 doEndTagWithoutRuntimeValidation(); 113 114 return EVAL_PAGE; 115 } 116 117 123 protected void doEndTagWithoutRuntimeValidation() { 124 FormGuideTag formGuideTag = (FormGuideTag) findParent(FormGuideTag.class); 125 if (this.elementId != null) { 126 formGuideTag.addObservedElementId(this.elementId, null); 127 } 128 else if (this.elementName != null) { 129 formGuideTag.addObservedElementName(this.elementName, null); 130 } 131 } 132 } 133 | Popular Tags |