1 15 package org.apache.tapestry.form; 16 17 import org.apache.tapestry.IMarkupWriter; 18 import org.apache.tapestry.IRequestCycle; 19 20 30 31 public abstract class Submit extends AbstractSubmit 32 { 33 protected boolean isClicked(IRequestCycle cycle, String name) 34 { 35 40 return cycle.getParameter(name) != null; 43 } 44 45 49 protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) 50 { 51 writer.beginEmpty("input"); 52 writer.attribute("type", "submit"); 53 writer.attribute("name", getName()); 54 55 if (isDisabled()) 56 writer.attribute("disabled", "disabled"); 57 58 String label = getLabel(); 59 60 if (label != null) 61 writer.attribute("value", label); 62 63 renderIdAttribute(writer, cycle); 64 65 renderInformalParameters(writer, cycle); 66 67 writer.closeTag(); 68 } 69 70 71 public abstract String getLabel(); 72 73 } | Popular Tags |