net/sf/jsm/widgets/jsmTextField.js
Summary
No overview generated for 'net/sf/jsm/widgets/jsmTextField.js'
function JsmTextField(value) {
this.id=new Date().getTime() + "" + Math.random();
logger.info("Created JsmTextField with id: " + this.id);
this.value = value;
if (jsm.noud(this.value)) this.value="";
}
JsmTextField.extendClass(JsmWidget);
JsmTextField.prototype.className="JsmTextField";
JsmTextField.prototype.toString = function() {
return "[JsmTextField object: value=" + this.value + "]\n";
}
JsmTextField.prototype.getValue = function() {
return this.value;
}
JsmTextField.prototype.setValue = function(value) {
this.value = value;
return this;
}
JsmTextField.prototype.updateModel = function(table, rowIdx, columnIdx, theViewComponent) {
if (jsm.noud(theViewComponent)) {return;}
if (!this.validate(table, rowIdx, columnIdx, theViewComponent)) {
return;
}
td = table.getTd(rowIdx, columnIdx);
if (td.getValue() != theViewComponent.value) {td.setDirty(true);}
td.setValue(theViewComponent.value);
}
JsmTextField.prototype.init = function(theTd) {
this.value = theTd.getValue();
return this;
}
JsmTextField.prototype.getNode = function() {
var textfield = document.createElement("input");
textfield.model = this;
textfield.setAttribute("id", this.id);
textfield.setAttribute("name", this.id);
textfield.setAttribute("type", "text");
textfield.setAttribute("value", this.value);
this.addAttributesToViewComponent(textfield);
return textfield;
}
JsmTextField.prototype.clone = function() {
var clonedWidget = new JsmTextField();
clonedWidget._attributes = this._attributes;
clonedWidget._metaData = this._metaData;
clonedWidget.value = this.value;
return clonedWidget;
}
Documentation generated by
JSDoc on Tue Sep 26 08:42:57 2006