Author: abelevich
Date: 2008-03-27 16:45:58 -0400 (Thu, 27 Mar 2008)
New Revision: 7337
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2791
http://jira.jboss.com/jira/browse/RF-2810
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
---
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-27
20:08:31 UTC (rev 7336)
+++
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-27
20:45:58 UTC (rev 7337)
@@ -14,7 +14,6 @@
import javax.faces.context.ResponseWriter;
import javax.faces.model.SelectItem;
-import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.util.InputUtils;
import org.ajax4jsf.util.SelectUtils;
import org.apache.commons.logging.Log;
@@ -117,9 +116,12 @@
return attributes.toString();
}
- public String getSelectedItemLabel(FacesContext context, UIComponent component) {
+ public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component)
{
String defaultLabel = null;
- Object value = component.getAttributes().get("value");
+ Object value = component.getSubmittedValue();
+ if (value == null) {
+ value = component.getAttributes().get("value");
+ }
if (value == null) {
return createDefaultLabel(component);
}
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-27
20:08:31 UTC (rev 7336)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-27
20:45:58 UTC (rev 7337)
@@ -145,7 +145,10 @@
if ((!this.comboList.isList || this.clickOnBar)) {
this.saveValue(this.currentItemValue, this.tempValueKeeper.value);
}
- this.comboList.hide();
+
+ if (this.attributes.showControls) {
+ this.comboList.hide();
+ }
},
applyTmpValue : function() {
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-27 20:08:31 UTC
(rev 7336)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-27 20:45:58 UTC
(rev 7337)
@@ -27,8 +27,12 @@
<f:resource var="cancelIcon"
name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
<jsp:scriptlet>
<![CDATA[
- Object value = component.getAttributes().get("value");
- Object fieldValue = component.getAttributes().get("value");
+
+ Object value = component.getSubmittedValue();
+ if(value == null) {
+ Object value = component.getAttributes().get("value");
+ Object fieldValue = value;
+ }
String fieldLabel = getSelectedItemLabel(context, component);
value = getConvertedStringValue(context, component,value);