1 64 65 package com.jcorporate.expresso.services.html; 66 67 72 73 import java.io.PrintWriter ; 74 75 76 80 public class TextField 81 extends HtmlElement { 82 protected int maxLength = 0; 83 protected int size = 0; 84 protected String fieldName = null; 85 protected String fieldValue = (""); 86 87 90 public TextField() 91 throws HtmlException { 92 super(); 93 } 94 95 103 public TextField(String newFieldName, String newFieldValue, 104 int newMaxLength, int newSize) 105 throws HtmlException { 106 super(newFieldName); 107 fieldName = newFieldName; 108 fieldValue = newFieldValue; 109 maxLength = newMaxLength; 110 size = newSize; 111 } 112 113 119 protected void display(PrintWriter out, int depth) 120 throws HtmlException { 121 this.padWithTabs(out, depth); 122 out.print("<input"); 123 124 if (cSSClass != null) { 125 out.print(" class=\"" + cSSClass + "\""); 126 } 127 if (cSSID != null) { 128 out.print(" id=\"" + cSSID + "\""); 129 } 130 131 out.println(" type=text name=" + fieldName + " value=\"" + fieldValue + 132 "\" maxlength=" + maxLength + " size=" + size + ">"); 133 setDisplayed(); 134 } 135 136 137 } 138 | Popular Tags |