Author: pyaschenko
Date: 2011-01-31 11:55:43 -0500 (Mon, 31 Jan 2011)
New Revision: 21335
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
Log:
http://jira.jboss.com/jira/browse/RF-10342
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2011-01-31
16:41:49 UTC (rev 21334)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2011-01-31
16:55:43 UTC (rev 21335)
@@ -60,7 +60,7 @@
},
save: function() {
- var value = this.getValue()
+ var value = this.__getValue()
if(value.length > 0) {
this.setLabel(value);
} else {
@@ -79,7 +79,7 @@
if(!this.useDefaultLabel) {
text = this.getLabel()
}
- this.setValue(text);
+ this.__setValue(text);
this.isSaved = true;
this.oncancel();
},
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-01-31
16:41:49 UTC (rev 21334)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-01-31
16:55:43 UTC (rev 21335)
@@ -7,7 +7,7 @@
$super.constructor.call(this, id, mergedOptions);
this.label = $(document.getElementById(id+"Label"));
var labelText = this.label.text();
- var inputLabel = this.getValue();
+ var inputLabel = this.__getValue();
this.initialValue = (labelText == inputLabel) ? labelText : "";
this.saveOnBlur = mergedOptions.saveOnBlur;
this.showControls = mergedOptions.showControls;
@@ -95,14 +95,14 @@
getLabel: function() {
return this.label.text();
- },
+ },
setLabel: function(value) {
this.label.text(value);
},
isValueChanged: function () {
- return (this.getValue() != this.initialValue);
+ return (this.__getValue() != this.initialValue);
},
onshow: function(){
@@ -116,7 +116,7 @@
onfocus: function(e) {
if(!this.__isFocused()) {
this.__setFocused(true);
- this.focusValue = this.getValue();
+ this.focusValue = this.__getValue();
this.invokeEvent.call(this, "focus", document.getElementById(this.id +
'Input'), e);
}
},
@@ -144,7 +144,7 @@
},
__isValueChanged: function() {
- return (this.focusValue != this.getValue());
+ return (this.focusValue != this.__getValue());
},
__setFocused: function(focused) {
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-01-31
16:41:49 UTC (rev 21334)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-01-31
16:55:43 UTC (rev 21335)
@@ -69,7 +69,7 @@
this.scrollElements = rf.Event.bindScrollEventHandlers(this.id, this.__scrollHandler,
this);
this.__setInputFocus();
this.__setFocused(true);
- this.focusValue = this.getValue();
+ this.focusValue = this.__getValue();
this.invokeEvent.call(this, "focus", document.getElementById(this.id +
'Input'));
this.__showPopup();
@@ -118,7 +118,7 @@
processItem: function(item) {
var label = this.getItemLabel(item);
- this.setValue(label);
+ this.__setValue(label);
this.__setInputFocus();
this.__hidePopup();
@@ -240,7 +240,23 @@
if(!this.inputWidthDefined) {
this.inputItem.width(this.label.width());
}
- }
+ },
+
+ getValue: function() {
+ return this.selValueInput.val();
+ },
+
+ setValue: function(value) {
+ var item;
+ for (var i=0; i<this.items.length; i++) {
+ item = this.items[i];
+ if (item.value == value) {
+ this.__setValue(item.label);
+ this.save();
+ this.popupList.__selectByIndex(i);
+ }
+ }
+ }
}
})());
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2011-01-31
16:41:49 UTC (rev 21334)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2011-01-31
16:55:43 UTC (rev 21335)
@@ -55,14 +55,22 @@
this.input.focus();
},
- getValue: function() {
+ __getValue: function() {
return this.input.val();
},
- setValue: function(value){
+ __setValue: function(value){
this.input.val(value);
},
+ getValue: function() {
+ return this.__getValue();
+ },
+
+ setValue: function(value) {
+ this.__setValue(value);
+ },
+
getInput: function() {
return this.input;
},