Author: abelevich
Date: 2009-01-29 11:06:21 -0500 (Thu, 29 Jan 2009)
New Revision: 12492
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
RF-5418, RF-5284
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
---
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2009-01-29
15:55:41 UTC (rev 12491)
+++
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2009-01-29
16:06:21 UTC (rev 12492)
@@ -324,26 +324,31 @@
setValue : function(e, param) {
var value = this.valueKeeper.value;
var userValue = this.getParameters(e,param,"value");
- this.endEditableState();
-
- if (userValue.blank()) {
- this.setDefaultText();
- this.valueKeeper.value = "";
- } else {
- this.currentText = userValue;
- this.valueKeeper.value = userValue;
- }
-
- if (userValue != this.value) {
- this.startChangedState();
- if (value != userValue) {
- this.tempValueKeeper.value = userValue;
- Richfaces.invokeEvent(this.events.onchange, this.inplaceInput, "onchange",
userValue);
+ var proceed = true;
+
+ if(value != userValue) {
+ proceed = Richfaces.invokeEvent(this.events.onchange, this.inplaceInput,
"onchange", userValue);
+ }
+
+ if (proceed) {
+ this.tempValueKeeper.value = userValue;
+ this.endEditableState();
+ if (userValue.blank()) {
+ this.setDefaultText();
+ this.valueKeeper.value = "";
+ } else {
+ this.currentText = userValue;
+ this.valueKeeper.value = userValue;
}
+ if (userValue != this.value) {
+ this.startChangedState();
+ } else {
+ this.startViewState();
+ }
} else {
- this.startViewState();
- }
+ this.cancel();
+ }
},
getValue : function() {
Show replies by date