1 15 package org.apache.tapestry.form; 16 17 import org.apache.tapestry.IMarkupWriter; 18 import org.apache.tapestry.IRequestCycle; 19 20 31 public abstract class Button extends AbstractFormComponent 32 { 33 37 protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) 38 { 39 writer.beginEmpty("button"); 40 writer.attribute("type", "button"); 41 writer.attribute("name", getName()); 42 43 if (isDisabled()) 44 { 45 writer.attribute("disabled", "disabled"); 46 } 47 48 renderIdAttribute(writer, cycle); 49 50 renderInformalParameters(writer, cycle); 51 52 String label = getLabel(); 53 54 if (label != null) 55 writer.print(label); 56 else 57 renderBody(writer, cycle); 58 59 writer.closeTag(); 60 } 61 62 public abstract String getLabel(); 63 } 64 | Popular Tags |