Author: alexsmirnov
Date: 2010-11-17 11:48:10 -0500 (Wed, 17 Nov 2010)
New Revision: 20078
Modified:
branches/RF-8742-1/
branches/RF-8742-1/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
Log:
Merged revisions 20074-20077 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20074 | abelevich | 2010-11-17 07:45:24 -0800 (Wed, 17 Nov 2010) | 1 line
RF-9791, RF-9664
.......
r20075 | abelevich | 2010-11-17 07:47:13 -0800 (Wed, 17 Nov 2010) | 1 line
RF-9664
.......
r20076 | abelevich | 2010-11-17 07:49:15 -0800 (Wed, 17 Nov 2010) | 1 line
RF-9607
.......
r20077 | abelevich | 2010-11-17 08:26:50 -0800 (Wed, 17 Nov 2010) | 1 line
fix behavior id
.......
Property changes on: branches/RF-8742-1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-20022
+ /trunk:1-20077
Modified:
branches/RF-8742-1/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
===================================================================
---
branches/RF-8742-1/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-11-17
16:48:10 UTC (rev 20078)
@@ -45,7 +45,7 @@
public String getChangedStateClass();
- public String getDisableStateClass();
+ public String getDisabledStateClass();
public String getEditClass();
Modified:
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-11-17
16:48:10 UTC (rev 20078)
@@ -77,7 +77,7 @@
public abstract String getChangedStateClass();
@Attribute
- public abstract String getDisableStateClass();
+ public abstract String getDisabledStateClass();
@Attribute
public abstract String getEditClass();
Modified:
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-11-17
16:48:10 UTC (rev 20078)
@@ -198,7 +198,7 @@
}
public String getDisableStateCss(InplaceComponent component) {
- String css = component.getDisableStateClass();
+ String css = component.getDisabledStateClass();
return concatClasses("rf-ii-dis-s", css);
}
Modified:
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-11-17
16:48:10 UTC (rev 20078)
@@ -111,7 +111,7 @@
}
public String getDisableStateCss(InplaceComponent component) {
- String css = component.getDisableStateClass();
+ String css = component.getDisabledStateClass();
return concatClasses("rf-is-dis-s", css);
}
Modified:
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-11-17
16:48:10 UTC (rev 20078)
@@ -13,8 +13,8 @@
this.selValueInput = $(document.getElementById(id+"selValue"));
this.list = $(document.getElementById(id+"List"));
this.list.bind("click", $.proxy(this.__onListClick, this));
- this.openOnEdit = options.openOnEdit;
- this.saveOnSelect = options.saveOnSelect;
+ this.openOnEdit = mergedOptions.openOnEdit;
+ this.saveOnSelect = mergedOptions.saveOnSelect;
this.savedIndex = -1;
}
@@ -23,6 +23,8 @@
var defaultOptions = {
defaultLabel: "",
+ saveOnSelect: true,
+ openOnEdit: true,
showControl: false,
itemCss: "rf-is-opt",
selectItemCss: "rf-is-sel",
Modified:
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-17
16:48:10 UTC (rev 20078)
@@ -129,7 +129,6 @@
if (this.items.length>0 && this.enableManualInput) {
this.cache = new rf.utils.Cache("", this.items, getData, true);
}
-
this.changeDelay = mergedOptions.changeDelay;
};
@@ -241,10 +240,8 @@
__onChangeValue: function(e) {
this.popupList.__selectByIndex();
var newValue = this.getValue();
-
if(this.cache && this.cache.isCached(newValue)) {
this.__updateItems();
-
if(!this.popupList.isVisible()) {
this.showPopup();
}
@@ -290,44 +287,51 @@
processItem: function(item) {
var key = $(item).attr("id");
- var value = this.getItemValue(key);
- this.selValueInput.val(value);
- var label = this.getItemLabel(key);
+ var label;
+ $.each(this.clientItems, function() {
+ if(this.id == key) {
+ label = this.label;
+ return false;
+ }
+ });
this.setValue(label);
this.hidePopup();
this.__setInputFocus();
},
- getItemValue: function(key) {
- for(var i in this.clientItems) {
- var item = this.clientItems[i];
- if(item && item.id == key) {
- return item.value;
- }
- }
- },
-
- getItemLabel: function(key) {
- for(var i in this.clientItems) {
- var item = this.clientItems[i];
- if(item && item.id == key) {
- return item.label;
- }
- }
- },
-
onblur: function(e) {
- this.hidePopup();
+ this.hidePopup();
+ var value = "";
+ var label = this.defaultLabel;
var inputLabel = this.getValue();
- if(!inputLabel || inputLabel == "") {
- this.setValue(this.defaultLabel);
- this.selValueInput.val("");
- }
-
+ if(inputLabel && inputLabel != "") {
+ var items = this.cache.getItems(inputLabel);
+ if(items.length > 0) {
+ var first = $(items[0]);
+ $.each(this.clientItems, function() {
+ if(this.id == first.attr("id")) {
+ label = this.label;
+ value = this.value;
+ return false;
+ }
+ });
+ } else {
+ var prevValue = this.selValueInput.val();
+ if(prevValue && prevValue != "") {
+ $.each(this.clientItems, function() {
+ if(this.value == prevValue) {
+ label = this.label;
+ value = this.value
+ return false;
+ }
+ });
+ }
+ }
+ }
+ this.setValue(label);
+ this.selValueInput.val(value);
this.focused = false;
-
this.invokeEvent.call(this,"blur", document.getElementById(this.id +
'Input'), e);
-
if(this.focusValue != this.selValueInput.val() ) {
this.invokeEvent.call(this, "change", document.getElementById(this.id +
'Input'), e);
}
Modified:
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
---
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-11-17
16:26:50 UTC (rev 20077)
+++
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-11-17
16:48:10 UTC (rev 20078)
@@ -39,7 +39,7 @@
*
*/
-@JsfBehavior(id = "org.richfaces.behavior.ToggleControl", tag = @Tag(name =
"toggleControl", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets))
+@JsfBehavior(id = "org.richfaces.component.behavior.ToggleControl", tag =
@Tag(name = "toggleControl", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets))
public class ToggleControl extends ClientBehavior {
public static final String BEHAVIOR_ID =
"org.richfaces.component.behavior.ToggleControl";