[richfaces-svn-commits] JBoss Rich Faces SVN: r6054 - in trunk/sandbox/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Feb 13 08:30:06 EST 2008


Author: vmolotkov
Date: 2008-02-13 08:30:05 -0500 (Wed, 13 Feb 2008)
New Revision: 6054

Modified:
   trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
   trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
   trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
rendering of controls facet

Modified: trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2008-02-13 13:16:26 UTC (rev 6053)
+++ trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2008-02-13 13:30:05 UTC (rev 6054)
@@ -1,5 +1,6 @@
 package org.richfaces.renderkit;
 
+import java.io.IOException;
 import java.util.Map;
 
 import javax.faces.component.UIComponent;
@@ -25,6 +26,8 @@
 public class InplaceInputBaseRenderer extends HeaderResourcesRendererBase {
 	
     private static Log logger = LogFactory.getLog(InplaceInputBaseRenderer.class);
+    
+    private static final String CONTROLS_FACET = "controls";
     		
     	
     protected Class<UIInplaceInput>  getComponentClass() {
@@ -65,6 +68,22 @@
 	}
     }
     
+    public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
+	UIComponent facet = component.getFacet(CONTROLS_FACET);
+	if ((facet != null) && (facet.isRendered())) {
+	    renderChild(context, facet);
+	}
+    }
+    
+    public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
+	UIComponent facet = component.getFacet(CONTROLS_FACET);
+	if (facet != null) {
+	    return true;
+	}
+	return false;
+    }
+
+    
     public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
 	String event = (String) component.getAttributes().get(attributeName);
 	ScriptString result = JSReference.NULL;

Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js	2008-02-13 13:16:26 UTC (rev 6053)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js	2008-02-13 13:30:05 UTC (rev 6054)
@@ -6,6 +6,8 @@
 	
 	initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams) {
 		this.inplaceInput = $(clientId);
+		this.inplaceInput.component = this;
+		
 		this.tempValueKeeper = $(temValueKeepId);
 		this.valueKeeper = $(valueKeepId);
 		this.attributes = attributes;
@@ -45,7 +47,7 @@
 		this.tabber.observe("focus", function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
 		this.tabber.observe("blur", function(e){this.tmpValueBlurHandler(e);}.bindAsEventListener(this));
 		
-		this.bar.bsPanel.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
+		this.bar.bar.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
 	},
 	
 	initEvents : function() {
@@ -303,7 +305,7 @@
 	
 	positioning : function(inpWidth, inpHeight) {
 		this.bar.style.position = "absolute";
-		this.bsPanel.style.position = "relative";
+		//this.bsPanel.style.position = "relative";
 		var bs = this.bar.style;
 		switch (this.position) {
 			case "top" : 

Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx	2008-02-13 13:16:26 UTC (rev 6053)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx	2008-02-13 13:30:05 UTC (rev 6054)
@@ -50,6 +50,13 @@
 			   value='#{fieldValue}'/>
 		<input id='#{clientId}value' name='#{clientId}value' type='hidden' value='#{fieldValue}'/>
 		<div id="#{clientId}bar" class="is_btn_set" style="display:none;">
+			<jsp:scriptlet>
+				<![CDATA[
+				 if (isControlsFacetExists(context, component)) {
+				     encodeControlsFacet(context, component);
+				 } else {
+				]]>
+			</jsp:scriptlet>
 			<div class="rich-inplace-shadow">
 				<table class="rich-inplace-shadow-size" cellspacing="0" cellpadding="0" border="0">
 					<tbody>
@@ -72,7 +79,7 @@
 					</tbody>
 				</table>
 			</div>
-			<div id="#{clientId}buttons">
+			<div id="#{clientId}buttons" style="position:relative;">
 				<input id="#{clientId}ok" class="rich-inplace-control" type="image" onmouseup="this.className='rich-inplace-control'" 
 					   onmouseout="this.className='rich-inplace-control'" onmousedown="this.className='rich-inplace-control-press'" 
 					   src="#{ok_icon}"/>
@@ -80,6 +87,11 @@
 					   onmouseout="this.className='rich-inplace-control'" onmousedown="this.className='rich-inplace-control-press'" 
 					   src="#{cancel_icon}"/>
 			</div>
+			<jsp:scriptlet>
+				<![CDATA[
+				 }
+				 ]]>
+			</jsp:scriptlet>
 		</div>
 		#{value}
 	</span>




More information about the richfaces-svn-commits mailing list