1 jls.loader.provide('jls.html.Edit'); 2 3 jls.loader.require('jls.html.HtmlElement'); 4 5 jls.html.Edit = jls.lang.Class.create(jls.html.HtmlElement, 6 { 7 initialize : function($super, parameters, parent) { 8 this._text = ''; 9 $super(parameters, parent); 10 if (parameters.attributes && parameters.attributes.text) { 11 this.setText(parameters.attributes.text); 12 } 13 }, 14 onCreate : function($super) { 15 this.setHtmlTagName('input'); 16 $super(); 17 this.getHtmlElement().setAttribute('type', 'text'); 18 }, 19 getText : function() { 20 if (this.getHtmlElement() != null) { 21 //return this.getHtmlElement().getAttribute('value'); 22 return this.getHtmlElement().value; 23 } 24 return null; 25 }, 26 setText : function(value) { 27 if (this.getHtmlElement() != null) { 28 //this.getHtmlElement().setAttribute('value', value); 29 this.getHtmlElement().value = value; 30 } 31 return this; 32 } 33 }); 34 35