summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prado
diff options
context:
space:
mode:
authorwei <>2006-08-30 23:28:51 +0000
committerwei <>2006-08-30 23:28:51 +0000
commit2fda7f49f3792a0718838742b76a4b533c169af9 (patch)
tree46a5a3eb53a0d64fc25894bfd219a82cecffa807 /framework/Web/Javascripts/prado
parent1f560ccd8a9e21871dbedd548fc97f231131c771 (diff)
Updated TInPlaceTextBox
Diffstat (limited to 'framework/Web/Javascripts/prado')
-rw-r--r--framework/Web/Javascripts/prado/inlineeditor.js30
-rw-r--r--framework/Web/Javascripts/prado/validation3.js6
2 files changed, 31 insertions, 5 deletions
diff --git a/framework/Web/Javascripts/prado/inlineeditor.js b/framework/Web/Javascripts/prado/inlineeditor.js
index 4eb33d5c..24cc9b70 100644
--- a/framework/Web/Javascripts/prado/inlineeditor.js
+++ b/framework/Web/Javascripts/prado/inlineeditor.js
@@ -90,10 +90,26 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
*/
createTextBox : function()
{
- cssClass= this.options.TextBoxCssClass || 'editor_field';
+ cssClass= this.element.className || '';
inputName = this.options.EventTarget;
options = {'className' : cssClass, name : inputName, id : this.options.TextBoxID};
- this.editField = this.options.TextMode == 'SingleLine' ? INPUT(options) : TEXTAREA(options);
+ if(this.options.TextMode == 'SingleLine')
+ {
+ if(this.options.MaxLength > 0)
+ options['maxlength'] = this.options.MaxLength;
+ this.editField = INPUT(options);
+ }
+ else
+ {
+ if(this.options.Rows > 0)
+ options['rows'] = this.options.Rows;
+ if(this.options.Columns > 0)
+ options['cols'] = this.options.Columns;
+ if(this.options.Wrap)
+ options['wrap'] = 'off';
+ this.editField = TEXTAREA(options);
+ }
+
this.editField.style.display="none";
this.element.parentNode.insertBefore(this.editField,this.element)
@@ -137,12 +153,14 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
onTextBoxBlur : function(e)
{
text = this.element.innerHTML;
- if(text != this.editField.value)
+ if(this.options.AutoPostBack && text != this.editField.value)
this.onTextChanged(text);
else
{
+ this.element.innerHTML = this.editField.value;
this.isEditing = false;
- this.showLabel();
+ if(this.options.AutoHide)
+ this.showLabel();
}
},
@@ -195,8 +213,10 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
{
this.isSaving = false;
this.isEditing = false;
- this.showLabel();
+ if(this.options.AutoHide)
+ this.showLabel();
this.element.innerHTML = parameter == null ? this.editField.value : parameter;
+ this.editField.disabled = false;
},
onTextChangedFailure : function(sender, parameter)
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js
index c88aa661..8df3864c 100644
--- a/framework/Web/Javascripts/prado/validation3.js
+++ b/framework/Web/Javascripts/prado/validation3.js
@@ -660,6 +660,12 @@ Prado.WebUI.TBaseValidator.prototype =
if(!this.control)
this.control = $(this.options.ControlToValidate);
+ if(!this.control)
+ {
+ this.isValid = true;
+ return this.isValid;
+ }
+
if(typeof(this.options.OnValidate) == "function")
this.options.OnValidate(this, invoker);