JBoss Rich Faces SVN: r6036 - trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-12 12:12:22 -0500 (Tue, 12 Feb 2008)
New Revision: 6036
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
state changing is corrected
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-12 16:57:17 UTC (rev 6035)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-12 17:12:22 UTC (rev 6036)
@@ -14,6 +14,7 @@
this.classes = classes;
this.currentText = this.getCurrentText();
+ this.value = this.valueKeeper.value;
this.currentState = Richfaces.InplaceInput.STATES[0];
this.prevState = Richfaces.InplaceInput.STATES[0];
@@ -214,11 +215,13 @@
this.setDefaultText();
this.valueKeeper.value = "";
this.startViewState();
- } else if (userValue != value) {
+ } else if (userValue != this.value) {
this.currentText = userValue;
this.valueKeeper.value = userValue;
this.startChangedState();
} else {
+ this.currentText = userValue;
+ this.valueKeeper.value = userValue;
this.startViewState();
}
if (this.events.onviewactivated) {
18 years, 2 months
JBoss Rich Faces SVN: r6035 - trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-12 11:57:17 -0500 (Tue, 12 Feb 2008)
New Revision: 6035
Modified:
trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
Log:
decode method
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-12 16:56:49 UTC (rev 6034)
+++ trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-02-12 16:57:17 UTC (rev 6035)
@@ -1,5 +1,7 @@
package org.richfaces.renderkit;
+import java.util.Map;
+
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@@ -9,6 +11,7 @@
import org.ajax4jsf.javascript.ScriptString;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.util.InputUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.UIInplaceInput;
@@ -28,6 +31,40 @@
return UIInplaceInput.class;
}
+ protected void doDecode(FacesContext context, UIComponent component) {
+ UIInplaceInput inplaceInput = null;
+
+ if (component instanceof UIInplaceInput) {
+ inplaceInput = (UIInplaceInput) component;
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No decoding necessary since the component "
+ + component.getId() +
+ " is not an instance or a sub class of UIComboBox");
+ }
+ return;
+ }
+
+ if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(("No decoding necessary since the component "
+ + component.getId() + " is disabled"));
+ }
+ }
+
+ String clientId = component.getClientId(context);
+ if (clientId == null) {
+ throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL" );
+ }
+
+ clientId = clientId + "value";
+ Map request = context.getExternalContext().getRequestParameterMap();
+ if (request.containsKey(clientId)) {
+ String newValue = (String)request.get(clientId);
+ inplaceInput.setSubmittedValue(newValue);
+ }
+ }
+
public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
String event = (String) component.getAttributes().get(attributeName);
ScriptString result = JSReference.NULL;
18 years, 2 months
JBoss Rich Faces SVN: r6034 - in trunk/sandbox/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/css and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-12 11:56:49 -0500 (Tue, 12 Feb 2008)
New Revision: 6034
Modified:
trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
ok and cancel functionality
Modified: trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-12 16:37:48 UTC (rev 6033)
+++ trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-12 16:56:49 UTC (rev 6034)
@@ -32,22 +32,28 @@
<name>value</name>
<classname>java.lang.String</classname>
</property>
- <property>
- <name>inputSize</name>
- <classname>java.lang.Integer</classname>
- <defaultvalue>10</defaultvalue>
- </property>
<property>
<name>inputMaxLength</name>
<classname>java.lang.Integer</classname>
- <defaultvalue>10</defaultvalue>
+ <defaultvalue>255</defaultvalue>
</property>
+
<property>
- <name>inputMinLength</name>
- <classname>java.lang.Integer</classname>
- <defaultvalue>10</defaultvalue>
+ <name>inputMaxWidth</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA["150px"]]></defaultvalue>
</property>
<property>
+ <name>inputMinWidth</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA["70px"]]></defaultvalue>
+ </property>
+ <property>
+ <name>inputWidth</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
<name>defaultLabel</name>
<classname>java.lang.String</classname>
<defaultvalue><![CDATA["Click..."]]></defaultvalue>
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 16:37:48 UTC (rev 6033)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 16:56:49 UTC (rev 6034)
@@ -28,7 +28,6 @@
.rich-inplace-edit {
position:relative;
- width:100px;
}
.rich-inplace-field {
@@ -39,7 +38,6 @@
position:absolute;*/
margin:0px;
padding:0px 0px 0px 3px;
- width:100px;
}
.rich-inplace-control {
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-12 16:37:48 UTC (rev 6033)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-12 16:56:49 UTC (rev 6034)
@@ -18,11 +18,9 @@
this.currentState = Richfaces.InplaceInput.STATES[0];
this.prevState = Richfaces.InplaceInput.STATES[0];
- this.initDimensions();
if (this.attributes.showControls) {
this.bar = new Richfaces.InplaceInputBar(barParams[0], barParams[1], barParams[2], barParams[3],
- this.attributes.controlsPosition,
- {width: this.INPUT_WIDTH, height: this.INPUT_HEIGHT});
+ this.attributes.controlsPosition);
}
this.initHandlers();
this.initEvents();
@@ -32,11 +30,14 @@
this.inplaceInput.observe(this.attributes.editEvent, function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
this.tempValueKeeper.observe("blur", function(e){this.tmpValueBlurHandler(e);}.bindAsEventListener(this));
- this.bar.ok.observe("click", function(e){this.okHandler(e);}.bindAsEventListener(this));
- this.bar.cancel.observe("click", function(e){this.cancelHandler(e)}.bindAsEventListener(this));
+ if (this.bar.ok) {
+ this.bar.ok.observe("click", function(e){this.okHandler(e);}.bindAsEventListener(this));
+ }
+ if (this.bar.cancel) {
+ this.bar.cancel.observe("click", function(e){this.cancelHandler(e)}.bindAsEventListener(this));
+ }
- this.bar.ok.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
- this.bar.cancel.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
+ this.bar.bsPanel.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
},
initEvents : function() {
@@ -47,7 +48,7 @@
}
},
- initDimensions : function() {
+ /*initDimensions : function() {
this.valueKeeper.style.visibility = "hidden";
this.valueKeeper.show();
@@ -57,7 +58,7 @@
this.valueKeeper.hide();
this.valueKeeper.style.visibility = "visible";
- },
+ },*/
/*
* HANDLERS
@@ -78,8 +79,10 @@
if (this.events.oneditactivation) {
this.inplaceInput.fire("rich:oneditactivation", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
+ var textSize = this.inplaceInput.offsetWidth;
+
this.endViewState();
- this.startEditableState();
+ this.startEditableState(textSize);
if (this.events.oneditactivated) {
this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
@@ -128,14 +131,17 @@
this.deleteViewArtifacts();
},
- startEditableState : function() {
+ startEditableState : function(textSize) {
this.changeState(Richfaces.InplaceInput.STATES[1]);
+ var inputSize = this.setInputWidth(textSize);
+ this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
+ this.tempValueKeeper.show();
+
if (this.bar) {
- this.bar.show();
+ this.bar.show(inputSize, this.tempValueKeeper.offsetHeight);
}
- this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
- this.tempValueKeeper.show();
+
this.tempValueKeeper.focus();
if (this.attributes.selectOnEdit) {
Richfaces.InplaceInput.textboxSelect(this.tempValueKeeper, 0, this.tempValueKeeper.value.length);
@@ -160,6 +166,23 @@
* UTILITIES
*/
+ setInputWidth : function(textSize) {
+ var width = parseInt(this.attributes.inputWidth);
+ if (!width) {
+ var max = parseInt(this.attributes.inputMaxWidth);
+ var min = parseInt(this.attributes.inputMinWidth);
+ if (textSize > max) {
+ width = max;
+ } else if (textSize < min) {
+ width = min;
+ } else {
+ width = textSize;
+ }
+ }
+ this.tempValueKeeper.style.width = width + "px";
+ return width;
+ },
+
changeState : function(newState) {
this.prevState = this.currentState;
this.currentState = newState;
@@ -228,7 +251,7 @@
Richfaces.InplaceInputBar = Class.create();
Richfaces.InplaceInputBar.prototype = {
- initialize : function(barId, okId, cancelId, buttonsPanelId, position, intDims) {
+ initialize : function(barId, okId, cancelId, buttonsPanelId, position) {
this.bar = $(barId);
this.ok = $(okId);
this.cancel = $(cancelId);
@@ -236,7 +259,6 @@
this.position = position;
this.initDimensions();
- this.positioning(intDims);
},
initDimensions : function() {
@@ -252,7 +274,8 @@
this.bar.style.visibility = "visible";*/
},
- show : function() {
+ show : function(inpWidth, inpHeight) {
+ this.positioning(inpWidth, inpHeight);
this.bar.show();
},
@@ -260,7 +283,7 @@
this.bar.hide();
},
- positioning : function(intDims) {
+ positioning : function(inpWidth, inpHeight) {
this.bar.style.position = "absolute";
this.bsPanel.style.position = "relative";
var bs = this.bar.style;
@@ -270,7 +293,7 @@
bs.left = "0px";
break;
case "bottom" :
- bs.top = intDims.height + "px";
+ bs.top = inpHeight + "px";
bs.left = "0px";
break;
case "left" :
@@ -279,10 +302,11 @@
break;
case "right" :
bs.top = "0px";
- bs.left = intDims.width + "px";
+ bs.left = inpWidth + "px";
break;
}
}
+
};
Richfaces.InplaceInput.STATES = [0, 1, 2];// 0 - view, 1- editable, 2 - changed
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 16:37:48 UTC (rev 6033)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 16:56:49 UTC (rev 6034)
@@ -44,12 +44,10 @@
class='rich-inplace-field'
style='display:none;'
type='text'
- size='#{component.attributes["inputSize"]}'
maxlength='#{component.attributes["inputMaxLength"]}'
- minlength='#{component.attributes["inputMinLength"]}'
autocomplete="off"
value='#{fieldValue}'/>
- <input id='#{clientId}value' type='hidden' value='#{fieldValue}'/>
+ <input id='#{clientId}value' name='#{clientId}value' type='hidden' value='#{fieldValue}'/>
<div id="#{clientId}bar" class="is_btn_set" style="display:none;">
<div class="rich-inplace-shadow">
@@ -91,7 +89,11 @@
apllyFromControlsOnly : #{component.attributes["apllyFromControlsOnly"]},
editEvent : '#{component.attributes["editEvent"]}',
selectOnEdit : #{component.attributes["selectOnEdit"]},
- controlsPosition : '#{component.attributes["controlsPosition"]}'};
+ controlsPosition : '#{component.attributes["controlsPosition"]}',
+ inputWidth : '#{component.attributes["inputWidth"]}',
+ inputMinWidth : '#{component.attributes["inputMinWidth"]}',
+ inputMaxWidth : '#{component.attributes["inputMaxWidth"]}'
+ };
var events = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
18 years, 2 months
JBoss Rich Faces SVN: r6033 - trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-12 11:37:48 -0500 (Tue, 12 Feb 2008)
New Revision: 6033
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
Log:
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 16:33:40 UTC (rev 6032)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 16:37:48 UTC (rev 6033)
@@ -58,12 +58,12 @@
.rich-inplace-shadow {
top:-7px;
- left:-5px;
+ left:-4px;
position : absolute;
}
.rich-inplace-shadow-size {
- width : 36px; height : 26px;
+ width : 34px; height : 25px;
}
.rich-inplace-shadow-tl {
18 years, 2 months
JBoss Rich Faces SVN: r6032 - trunk/ui/orderingList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-02-12 11:33:40 -0500 (Tue, 12 Feb 2008)
New Revision: 6032
Modified:
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-2164
fixed bundle search behavior, corrected bundle properties names according to RF-2164
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2008-02-12 16:33:40 UTC (rev 6032)
@@ -75,7 +75,7 @@
public final static String DISABLED_STYLE_PREF = "-disabled";
protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new OrderingComponentRendererBase.ControlsHelper[] {
- new OrderingComponentRendererBase.ControlsHelper("top", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
+ new OrderingComponentRendererBase.ControlsHelper("top", "RICH_ORDERING_LIST_TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
"-top", ATTRIBUTE_CLASS_TOP_CONTROL, "",
CONTROL_ID_TOP, ATTRIBUTE_CE_ONTOPCLICK, true, "top".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -84,7 +84,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("disabledTop", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(), FACET_DIS_TOP,
+ new OrderingComponentRendererBase.ControlsHelper("disabledTop", "RICH_ORDERING_LIST_TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(), FACET_DIS_TOP,
"-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_TOP), null, false, "top".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -93,7 +93,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("up", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
+ new OrderingComponentRendererBase.ControlsHelper("up", "RICH_ORDERING_LIST_UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
"-up", ATTRIBUTE_CLASS_UP_CONTROL, "",
CONTROL_ID_UP, ATTRIBUTE_CE_ONUPCLICK ,true, "up".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -102,7 +102,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("disabledUp", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(), FACET_DIS_UP,
+ new OrderingComponentRendererBase.ControlsHelper("disabledUp", "RICH_ORDERING_LIST_UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(), FACET_DIS_UP,
"-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_UP), null, false, "up".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -111,7 +111,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("down", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(), FACET_DOWN,
+ new OrderingComponentRendererBase.ControlsHelper("down", "RICH_ORDERING_LIST_DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(), FACET_DOWN,
"-down", ATTRIBUTE_CLASS_DOWN_CONTROL, "",
CONTROL_ID_DOWN, ATTRIBUTE_CE_ONDOWNCLICK, true, "down".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -120,7 +120,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("disabledDown", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(), FACET_DIS_DOWN,
+ new OrderingComponentRendererBase.ControlsHelper("disabledDown", "RICH_ORDERING_LIST_DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(), FACET_DIS_DOWN,
"-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_DOWN), null, false, "down".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -129,7 +129,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("bottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(), FACET_BOTTOM,
+ new OrderingComponentRendererBase.ControlsHelper("bottom", "RICH_ORDERING_LIST_BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(), FACET_BOTTOM,
"-bottom", ATTRIBUTE_CLASS_BOTTOM_CONTROL, "",
CONTROL_ID_BOTTOM, ATTRIBUTE_CE_ONBOTTOMCLICK, true, "bottom".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
@@ -138,7 +138,7 @@
}
},
- new OrderingComponentRendererBase.ControlsHelper("disabledBottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
+ new OrderingComponentRendererBase.ControlsHelper("disabledBottom", "RICH_ORDERING_LIST_BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
"-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_BOTTOM), null, false, "bottom".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-02-12 16:33:40 UTC (rev 6032)
@@ -31,9 +31,10 @@
/**
* @author Nick Belaevski
- *
+ *
*/
-public abstract class OrderingComponentRendererBase extends AbstractRowsRenderer {
+public abstract class OrderingComponentRendererBase extends
+ AbstractRowsRenderer {
private static final Converter DEFAULT_CONVERTER = new Converter() {
@@ -48,30 +49,30 @@
if (value instanceof String) {
return (String) value;
}
-
+
if (null == value) {
return "";
}
-
+
return value.toString();
}
};
-
+
private static final String ITEM_STATE_VAR_NAME = "itemState";
protected final static String SHOW_LABELS_ATTRIBUTE_NAME = "showButtonLabels";
-
+
protected final static String ATTRIBUTE_CE_ONHEADERCLICK = "onheaderclick";
-
+
protected final static String CONTROL_TYPE_LINK = "link";
-
+
protected final static String CONTROL_TYPE_BUTTON = "button";
-
+
protected final static String CONTROL_TYPE_NONE = "none";
-
+
protected final static String ATTRIBUTE_CONTROLS_TYPE = "controlsType";
-
+
protected static abstract class ControlsHelper {
private String name;
@@ -97,11 +98,14 @@
private String labelAttributeName;
- public abstract boolean isRendered(FacesContext context, UIOrderingBaseComponent list);
+ public abstract boolean isRendered(FacesContext context,
+ UIOrderingBaseComponent list);
- public ControlsHelper(String name, String bundlePropertyName, String defaultText, String imageURI,
- String facetName, String styleClassName, String styleFromAttribute, String buttonStyleClass,
- String idSuffix, String customEvent, boolean isEnable, String labelAttributeName) {
+ public ControlsHelper(String name, String bundlePropertyName,
+ String defaultText, String imageURI, String facetName,
+ String styleClassName, String styleFromAttribute,
+ String buttonStyleClass, String idSuffix, String customEvent,
+ boolean isEnable, String labelAttributeName) {
super();
this.name = name;
this.bundlePropertyName = bundlePropertyName;
@@ -111,7 +115,7 @@
this.styleClassName = styleClassName;
this.styleFromAttribute = styleFromAttribute;
this.idSuffix = idSuffix;
- this.customEvent = customEvent;
+ this.customEvent = customEvent;
this.buttonStyleClass = buttonStyleClass;
this.enable = isEnable;
this.labelAttributeName = labelAttributeName;
@@ -167,23 +171,23 @@
}
protected static final class SelectionState {
-
+
private boolean firstSelected = false;
private boolean firstSelectedLatch = false;
-
+
private boolean selectedLatch = false;
private boolean itemsExist = false;
private boolean lastSelected = false;
-
+
public SelectionState() {
super();
}
-
+
public void addState(boolean selected) {
itemsExist = true;
-
+
if (!firstSelectedLatch) {
firstSelected = selected;
firstSelectedLatch = true;
@@ -192,14 +196,14 @@
if (selected) {
selectedLatch = true;
}
-
+
lastSelected = selected;
}
-
+
public boolean isFirstSelected() {
return firstSelected;
}
-
+
public boolean isSelected() {
return selectedLatch;
}
@@ -207,31 +211,35 @@
public boolean isItemExist() {
return itemsExist;
}
-
+
public boolean isLastSelected() {
return lastSelected;
}
}
private final String bundleName;
-
+
public OrderingComponentRendererBase(String bundleName) {
super();
-
+
this.bundleName = bundleName;
}
-
- public void encodeCaption(FacesContext context, UIComponent component) throws IOException {
- encodeCaption(context, component, OrderingComponentControlsHelper.FACET_CAPTION,
- "rich-ordering-list-caption");
+
+ public void encodeCaption(FacesContext context, UIComponent component)
+ throws IOException {
+ encodeCaption(context, component,
+ OrderingComponentControlsHelper.FACET_CAPTION,
+ "rich-ordering-list-caption");
}
-
- protected void encodeCaption(FacesContext context, UIComponent component,
- String facetCaption, String captionStyle, String attributeName) throws IOException{
+
+ protected void encodeCaption(FacesContext context, UIComponent component,
+ String facetCaption, String captionStyle, String attributeName)
+ throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent facetEl = component.getFacet(facetCaption);
boolean renderFacet = ((facetEl != null) && facetEl.isRendered());
- String captionAttr = (String) component.getAttributes().get(attributeName);
+ String captionAttr = (String) component.getAttributes().get(
+ attributeName);
if (renderFacet || (captionAttr != null)) {
writer.startElement(HTML.DIV_ELEM, component);
@@ -244,42 +252,49 @@
writer.endElement(HTML.DIV_ELEM);
}
}
-
- protected void encodeCaption(FacesContext context, UIComponent component, String facetCaption, String captionStyle)
- throws IOException {
- encodeCaption(context, component, facetCaption, captionStyle, OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
+
+ protected void encodeCaption(FacesContext context, UIComponent component,
+ String facetCaption, String captionStyle) throws IOException {
+ encodeCaption(context, component, facetCaption, captionStyle,
+ OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
}
- public void encodeHeader(FacesContext context, UIOrderingBaseComponent component)
- throws IOException {
- encodeHeader(context, component, "rich-ordering-list-table-header", "rich-ordering-list-table-header-cell", "headerClass");
+ public void encodeHeader(FacesContext context,
+ UIOrderingBaseComponent component) throws IOException {
+ encodeHeader(context, component, "rich-ordering-list-table-header",
+ "rich-ordering-list-table-header-cell", "headerClass");
}
-
- protected void encodeHeader(FacesContext context, UIOrderingBaseComponent component, String rowClass,
- String cellClass, String headerClassAttr) throws IOException {
+
+ protected void encodeHeader(FacesContext context,
+ UIOrderingBaseComponent component, String rowClass,
+ String cellClass, String headerClassAttr) throws IOException {
ResponseWriter writer = context.getResponseWriter();
- //UIComponent header = orderingList.getHeader();
+ // UIComponent header = orderingList.getHeader();
Iterator headers = component.columns();
if (headers.hasNext()) {
writer.startElement("thead", component);
- String headerClass = (String) component.getAttributes().get(headerClassAttr);
+ String headerClass = (String) component.getAttributes().get(
+ headerClassAttr);
writer.startElement("tr", component);
encodeStyleClass(writer, null, rowClass, null, headerClass);
- encodeHeaderFacets(context, writer, headers, cellClass, headerClass, "header", "th", component);
+ encodeHeaderFacets(context, writer, headers, cellClass,
+ headerClass, "header", "th", component);
writer.endElement("tr");
-
+
writer.endElement("thead");
}
}
protected void renderDefaultControl(FacesContext context,
UIOrderingBaseComponent orderingList, ResponseWriter writer,
- boolean useFacet, OrderingComponentRendererBase.ControlsHelper helper, String clientId, ResourceBundle bundle,
- boolean enabled, String baseStyle, String baseControlStyle)
- throws IOException {
+ boolean useFacet,
+ OrderingComponentRendererBase.ControlsHelper helper,
+ String clientId, ResourceBundle bundleExternal,
+ ResourceBundle bundleApplication, boolean enabled,
+ String baseStyle, String baseControlStyle) throws IOException {
UIComponent facet = orderingList.getFacet(helper.getFacetName());
String customEvent = null;
Map attributes = orderingList.getAttributes();
@@ -300,7 +315,7 @@
writer.startElement(HTML.DIV_ELEM, orderingList);
String controlId = clientId + helper.getIdSuffix();
- writer.writeAttribute(HTML.id_ATTRIBUTE, controlId, null); //FIXME:
+ writer.writeAttribute(HTML.id_ATTRIBUTE, controlId, null); // FIXME:
writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
String style = null;
if (enabled) {
@@ -310,39 +325,51 @@
}
writer.writeAttribute(HTML.style_ATTRIBUTE, style, null);
if (!useFacet) {
-
+
writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + helper.getButtonStyleClass(), null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+ + helper.getButtonStyleClass(), null);
if (helper.enable) {
- writer.writeAttribute(HTML.onmouseover_ATTRIBUTE, "this.className='" + baseStyleLight + "'", null);
- writer.writeAttribute(HTML.onmousedown_ATTRIBUTE, "this.className='" + baseStylePress + "'", null);
- writer.writeAttribute(HTML.onmouseup_ATTRIBUTE, "this.className='" + baseStyle + "'", null);
- writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='" + baseStyle + "'", null);
+ writer.writeAttribute(HTML.onmouseover_ATTRIBUTE,
+ "this.className='" + baseStyleLight + "'", null);
+ writer.writeAttribute(HTML.onmousedown_ATTRIBUTE,
+ "this.className='" + baseStylePress + "'", null);
+ writer.writeAttribute(HTML.onmouseup_ATTRIBUTE,
+ "this.className='" + baseStyle + "'", null);
+ writer.writeAttribute(HTML.onmouseout_ATTRIBUTE,
+ "this.className='" + baseStyle + "'", null);
}
-
+
writer.startElement(HTML.a_ELEMENT, orderingList);
- writer.writeAttribute(HTML.id_ATTRIBUTE, controlId + "link", null); //FIXME:
+ writer.writeAttribute(HTML.id_ATTRIBUTE, controlId + "link", null); // FIXME:
writer.writeAttribute(HTML.HREF_ATTR, "#", null);
- writer.writeAttribute(HTML.onclick_ATTRIBUTE, "return false;", null);
+ writer
+ .writeAttribute(HTML.onclick_ATTRIBUTE, "return false;",
+ null);
if (!helper.enable) {
writer.writeAttribute(HTML.DISABLED_ATTR, "disabled", null);
- writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-a-disabled", null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+ + "-a-disabled", null);
writer.startElement(HTML.a_ELEMENT, orderingList);
} else {
- writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-selection", null);
- writer.writeAttribute(HTML.onblur_ATTRIBUTE, "Control.onblur(this);", null);
- writer.writeAttribute(HTML.onfocus_ATTRIBUTE, "Control.onfocus(this);", null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+ + "-selection", null);
+ writer.writeAttribute(HTML.onblur_ATTRIBUTE,
+ "Control.onblur(this);", null);
+ writer.writeAttribute(HTML.onfocus_ATTRIBUTE,
+ "Control.onfocus(this);", null);
}
-
+
writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content", null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content",
+ null);
}
if (customEvent != null) {
- writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent,null);
+ writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent, null);
}
-
+
if (useFacet) {
renderChild(context, facet);
} else {
@@ -357,21 +384,43 @@
writer.endElement(HTML.IMG_ELEMENT);
- if (getUtils().isBooleanAttribute(orderingList, SHOW_LABELS_ATTRIBUTE_NAME)) {
- String label = (String) attributes.get(helper.getLabelAttributeName());
-
- if (label == null && bundle != null) {
- try {
- label = bundle.getString(helper.getBundlePropertyName());
- } catch (MissingResourceException e) {
-
+ if (getUtils().isBooleanAttribute(orderingList,
+ SHOW_LABELS_ATTRIBUTE_NAME)) {
+ String label = (String) attributes.get(helper
+ .getLabelAttributeName());
+
+ if (label == null) {
+ if (null != bundleApplication) {
+ try {
+ label = bundleApplication.getString(helper
+ .getBundlePropertyName());
+ } catch (MissingResourceException e) {
+ try {
+ if (null != bundleExternal) {
+ label = bundleExternal.getString(helper
+ .getBundlePropertyName());
+ }
+ } catch (MissingResourceException exc) {
+ // Key wasn't found, ignore this.
+ }
+ }
+
+ } else if (null != bundleExternal) {
+ try {
+ label = bundleExternal.getString(helper
+ .getBundlePropertyName());
+ } catch (MissingResourceException exc) {
+ // Key wasn't found, ignore this.
+ }
+
}
+
}
if (label == null) {
label = helper.getDefaultText();
}
-
+
writer.writeText(label, null);
}
}
@@ -379,7 +428,7 @@
// helper.getIdSuffix(), null);
// writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
-
+
if (!useFacet) {
writer.endElement(HTML.DIV_ELEM);
if (!helper.enable) {
@@ -390,8 +439,9 @@
}
writer.endElement(HTML.DIV_ELEM);
}
-
- protected boolean isHeaderExists(FacesContext context, UIOrderingBaseComponent component, String facetName) {
+
+ protected boolean isHeaderExists(FacesContext context,
+ UIOrderingBaseComponent component, String facetName) {
Iterator headers = component.columns();
while (headers.hasNext()) {
UIComponent column = (UIComponent) headers.next();
@@ -402,64 +452,77 @@
}
return false;
}
-
- protected void encodeHeaderFacets(FacesContext context, ResponseWriter writer,
- Iterator headers, String skinCellClass,
- String headerClass, String facetName, String element, UIOrderingBaseComponent orderingList
- )
- throws IOException {
+
+ protected void encodeHeaderFacets(FacesContext context,
+ ResponseWriter writer, Iterator headers, String skinCellClass,
+ String headerClass, String facetName, String element,
+ UIOrderingBaseComponent orderingList) throws IOException {
while (headers.hasNext()) {
UIComponent column = (UIComponent) headers.next();
String classAttribute = facetName + "Class";
- String columnHeaderClass = (String) column.getAttributes().get(classAttribute);
-
+ String columnHeaderClass = (String) column.getAttributes().get(
+ classAttribute);
+
writer.startElement(element, column);
if (!headers.hasNext()) {
skinCellClass = skinCellClass + "-last";
}
- encodeStyleClass(writer, null, skinCellClass, headerClass, columnHeaderClass);
+ encodeStyleClass(writer, null, skinCellClass, headerClass,
+ columnHeaderClass);
getUtils().encodeAttribute(context, column, "colspan");
writer.startElement("div", column);
- writer.writeAttribute("style", "overflow:hidden;white-space: nowrap;", null);
- String onHeaderClickEvent = (String) orderingList.getAttributes().get(ATTRIBUTE_CE_ONHEADERCLICK);
+ writer.writeAttribute("style",
+ "overflow:hidden;white-space: nowrap;", null);
+ String onHeaderClickEvent = (String) orderingList.getAttributes()
+ .get(ATTRIBUTE_CE_ONHEADERCLICK);
if (onHeaderClickEvent != null) {
- writer.writeAttribute(HTML.onclick_ATTRIBUTE, onHeaderClickEvent, null);
+ writer.writeAttribute(HTML.onclick_ATTRIBUTE,
+ onHeaderClickEvent, null);
}
-
+
UIComponent facet = column.getFacet(facetName);
if (facet != null && facet.isRendered()) {
renderChild(context, facet);
} else {
writer.write(" ");
}
-
+
writer.endElement("div");
writer.endElement(element);
}
}
protected void encodeControlFacet(FacesContext context,
- UIOrderingBaseComponent orderingList, OrderingComponentRendererBase.ControlsHelper helper,
- String clientId, ResponseWriter writer, boolean enabled, String baseStyle,
- String baseControlStyle) throws IOException {
+ UIOrderingBaseComponent orderingList,
+ OrderingComponentRendererBase.ControlsHelper helper,
+ String clientId, ResponseWriter writer, boolean enabled,
+ String baseStyle, String baseControlStyle) throws IOException {
Locale locale = null;
-
+
UIViewRoot viewRoot = context.getViewRoot();
if (viewRoot != null) {
locale = viewRoot.getLocale();
}
-
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- ResourceBundle bundle = null;
-
+
+ ClassLoader contextClassLoader = Thread.currentThread()
+ .getContextClassLoader();
+ ResourceBundle bundleExternal = null;
+ ResourceBundle bundleApplication = null;
+ String messageBundle = context.getApplication().getMessageBundle();
if (locale != null) {
+ if (null != messageBundle) {
+ bundleApplication = ResourceBundle.getBundle(messageBundle,
+ locale, contextClassLoader);
+ }
+
try {
- bundle = ResourceBundle.getBundle(bundleName, locale, contextClassLoader);
+ bundleExternal = ResourceBundle.getBundle(bundleName, locale,
+ contextClassLoader);
} catch (MissingResourceException e) {
-
+ // No external bundle was found, ignore this exception.
}
}
-
+
Map attributes = orderingList.getAttributes();
UIComponent facet = orderingList.getFacet(helper.getFacetName());
boolean useFacet = (facet != null && facet.isRendered());
@@ -471,56 +534,64 @@
}
} else {
renderDefaultControl(context, orderingList, writer, useFacet,
- helper, clientId, bundle ,enabled, baseStyle, baseControlStyle);
+ helper, clientId, bundleExternal, bundleApplication,
+ enabled, baseStyle, baseControlStyle);
}
}
-
+
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
UIOrderingBaseComponent orderingComponent = (UIOrderingBaseComponent) component;
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- variables.setVariable(ITEM_STATE_VAR_NAME, orderingComponent.getItemState());
-
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ variables.setVariable(ITEM_STATE_VAR_NAME, orderingComponent
+ .getItemState());
+
super.encodeBegin(context, component);
}
-
- protected ItemState getItemState(FacesContext context, UIComponent component, ComponentVariables variables)
+
+ protected ItemState getItemState(FacesContext context,
+ UIComponent component, ComponentVariables variables)
throws IOException {
return (ItemState) variables.getVariable(ITEM_STATE_VAR_NAME);
}
- protected Converter getConverter(FacesContext context, UIOrderingBaseComponent component) {
+ protected Converter getConverter(FacesContext context,
+ UIOrderingBaseComponent component) {
Converter converter = component.getConverter();
if (converter == null) {
converter = component.getConverterForValue(context);
}
-
+
if (converter == null) {
converter = DEFAULT_CONVERTER;
}
-
+
return converter;
}
-
+
public String getCaptionDisplay(FacesContext context, UIComponent component) {
- Object caption = component.getAttributes().get(OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
- UIComponent facet = component.getFacet(OrderingComponentControlsHelper.FACET_CAPTION);
-
- if ((null != caption && !"".equals(caption)) ||
- (null != facet && facet.isRendered())) {
+ Object caption = component.getAttributes().get(
+ OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
+ UIComponent facet = component
+ .getFacet(OrderingComponentControlsHelper.FACET_CAPTION);
+
+ if ((null != caption && !"".equals(caption))
+ || (null != facet && facet.isRendered())) {
return "";
}
return "display: none;";
}
-
- public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
+
+ public String getAsEventHandler(FacesContext context,
+ UIComponent component, String attributeName) {
String event = (String) component.getAttributes().get(attributeName);
ScriptString result = JSReference.NULL;
-
+
if (event != null) {
event = event.trim();
-
+
if (event.length() != 0) {
JSFunctionDefinition function = new JSFunctionDefinition();
function.addParameter("event");
@@ -532,18 +603,24 @@
return ScriptUtils.toScript(result);
}
-
- public String getColumnClassesAsJSArray(FacesContext context, UIComponent component) {
- return ScriptUtils.toScript(getClassesAsList(context, component, "columnClasses"));
+
+ public String getColumnClassesAsJSArray(FacesContext context,
+ UIComponent component) {
+ return ScriptUtils.toScript(getClassesAsList(context, component,
+ "columnClasses"));
}
-
- public String getRowClassesAsJSArray(FacesContext context, UIComponent component) {
- return ScriptUtils.toScript(getClassesAsList(context, component, "rowClasses"));
+
+ public String getRowClassesAsJSArray(FacesContext context,
+ UIComponent component) {
+ return ScriptUtils.toScript(getClassesAsList(context, component,
+ "rowClasses"));
}
-
- protected List getClassesAsList(FacesContext context, UIComponent component, String attr) {
-
- String value = (String) ((UIDataAdaptor) component).getAttributes().get(attr);
+
+ protected List getClassesAsList(FacesContext context,
+ UIComponent component, String attr) {
+
+ String value = (String) ((UIDataAdaptor) component).getAttributes()
+ .get(attr);
if (value != null && (value.length() != 0)) {
return Arrays.asList(value.split(","));
}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2008-02-12 16:33:40 UTC (rev 6032)
@@ -34,7 +34,7 @@
super(MESSAGE_BUNDLE_NAME);
}
- private static final String MESSAGE_BUNDLE_NAME = OrderingListRendererBase.class.getPackage().getName() + "OrderingList";
+ private static final String MESSAGE_BUNDLE_NAME = OrderingListRendererBase.class.getPackage().getName() + ".orderingList";
private final static Character ACTIVITY_MARKER = new Character('a');
18 years, 2 months
JBoss Rich Faces SVN: r6031 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-02-12 11:29:20 -0500 (Tue, 12 Feb 2008)
New Revision: 6031
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
fixed bundle search behavior
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-02-12 16:29:03 UTC (rev 6030)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-02-12 16:29:20 UTC (rev 6031)
@@ -522,22 +522,29 @@
ResponseWriter writer) throws IOException {
String label = null;
- try {
- if(null != bundle1){
- label = bundle1.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
- }
-
- } catch (MissingResourceException e) {
- // Current key wasn't found in application bundle, use CALENDAR_BUNDLE
- try {
+ if(null != bundle1){
+ try {
+ label = bundle1.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
+ } catch (MissingResourceException e) {
+ // Current key wasn't found in application bundle, use CALENDAR_BUNDLE
+ try {
+ if(null != bundle2){
+ label = bundle2.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
+ }
+ } catch (MissingResourceException exc) {
+ // Current key wasn't found, use default, ignore this exception.
+ }
+ }
- if(null != bundle2){
+ }else if(null != bundle2){
+ try {
label = bundle2.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
+ } catch (MissingResourceException exc) {
+ // Current key wasn't found, use default, ignore this exception.
}
- } catch (MissingResourceException exc) {
- // Current key wasn't found, use default, ignore this exception.
- }
- }
+
+ }
+
writeStringFoundInBundle(name, label, writer);
}
18 years, 2 months
JBoss Rich Faces SVN: r6030 - in trunk/sandbox/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-12 11:29:03 -0500 (Tue, 12 Feb 2008)
New Revision: 6030
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
add shadow
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 15:23:25 UTC (rev 6029)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 16:29:03 UTC (rev 6030)
@@ -57,7 +57,9 @@
}
.rich-inplace-shadow {
- top:-7; left:-5; position : absolute;
+ top:-7px;
+ left:-5px;
+ position : absolute;
}
.rich-inplace-shadow-size {
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 15:23:25 UTC (rev 6029)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 16:29:03 UTC (rev 6030)
@@ -58,12 +58,18 @@
<tr>
<td class="rich-inplace-shadow-tl">
<img width="10" height="1" border="0" alt="" src="#{spacer}"/>
- <br/>
</td>
<td class="rich-inplace-shadow-tr">
+ <img width="1" height="10" border="0" alt="" src="#{spacer}"/>
</td>
</tr>
<tr>
+ <td class="rich-inplace-shadow-bl">
+ <img width="1" height="10" border="0" alt="" src="#{spacer}"/>
+ </td>
+ <td class="rich-inplace-shadow-br">
+ <img width="10" height="1" border="0" alt="" src="#{spacer}"/>
+ </td>
</tr>
</tbody>
</table>
18 years, 2 months
JBoss Rich Faces SVN: r6029 - in trunk/sandbox/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/css and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-12 10:23:25 -0500 (Tue, 12 Feb 2008)
New Revision: 6029
Modified:
trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
add generated icons, backgrounds.
Modified: trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml 2008-02-12 15:10:31 UTC (rev 6028)
+++ trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml 2008-02-12 15:23:25 UTC (rev 6029)
@@ -1,16 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<resource-config>
-
<resource class="org.richfaces.renderkit.images.OkControlIcon">
<name>org.richfaces.renderkit.images.OkControlIcon</name>
</resource>
-
<resource class="org.richfaces.renderkit.images.EditIcon">
<name>org.richfaces.renderkit.images.EditIcon</name>
</resource>
-
<resource class="org.richfaces.renderkit.images.CancelControlIcon">
<name>org.richfaces.renderkit.images.CancelControlIcon</name>
</resource>
-
-</resource-config>
+ <resource class="org.richfaces.renderkit.html.images.SpinnerButtonGradient">
+ <name>org.richfaces.renderkit.html.images.SpinnerButtonGradient</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient">
+ <name>org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.ComboBoxListShadow">
+ <name>org.richfaces.renderkit.html.images.ComboBoxListShadow</name>
+ </resource>
+</resource-config>
\ No newline at end of file
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 15:10:31 UTC (rev 6028)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-12 15:23:25 UTC (rev 6029)
@@ -4,79 +4,146 @@
xmlns="http://www.w3.org/1999/xhtml" >
<f:verbatim>
-<![CDATA[
-.rich-inplace {
-}
-
-.rich-inplace-changed {
- background-color:#F1F1F1;
- border-bottom:1px dashed #000000;
- padding-left:3px;
- padding-right:3px;
- white-space:nowrap;
+ <![CDATA[
+ .rich-inplace {
+ }
- background-image:url(/inplaceInput-sample/images/mark_open.gif);
- background-position:left top;
- background-repeat:no-repeat;
-}
+ .rich-inplace-changed {
+ background-color:#F1F1F1;
+ border-bottom:1px dashed #000000;
+ padding-left:3px;
+ padding-right:3px;
+ white-space:nowrap;
+ background-position:left top;
+ background-repeat:no-repeat;
+ }
+
+ .rich-inplace-view {
+ background-color:#F1F1F1;
+ border-bottom:1px dashed #000000;
+ padding-left:3px;
+ padding-right:3px;
+ white-space:nowrap;
+ }
+
+ .rich-inplace-edit {
+ position:relative;
+ width:100px;
+ }
+
+ .rich-inplace-field {
+ background:#FFF281 none repeat scroll 0%;
+ border:0px none;
+ /*left:0px;
+ top:0px;
+ position:absolute;*/
+ margin:0px;
+ padding:0px 0px 0px 3px;
+ width:100px;
+ }
+
+ .rich-inplace-control {
+ background-color : #FFFFFF;
+ border : 1px outset #BED6F8;
+ padding : 0px;
+ margin : 0px;
+ }
+
+ .rich-inplace-control-press {
+ background-color: #FFFFFF;
+ border : 1px inset #BED6F8;
+ padding : 0px;
+ margin : 0px;
+ }
+
+ .rich-inplace-shadow {
+ top:-7; left:-5; position : absolute;
+ }
+
+ .rich-inplace-shadow-size {
+ width : 36px; height : 26px;
+ }
+
+ .rich-inplace-shadow-tl {
+ background-repeat: repeat-x;
+ background-position: top left;
+ }
+
+ .rich-inplace-shadow-tr {
+ background-repeat: repeat-x;
+ background-position: top right;
+ }
+
+ .rich-inplace-shadow-bl {
+ background-repeat: repeat-x;
+ background-position: bottom left;
+ }
+
+ .rich-inplace-shadow-br {
+ background-repeat: repeat-x;
+ background-position: bottom right;
+ }
+
-.rich-inplace-view {
- background-color:#F1F1F1;
- border-bottom:1px dashed #000000;
- padding-left:3px;
- padding-right:3px;
- white-space:nowrap;
-}
-.rich-inplace-edit {
- position:relative;
- width:100px;
-}
+ /* mock-up styles */
+
+ *{font-family : verdana; font-size:11px;}
+ body{padding : 30px;}
+ fieldset{padding : 30px; border : 1px solid #c0c0c0;}
+ legend{font-weight : bold}
+
+ .is_default_state{white-space : nowrap; background-color : #f1f1f1; border-bottom : 1px dashed #000000; padding-left : 3px; padding-right : 3px;}
+ .is_changed_state{background-image:url(images/mark_open.gif); background-position : top left; background-repeat : no-repeat;}
+ .is_edit_state{position : relative; width : 100px;}
+ .is_field{background : #FFF281; padding : 0px 0px 0px 3px; border : 0px; margin : 0px; width : 100px; position : absolute; top:0px; left : 0px;}
+
+ .is_btn_set{ /*position : absolute; top:0px; left : 100px;*/ white-space : nowrap}
-.rich-inplace-field {
- background:#FFF281 none repeat scroll 0%;
- border:0px none;
- /*left:0px;
- top:0px;
- position:absolute;*/
- margin:0px;
- padding:0px 0px 0px 3px;
- width:100px;
-}
-
-/* mock-up styles */
-
-*{font-family : verdana; font-size:11px;}
-body{padding : 30px;}
-fieldset{padding : 30px; border : 1px solid #c0c0c0;}
-legend{font-weight : bold}
-
-
-
-.is_default_state{white-space : nowrap; background-color : #f1f1f1; border-bottom : 1px dashed #000000; padding-left : 3px; padding-right : 3px;}
-.is_changed_state{background-image:url(images/mark_open.gif); background-position : top left; background-repeat : no-repeat;}
-.is_edit_state{position : relative; width : 100px;}
-.is_field{background : #FFF281; padding : 0px 0px 0px 3px; border : 0px; margin : 0px; width : 100px; position : absolute; top:0px; left : 0px;}
-.is_btn{
- background : url(images/bg_btn.png) #FFFFFF;
- border : 1px outset #BED6F8;
- padding : 0px;
- margin : 0px;}
-.is_btn_press{
- background : url(images/bg_press.png) #FFFFFF;
- border : 1px inset #BED6F8;
- padding : 0px;
- margin : 0px;}
-.is_btn_set{ /*position : absolute; top:0px; left : 100px;*/ white-space : nowrap}
-.is_shadow{ top:-7; left:-5; position : absolute;}
-.is_shadow_size{ width : 36px; height : 26px;}
-.is_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
-.is_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
-.is_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
-.is_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
]]>
-
</f:verbatim>
-
+ <u:selector name=".rich-inplace-changed">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.images.EditIcon"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-inplace-control">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.SpinnerButtonGradient"/>
+ </u:style>
+ </u:selector>
+
+
+ <u:selector name=".rich-inplace-control-press">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-inplace-shadow-tl">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxListShadow"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-inplace-shadow-tr">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxListShadow"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-inplace-shadow-bl">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxListShadow"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-inplace-shadow-br">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxListShadow"/>
+ </u:style>
+ </u:selector>
+
</f:template>
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 15:10:31 UTC (rev 6028)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 15:23:25 UTC (rev 6029)
@@ -16,6 +16,10 @@
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/inplaceinput.js
</h:scripts>
+ <f:resource var="ok_icon" name="org.richfaces.renderkit.images.OkControlIcon"/>
+ <f:resource var="cancel_icon" name="org.richfaces.renderkit.images.CancelControlIcon"/>
+ <f:resource var="spacer" name="images/spacer.gif"/>
+
<f:clientid var="clientId" />
<jsp:scriptlet>
@@ -34,6 +38,7 @@
variables.setVariable("fieldValue", fieldValue);
]]>
</jsp:scriptlet>
+
<span id="#{clientId}" class="rich-inplace rich-inplace-view">
<input id='#{clientId}tempValue'
class='rich-inplace-field'
@@ -47,15 +52,15 @@
<input id='#{clientId}value' type='hidden' value='#{fieldValue}'/>
<div id="#{clientId}bar" class="is_btn_set" style="display:none;">
- <div class="is_shadow">
- <table class="is_shadow_size" cellspacing="0" cellpadding="0" border="0">
+ <div class="rich-inplace-shadow">
+ <table class="rich-inplace-shadow-size" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
- <td class="is_shadow_tl">
- <img width="10" height="1" border="0" alt="" src="/inplaceInput-sample/images/spacer.gif"/>
+ <td class="rich-inplace-shadow-tl">
+ <img width="10" height="1" border="0" alt="" src="#{spacer}"/>
<br/>
</td>
- <td class="is_shadow_tr">
+ <td class="rich-inplace-shadow-tr">
</td>
</tr>
<tr>
@@ -64,12 +69,12 @@
</table>
</div>
<div id="#{clientId}buttons">
- <input id="#{clientId}ok" class="is_btn" type="image" onmouseup="this.className='is_btn'"
- onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
- src="/inplaceInput-sample/images/ico_ok.gif"/>
- <input id="#{clientId}cancel" class="is_btn" type="image" onmouseup="this.className='is_btn'"
- onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
- src="/inplaceInput-sample/images/ico_cancel.gif"/>
+ <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}"/>
+ <input id="#{clientId}cancel" 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="#{cancel_icon}"/>
</div>
</div>
#{value}
18 years, 2 months
JBoss Rich Faces SVN: r6028 - trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-12 10:10:31 -0500 (Tue, 12 Feb 2008)
New Revision: 6028
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
ok and cancel functionality
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-12 14:13:56 UTC (rev 6027)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-12 15:10:31 UTC (rev 6028)
@@ -52,8 +52,8 @@
this.valueKeeper.style.visibility = "hidden";
this.valueKeeper.show();
- this.INPUT_WIDTH = this.valueKeeper.offsetWidth;
- this.INPUT_HEIGHT = this.valueKeeper.offsetHeight;
+ this.INPUT_WIDTH = 100;
+ this.INPUT_HEIGHT = 12;
this.valueKeeper.hide();
this.valueKeeper.style.visibility = "visible";
@@ -76,12 +76,12 @@
}
if (this.events.oneditactivation) {
- this.inplaceInput.fire("rich:oneditactivation", {});
+ this.inplaceInput.fire("rich:oneditactivation", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
this.endViewState();
this.startEditableState();
if (this.events.oneditactivated) {
- this.inplaceInput.fire("rich:oneditactivated", {});
+ this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
},
@@ -183,7 +183,7 @@
var userValue = this.tempValueKeeper.value;
var value = this.valueKeeper.value;
if (this.events.onviewactivation) {
- this.inplaceInput.fire("rich:onviewactivation", {});
+ this.inplaceInput.fire("rich:onviewactivation", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
this.endEditableState();
//this.applyUserValue();
@@ -199,7 +199,7 @@
this.startViewState();
}
if (this.events.onviewactivated) {
- this.inplaceInput.fire("rich:onviewactivated", {});
+ this.inplaceInput.fire("rich:onviewactivated", {oldValue : this.valueKepeer.value, value : this.tempValueKeeper.value});
}
},
@@ -277,7 +277,7 @@
bs.top = "0px";
bs.left = -this.BAR_WIDTH + "px";
break;
- case "reight" :
+ case "right" :
bs.top = "0px";
bs.left = intDims.width + "px";
break;
18 years, 2 months
JBoss Rich Faces SVN: r6027 - in trunk/sandbox/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-12 09:13:56 -0500 (Tue, 12 Feb 2008)
New Revision: 6027
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
ok and cancel functionality
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-12 12:57:30 UTC (rev 6026)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-12 14:13:56 UTC (rev 6027)
@@ -16,13 +16,13 @@
this.currentText = this.getCurrentText();
this.currentState = Richfaces.InplaceInput.STATES[0];
+ this.prevState = Richfaces.InplaceInput.STATES[0];
this.initDimensions();
if (this.attributes.showControls) {
this.bar = new Richfaces.InplaceInputBar(barParams[0], barParams[1], barParams[2], barParams[3],
this.attributes.controlsPosition,
- {width: this.INPUT_WIDTH, height: this.INPUT_HEIGHT},
- this.inputProcessing, this.cancel);
+ {width: this.INPUT_WIDTH, height: this.INPUT_HEIGHT});
}
this.initHandlers();
this.initEvents();
@@ -31,6 +31,12 @@
initHandlers : function() {
this.inplaceInput.observe(this.attributes.editEvent, function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
this.tempValueKeeper.observe("blur", function(e){this.tmpValueBlurHandler(e);}.bindAsEventListener(this));
+
+ this.bar.ok.observe("click", function(e){this.okHandler(e);}.bindAsEventListener(this));
+ this.bar.cancel.observe("click", function(e){this.cancelHandler(e)}.bindAsEventListener(this));
+
+ this.bar.ok.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
+ this.bar.cancel.observe("mousedown", function(e){this.barMouseDownHandler(e);}.bindAsEventListener(this));
},
initEvents : function() {
@@ -80,11 +86,30 @@
},
tmpValueBlurHandler : function() {
+ if (this.clickOnBar) {
+ this.clickOnBar = false;
+ return;
+ }
+
if (!this.attributes.apllyFromControlsOnly) {
this.inputProcessing();
}
},
+ barMouseDownHandler : function(e) {
+ this.clickOnBar = true;
+ },
+
+ okHandler : function(e) {
+ this.inputProcessing(e);
+ Event.stop(e);
+ },
+
+ cancelHandler : function(e) {
+ this.cancel(e);
+ Event.stop(e);
+ },
+
/**
* STATE'S API
*/
@@ -104,7 +129,8 @@
},
startEditableState : function() {
- this.currentState = Richfaces.InplaceInput.STATES[1];
+ this.changeState(Richfaces.InplaceInput.STATES[1]);
+
if (this.bar) {
this.bar.show();
}
@@ -117,13 +143,15 @@
},
startViewState : function() {
- this.currentState = Richfaces.InplaceInput.STATES[0];
+ this.changeState(Richfaces.InplaceInput.STATES[0]);
+
this.createNewText(this.currentText);
this.inplaceInput.className = this.classes.COMPONENT.VIEW;
},
startChangedState : function () {
- this.currentState = Richfaces.InplaceInput.STATES[2];
+ this.changeState(Richfaces.InplaceInput.STATES[2]);
+
this.createNewText(this.valueKeeper.value);
this.inplaceInput.className = this.classes.COMPONENT.CHANGED;
},
@@ -132,8 +160,23 @@
* UTILITIES
*/
+ changeState : function(newState) {
+ this.prevState = this.currentState;
+ this.currentState = newState;
+ },
+
cancel : function() {
+ this.endEditableState();
+ this.tempValueKeeper.value = this.valueKeeper.value;
+ switch (this.prevState) {
+ case Richfaces.InplaceInput.STATES[0] :
+ this.startViewState();
+ break;
+ case Richfaces.InplaceInput.STATES[2] :
+ this.startChangedState();
+ break;
+ }
},
inputProcessing : function() {
@@ -160,21 +203,15 @@
}
},
- /*applyUserValue : function() {
- var newValue = this.tempValueKeeper.value;
- if (newValue == "") {
- } else if (newValue != this.valueKeeper.value) {
- this.currentText = newValue;
- this.valueKeeper.value = newValue;
- }
- },*/
-
setDefaultText : function() {
this.currentText = this.attributes.defaultLabel;
},
deleteViewArtifacts : function () {
- this.inplaceInput.removeChild(this.inplaceInput.childNodes[3]);
+ var text = this.inplaceInput.childNodes[3];
+ if (text) {
+ this.inplaceInput.removeChild(text);
+ }
},
getCurrentText : function() {
@@ -182,30 +219,26 @@
},
createNewText : function(text) {
- this.inplaceInput.appendChild(document.createTextNode(text));
+ if (!this.getCurrentText()) {
+ this.inplaceInput.appendChild(document.createTextNode(text.nodeValue||text));
+ }
}
};
Richfaces.InplaceInputBar = Class.create();
Richfaces.InplaceInputBar.prototype = {
- initialize : function(barId, okId, cancelId, buttonsPanelId, position, intDims, okHandler, cancelHandler) {
+ initialize : function(barId, okId, cancelId, buttonsPanelId, position, intDims) {
this.bar = $(barId);
this.ok = $(okId);
this.cancel = $(cancelId);
this.bsPanel = $(buttonsPanelId);
this.position = position;
- this.initHandlers(okHandler, cancelHandler);
this.initDimensions();
this.positioning(intDims);
},
- initHandlers : function(okHandler, cancelHandler) {
- //this.ok.observe("click", function(e){okHandler}.bindAsEventListener(this));
- //this.cancel.observe("click", function(e){cancelHandler}.bindAsEventListener(this));
- },
-
initDimensions : function() {
/*this.bar.style.visibility = "hidden";
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 12:57:30 UTC (rev 6026)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-12 14:13:56 UTC (rev 6027)
@@ -45,6 +45,7 @@
autocomplete="off"
value='#{fieldValue}'/>
<input id='#{clientId}value' type='hidden' value='#{fieldValue}'/>
+
<div id="#{clientId}bar" class="is_btn_set" style="display:none;">
<div class="is_shadow">
<table class="is_shadow_size" cellspacing="0" cellpadding="0" border="0">
@@ -64,10 +65,10 @@
</div>
<div id="#{clientId}buttons">
<input id="#{clientId}ok" class="is_btn" type="image" onmouseup="this.className='is_btn'"
- onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
+ onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
src="/inplaceInput-sample/images/ico_ok.gif"/>
<input id="#{clientId}cancel" class="is_btn" type="image" onmouseup="this.className='is_btn'"
- onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
+ onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
src="/inplaceInput-sample/images/ico_cancel.gif"/>
</div>
</div>
18 years, 2 months