1 5 package org.exoplatform.faces.core.component; 6 7 import java.io.IOException ; 8 import javax.faces.context.FacesContext; 9 import javax.faces.context.ResponseWriter; 10 21 public class UIHtmlTextArea extends UIStringInput { 22 private String width_ ; 23 private String height_ ; 24 private boolean setFormScript_ ; 25 26 public UIHtmlTextArea(String name, String text, String width, String height) { 27 super(name, text) ; 28 width_ = width ; 29 height_ = height ; 30 setFormScript_ = false ; 31 } 32 33 public void encodeBegin(FacesContext context) throws IOException { 34 ResponseWriter w = context.getResponseWriter() ; 35 String value = value_ ; 36 if (value == null) value = "" ; 37 w.write("<textarea id='"); w.write(name_); w.write("'") ; 38 w.write(" name='"); w.write(name_); w.write("'") ; 39 if (getClazz() != null) { 40 w.write(" class='"); w.write(getClazz()); w.write("'") ; 41 } 42 w.write('>') ; 43 w.write(value) ; 44 w.write("</textarea>") ; 45 if(!setFormScript_) { 46 UISimpleForm uiForm = (UISimpleForm) getParent() ; 47 uiForm.setEnhancedScript(name_ , width_ , height_) ; 48 setFormScript_ = true ; 49 } 50 } 51 } | Popular Tags |