[richfaces-svn-commits] JBoss Rich Faces SVN: r18618 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Aug 13 09:44:52 EDT 2010


Author: abelevich
Date: 2010-08-13 09:44:52 -0400 (Fri, 13 Aug 2010)
New Revision: 18618

Modified:
   trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
   trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
   trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
add 'tab' support

Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2010-08-13 12:54:58 UTC (rev 18617)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2010-08-13 13:44:52 UTC (rev 18618)
@@ -50,8 +50,6 @@
     @ResourceDependency(library="org.richfaces", name = "inplaceInput.ecss") })
 public class InplaceInputBaseRenderer extends RendererBase {
     
-    public static final String OPTIONS_STATE = "state";
-    
     public static final String OPTIONS_EDIT_EVENT = "editEvent";
     
     public static final String OPTIONS_EDIT_CONTAINER = "editContainer";
@@ -142,7 +140,6 @@
         
         String clientId = inplaceInput.getClientId(facesContext);
         Map<String, Object> options = new HashMap<String, Object>();
-        options.put(OPTIONS_STATE, inplaceInput.getState());
         options.put(OPTIONS_EDIT_EVENT, inplaceInput.getEditEvent());
         options.put(OPTIONS_NONE_CSS, NONE_CSS);
         options.put(OPTIONS_CHANGED_CSS, CHANGED_STATE_CSS);

Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss	2010-08-13 12:54:58 UTC (rev 18617)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss	2010-08-13 13:44:52 UTC (rev 18618)
@@ -151,5 +151,5 @@
 }
 
 .rf-ii-none {
-	display: none;
-}
\ No newline at end of file
+	clip:rect(0px,0px,0px,0px);
+}

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	2010-08-13 12:54:58 UTC (rev 18617)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js	2010-08-13 13:44:52 UTC (rev 18618)
@@ -18,12 +18,13 @@
             richfaces.Event.bind(this.element, this.editEvent, this.edit, this);
             richfaces.Event.bind(this.input, "change", this.save, this);
             richfaces.Event.bind(this.input, "blur", this.save, this);
-            
+            richfaces.Event.bind(this.input, "focus", this.edit, this);
+
             if(this.showControls) {
             	this.okbtn = $(document.getElementById(options.okbtn));
             	this.cancelbtn = $(document.getElementById(options.cancelbtn));
-            	richfaces.Event.bind(this.okbtn, "mousedown", this.saveBtnHandler, this);
-            	richfaces.Event.bind(this.cancelbtn, "mousedown", this.cancelBtnHandler, this);
+            	richfaces.Event.bind(this.okbtn, "mousedown", this.__saveBtnHandler, this);
+            	richfaces.Event.bind(this.cancelbtn, "mousedown", this.__cancelBtnHandler, this);
             }
         };
         
@@ -37,7 +38,7 @@
            	return {
            		name : "RichFaces.ui.InplaceInput",
 
-/******************    public methods  *****************************************/
+/******************  public methods  *****************************************/
            		
            		edit: function() {
            			this.editContainer.removeClass(this.noneCss);
@@ -55,8 +56,10 @@
            			} else {
            				this.element.removeClass(this.changedCss);
            			}
-
-           			this.editContainer.addClass(this.noneCss);
+           			
+           			if(!this.showControls) {
+           				this.editContainer.addClass(this.noneCss);
+           			}
            		}, 
            		
            		cancel: function() {
@@ -73,12 +76,16 @@
            		getValue: function() {
            			return this.input.val();
            		}, 
-           		
-           		saveBtnHandler: function() {
-           			this.save(); return false;
+
+/******************  private methods  *****************************************/
+
+           		__saveBtnHandler: function() {
+           			this.save();
+           			this.editContainer.addClass(this.noneCss);
+           			return false;
            		}, 
            		
-           		cancelBtnHandler: function() {
+           		__cancelBtnHandler: function() {
            			this.cancel(); return false;
            		}
            	}



More information about the richfaces-svn-commits mailing list