1 15 package org.apache.tapestry.form; 16 17 import org.apache.tapestry.IMarkupWriter; 18 import org.apache.tapestry.IRequestCycle; 19 import org.apache.tapestry.valid.ValidatorException; 20 21 28 public abstract class AbstractValidatableField extends AbstractFormComponent implements 29 ValidatableField 30 { 31 34 public abstract ValidatableFieldSupport getValidatableFieldSupport(); 35 36 40 protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) 41 { 42 getValidatableFieldSupport().render(this, writer, cycle); 43 } 44 45 protected String getSubmittedValue(IRequestCycle cycle) 46 { 47 return cycle.getParameter(getName()); 48 } 49 50 protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle) 51 { 52 String value = getSubmittedValue(cycle); 53 54 getValidatableFieldSupport().bind(this, writer, cycle, value); 55 } 56 57 protected void renderContributions(IMarkupWriter writer, IRequestCycle cycle) 58 { 59 getValidatableFieldSupport().renderContributions(this, writer, cycle); 60 } 61 } 62 | Popular Tags |