JBoss Rich Faces SVN: r4258 - branches/3.1.x/ui/componentControl/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-26 09:22:12 -0500 (Mon, 26 Nov 2007)
New Revision: 4258
Modified:
branches/3.1.x/ui/componentControl/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
Context Menu - support for most features
Modified: branches/3.1.x/ui/componentControl/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- branches/3.1.x/ui/componentControl/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-11-26 14:22:02 UTC (rev 4257)
+++ branches/3.1.x/ui/componentControl/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-11-26 14:22:12 UTC (rev 4258)
@@ -19,12 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.richfaces.sandbox.component;
+package org.richfaces.component;
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
/**
* Unit test for simple Component.
16 years, 5 months
JBoss Rich Faces SVN: r4257 - branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-26 09:22:02 -0500 (Mon, 26 Nov 2007)
New Revision: 4257
Modified:
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
Log:
Context Menu - support for most features
Modified: branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2007-11-26 14:21:29 UTC (rev 4256)
+++ branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2007-11-26 14:22:02 UTC (rev 4257)
@@ -170,6 +170,7 @@
writer.writeAttribute("id", clientId+"_menu_iframe", null);
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute; z-index: 1;", null);
+ writer.writeText("aaa", null);
writer.endElement("iframe");
writer.startElement("script", layer);
16 years, 5 months
JBoss Rich Faces SVN: r4256 - branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-26 09:21:29 -0500 (Mon, 26 Nov 2007)
New Revision: 4256
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
Log:
Added element table for better INNERHTML support
Modified: branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js 2007-11-26 13:10:22 UTC (rev 4255)
+++ branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js 2007-11-26 14:21:29 UTC (rev 4256)
@@ -13,6 +13,102 @@
JSNode = function() {
};
+JSNode.ED = function(empty) {
+ this.empty = empty
+};
+JSNode.eltt = {
+ 'a' :new JSNode.ED(false),
+ 'abbr' :new JSNode.ED(false),
+ 'acronym' :new JSNode.ED(false),
+ 'address' :new JSNode.ED(false),
+ 'applet' :new JSNode.ED(false),
+ 'area' :new JSNode.ED(true),
+ 'b' :new JSNode.ED(false),
+ 'base' :new JSNode.ED(true),
+ 'basefont' :new JSNode.ED(true),
+ 'bdo' :new JSNode.ED(false),
+ 'big' :new JSNode.ED(false),
+ 'blockquote' :new JSNode.ED(false),
+ 'body' :new JSNode.ED(false),
+ 'br' :new JSNode.ED(true),
+ 'button' :new JSNode.ED(false),
+ 'caption' :new JSNode.ED(false),
+ 'center' :new JSNode.ED(false),
+ 'cite' :new JSNode.ED(false),
+ 'code' :new JSNode.ED(false),
+ 'col' :new JSNode.ED(true),
+ 'colgroup' :new JSNode.ED(false),
+ 'dd' :new JSNode.ED(false),
+ 'del' :new JSNode.ED(false),
+ 'dfn' :new JSNode.ED(false),
+ 'dir' :new JSNode.ED(false),
+ 'div' :new JSNode.ED(false),
+ 'dl' :new JSNode.ED(false),
+ 'dt' :new JSNode.ED(false),
+ 'em' :new JSNode.ED(false),
+ 'fieldset' :new JSNode.ED(false),
+ 'font' :new JSNode.ED(false),
+ 'form' :new JSNode.ED(false),
+ 'h1' :new JSNode.ED(false),
+ 'h2' :new JSNode.ED(false),
+ 'h3' :new JSNode.ED(false),
+ 'h4' :new JSNode.ED(false),
+ 'h5' :new JSNode.ED(false),
+ 'h6' :new JSNode.ED(false),
+ 'head' :new JSNode.ED(false),
+ 'hr' :new JSNode.ED(true),
+ 'html' :new JSNode.ED(false),
+ 'i' :new JSNode.ED(false),
+ 'iframe' :new JSNode.ED(false),
+ 'img' :new JSNode.ED(true),
+ 'input' :new JSNode.ED(true),
+ 'ins' :new JSNode.ED(false),
+ 'isindex' :new JSNode.ED(true),
+ 'kbd' :new JSNode.ED(false),
+ 'label' :new JSNode.ED(false),
+ 'legend' :new JSNode.ED(false),
+ 'li' :new JSNode.ED(false),
+ 'link' :new JSNode.ED(true),
+ 'map' :new JSNode.ED(false),
+ 'menu' :new JSNode.ED(false),
+ 'meta' :new JSNode.ED(true),
+ 'noframes' :new JSNode.ED(false),
+ 'noscript' :new JSNode.ED(false),
+ 'object' :new JSNode.ED(false),
+ 'ol' :new JSNode.ED(false),
+ 'optgroup' :new JSNode.ED(false),
+ 'option' :new JSNode.ED(false),
+ 'p' :new JSNode.ED(false),
+ 'param' :new JSNode.ED(true),
+ 'pre' :new JSNode.ED(false),
+ 'q' :new JSNode.ED(false),
+ 's' :new JSNode.ED(false),
+ 'samp' :new JSNode.ED(false),
+ 'script' :new JSNode.ED(false),
+ 'select' :new JSNode.ED(false),
+ 'small' :new JSNode.ED(false),
+ 'span' :new JSNode.ED(false),
+ 'strike' :new JSNode.ED(false),
+ 'strong' :new JSNode.ED(false),
+ 'style' :new JSNode.ED(false),
+ 'sub' :new JSNode.ED(false),
+ 'sup' :new JSNode.ED(false),
+ 'table' :new JSNode.ED(false),
+ 'tbody' :new JSNode.ED(false),
+ 'td' :new JSNode.ED(false),
+ 'textarea' :new JSNode.ED(false),
+ 'tfoot' :new JSNode.ED(false),
+ 'th' :new JSNode.ED(false),
+ 'thead' :new JSNode.ED(false),
+ 'title' :new JSNode.ED(false),
+ 'tr' :new JSNode.ED(false),
+ 'tt' :new JSNode.ED(false),
+ 'u' :new JSNode.ED(false),
+ 'ul' :new JSNode.ED(false),
+ 'var' :new JSNode.ED(false)
+};
+
+
// Base node
JSNode.prototype = {
tag : null,
@@ -69,8 +165,11 @@
if (attrValue)
html += " "+(i=='className'?'class':i)+'="'+this.xmlEscape(attrValue)+'"';
}
- if(inner == "") html+= "/>";
- else html+= ">"+inner+"</"+this.tag+">";
+ if(inner == "" && JSNode.eltt[this.tag.toLowerCase()].empty) {
+ html+= "/>";
+ } else {
+ html+= ">"+inner+"</"+this.tag+">";
+ }
return html;
};
@@ -128,4 +227,3 @@
return "<![CDATA["+this.value+"]]>";
};
-
16 years, 5 months
JBoss Rich Faces SVN: r4255 - branches/3.1.x/ui/orderingList/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-26 08:10:22 -0500 (Mon, 26 Nov 2007)
New Revision: 4255
Modified:
branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
Log:
bug: RF-1409
Modified: branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2007-11-26 12:45:06 UTC (rev 4254)
+++ branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2007-11-26 13:10:22 UTC (rev 4255)
@@ -245,6 +245,49 @@
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) is/are to be applied when this component is rendered</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>Corresponds to the HTML class attribute</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ <property>
+ <name>onclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>ondblclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseout</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression;</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmousemove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression;</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseover</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
</component>
<listener>
16 years, 5 months
JBoss Rich Faces SVN: r4254 - branches/3.1.x/ui/paint2D/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-11-26 07:45:06 -0500 (Mon, 26 Nov 2007)
New Revision: 4254
Modified:
branches/3.1.x/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java
Log:
RF-1413
Modified: branches/3.1.x/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java
===================================================================
--- branches/3.1.x/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java 2007-11-26 12:24:25 UTC (rev 4253)
+++ branches/3.1.x/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java 2007-11-26 12:45:06 UTC (rev 4254)
@@ -60,8 +60,7 @@
writer.writeAttribute("class", richPaint2DClass, null);
}
- String align = (String) component.getAttributes().get("align");
- if (null != align) writer.writeAttribute("align", align, null);
+
String hspace = (String) component.getAttributes().get("hspace");
if (null != hspace) writer.writeAttribute("hspace", hspace, null);
String vspace = (String) component.getAttributes().get("vspace");
16 years, 5 months
JBoss Rich Faces SVN: r4253 - trunk/ui/paint2D/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-11-26 07:24:25 -0500 (Mon, 26 Nov 2007)
New Revision: 4253
Modified:
trunk/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java
Log:
RF-1413
Modified: trunk/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java
===================================================================
--- trunk/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java 2007-11-26 11:28:10 UTC (rev 4252)
+++ trunk/ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DRenderer.java 2007-11-26 12:24:25 UTC (rev 4253)
@@ -59,9 +59,7 @@
} else {
writer.writeAttribute("class", richPaint2DClass, null);
}
-
- String align = (String) component.getAttributes().get("align");
- if (null != align) writer.writeAttribute("align", align, null);
+
String hspace = (String) component.getAttributes().get("hspace");
if (null != hspace) writer.writeAttribute("hspace", hspace, null);
String vspace = (String) component.getAttributes().get("vspace");
16 years, 5 months
JBoss Rich Faces SVN: r4252 - in branches/3.1.x/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-26 06:28:10 -0500 (Mon, 26 Nov 2007)
New Revision: 4252
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
handling of onselectionchange event was changed
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-26 10:09:53 UTC (rev 4251)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-26 11:28:10 UTC (rev 4252)
@@ -15,7 +15,7 @@
Richfaces.ListBase.ASC = "acs";
Richfaces.ListBase.DESC = "desc";
-Richfaces.ListBase.CONTROL_SET = ["A", "INPUT", "TEXTAREA", "SELECT", "BUTTON"];
+Richfaces.ListBase.CONTROL_SET = ["A", "INPUT", "TEXTAREA", "SELECT", "OPTION", "BUTTON"];
Richfaces.ListBase.prototype = {
initialize : function(containerId, contentTableId, headerTableId, focusKeeperId, valueKeeperId,
Modified: branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-26 10:09:53 UTC (rev 4251)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-26 11:28:10 UTC (rev 4252)
@@ -63,6 +63,7 @@
</tr>
</tbody>
</table>
+
<f:clientId var="cId"/>
<script type="text/javascript">
var clientId = '#{cId}';
16 years, 5 months
JBoss Rich Faces SVN: r4251 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-26 05:09:53 -0500 (Mon, 26 Nov 2007)
New Revision: 4251
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
Log:
bug: RF-1398
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-26 08:54:41 UTC (rev 4250)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-26 10:09:53 UTC (rev 4251)
@@ -32,23 +32,28 @@
this.selectedItems.sort(this.compareByRowIndex);
var control;
//FIXME
- if ((this.shuttleItems.length <= 1) || (this.selectedItems.length == 0)) {
- this.controlsProcessing(["first", "last", "down", "up"]);
- } else if (this.selectedItems[0].rowIndex == 0) {
- this.controlsProcessing(["first", "up"]);
- } else if (this.selectedItems[this.selectedItems.length - 1].rowIndex == (this.shuttleItems.length - 1)) {
- this.controlsProcessing(["down", "last"]);
- } else {
- this.controlsProcessing();
+ this.controlsProcessing(["first", "last", "down", "up"], "enable");
+ if ((this.shuttleItems.length <= 1) || (this.selectedItems.length == 0))
+ this.controlsProcessing(["first", "last", "down", "up"], "disable");
+ else {
+ if (this.selectedItems[0].rowIndex == 0)
+ this.controlsProcessing(["first", "up"], "disable");
+ if (this.selectedItems[this.selectedItems.length - 1].rowIndex == (this.shuttleItems.length - 1))
+ this.controlsProcessing(["down", "last"], "disable");
}
},
- controlsProcessing : function(disabledControls) {
+ controlsProcessing : function(disabledControls , action) {
for (var i = 0; i < this.controlList.length; i++) {
control = this.controlList[i];
if (control != null) {
- if (disabledControls != null && disabledControls.indexOf(control.action) != -1) control.doDisable();
- else control.doEnable();
+ if (disabledControls != null && disabledControls.indexOf(control.action) != -1) {
+ if (action == "disable") {
+ control.doDisable();
+ } else {
+ control.doEnable();
+ }
+ }
}
}
},
16 years, 5 months
JBoss Rich Faces SVN: r4250 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes: snippets and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-11-26 03:54:41 -0500 (Mon, 26 Nov 2007)
New Revision: 4250
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/snippets/reRender3.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
Log:
minor mistakes.
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/snippets/reRender3.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/snippets/reRender3.xhtml 2007-11-26 03:06:02 UTC (rev 4249)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/snippets/reRender3.xhtml 2007-11-26 08:54:41 UTC (rev 4250)
@@ -2,7 +2,7 @@
<h:form id="form1">
....
<a4j:commandButton value="Usual Way" reRender="infoBlock, infoBlock2" />
- <a4j:commandButton value="Shortcut" reRender=":infoBlockl,:sv:infoBlock2" />
+ <a4j:commandButton value="Shortcut" reRender=":infoBlock,:sv:infoBlock2" />
.....
</h:form>
<h:panelGrid id="infoBlock">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-11-26 03:06:02 UTC (rev 4249)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-11-26 08:54:41 UTC (rev 4250)
@@ -82,7 +82,7 @@
</rich:panel>
<p>
<b>limitToList</b> attribute allows to dismiss the behavior of the a4j:outputPanel ajaxRendered
- attribute. limitToList = "false" means to update only the area(s) that mentioned in the
+ attribute. limitToList = "true" means to update only the area(s) that mentioned in the
reRender attribute explicitly. All output panels with ajaxRendered="true" will be ignored.
</p>
<h1 class="hsample">Queue and Traffic Flood Protection</h1>
16 years, 5 months
JBoss Rich Faces SVN: r4249 - in branches/3.1.x/ui/orderingList/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-25 22:06:02 -0500 (Sun, 25 Nov 2007)
New Revision: 4249
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
latest changes for listShuttle
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-26 03:05:55 UTC (rev 4248)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-26 03:06:02 UTC (rev 4249)
@@ -5,15 +5,21 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import javax.faces.FacesException;
+import javax.faces.application.FacesMessage;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import javax.faces.model.ArrayDataModel;
@@ -267,4 +273,200 @@
return dataModel;
}
+
+
+ /**
+ * @exception NullPointerException {@inheritDoc}
+ */
+ public void decode(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Force validity back to "true"
+ setValid(true);
+ super.decode(context);
+ }
+
+ /**
+ * <p>Specialized decode behavior on top of that provided by the
+ * superclass. In addition to the standard
+ * <code>processDecodes</code> behavior inherited from {@link
+ * UIComponentBase}, calls <code>validate()</code> if the the
+ * <code>immediate</code> property is true; if the component is
+ * invalid afterwards or a <code>RuntimeException</code> is thrown,
+ * calls {@link FacesContext#renderResponse}. </p>
+ * @exception NullPointerException {@inheritDoc}
+ */
+ public void processDecodes(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+ super.processDecodes(context);
+
+ if (isImmediate()) {
+ executeValidate(context);
+ }
+ }
+
+ /**
+ * Executes validation logic.
+ */
+ private void executeValidate(FacesContext context) {
+ try {
+ validate(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+
+ if (!isValid()) {
+ context.renderResponse();
+ }
+ }
+
+
+ public abstract void validate(FacesContext context);
+
+ /**
+ * <p>In addition to the standard <code>processValidators</code> behavior
+ * inherited from {@link UIComponentBase}, calls <code>validate()</code>
+ * if the <code>immediate</code> property is false (which is the
+ * default); if the component is invalid afterwards, calls
+ * {@link FacesContext#renderResponse}.
+ * If a <code>RuntimeException</code> is thrown during
+ * validation processing, calls {@link FacesContext#renderResponse}
+ * and re-throw the exception.
+ * </p>
+ * @exception NullPointerException {@inheritDoc}
+ */
+ public void processValidators(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+ super.processValidators(context);
+ if (!isImmediate()) {
+ executeValidate(context);
+ }
+ }
+
+ /**
+ * <p>In addition to the standard <code>processUpdates</code> behavior
+ * inherited from {@link UIComponentBase}, calls
+ * <code>updateModel()</code>.
+ * If the component is invalid afterwards, calls
+ * {@link FacesContext#renderResponse}.
+ * If a <code>RuntimeException</code> is thrown during
+ * update processing, calls {@link FacesContext#renderResponse}
+ * and re-throw the exception.
+ * </p>
+ * @exception NullPointerException {@inheritDoc}
+ */
+ public void processUpdates(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+ super.processUpdates(context);
+
+ try {
+ updateModel(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+
+ if (!isValid()) {
+ context.renderResponse();
+ }
+ }
+
+ public abstract void updateModel(FacesContext context);
+
+ protected interface UpdateModelCommand {
+ public void execute(FacesContext context);
+ }
+
+ protected void updateModel(FacesContext context, UpdateModelCommand command) {
+ try {
+ command.execute(context);
+ } catch (EvaluationException e) {
+ String messageStr = e.getMessage();
+ FacesMessage message = null;
+ if (null == messageStr) {
+ message =
+ MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ }
+ else {
+ message = new FacesMessage(messageStr);
+ }
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
+ setValid(false);
+ }
+ catch (FacesException e) {
+ FacesMessage message =
+ MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
+ setValid(false);
+ } catch (IllegalArgumentException e) {
+ FacesMessage message =
+ MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
+ setValid(false);
+ } catch (Exception e) {
+ FacesMessage message =
+ MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
+ setValid(false);
+ }
+ }
+
+ /**
+ * <p>Return <code>true</code> if the new value is different from the
+ * previous value.</p>
+ *
+ * @param previous old value of this component (if any)
+ * @param value new value of this component (if any)
+ */
+ protected boolean compareValues(Object previous, Object value) {
+
+ if (previous == null) {
+ return (value != null);
+ } else if (value == null) {
+ return (true);
+ } else {
+ if (previous instanceof Object[]) {
+ return !Arrays.equals((Object[]) previous, (Object[]) value);
+ } else {
+ return (!(previous.equals(value)));
+ }
+ }
+
+ }
+
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-26 03:05:55 UTC (rev 4248)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-26 03:06:02 UTC (rev 4249)
@@ -29,9 +29,7 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.event.ValueChangeListener;
-import javax.faces.model.ArrayDataModel;
import javax.faces.model.DataModel;
-import javax.faces.model.ListDataModel;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
@@ -370,9 +368,6 @@
super.processDecodes(context);
- if (isImmediate()) {
- executeValidate(context);
- }
}
/**
@@ -399,9 +394,6 @@
}
super.processValidators(context);
- if (!isImmediate()) {
- executeValidate(context);
- }
}
/**
@@ -428,34 +420,9 @@
}
super.processUpdates(context);
-
- try {
- updateModel(context);
- } catch (RuntimeException e) {
- context.renderResponse();
- throw e;
- }
-
- if (!isValid()) {
- context.renderResponse();
- }
}
/**
- * @exception NullPointerException {@inheritDoc}
- */
- public void decode(FacesContext context) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- // Force validity back to "true"
- setValid(true);
- super.decode(context);
- }
-
- /**
* <p>In addition to to the default {@link UIComponent#broadcast}
* processing, pass the {@link ValueChangeEvent} being broadcast to the
* method referenced by <code>valueChangeListener</code> (if any).</p>
@@ -486,10 +453,6 @@
}
- private interface UpdateModelCommand {
- public void execute(FacesContext context);
- }
-
private final UpdateModelCommand updateValueCommand = new UpdateModelCommand() {
public void execute(FacesContext context) {
@@ -535,44 +498,6 @@
};
- private void updateModel(FacesContext context, UpdateModelCommand command) {
- try {
- command.execute(context);
- } catch (EvaluationException e) {
- String messageStr = e.getMessage();
- FacesMessage message = null;
- if (null == messageStr) {
- message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
- }
- else {
- message = new FacesMessage(messageStr);
- }
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- setValid(false);
- }
- catch (FacesException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- setValid(false);
- } catch (IllegalArgumentException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- setValid(false);
- } catch (Exception e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- setValid(false);
- }
- }
-
/**
* <p>Perform the following algorithm to update the model data
* associated with this {@link UIInput}, if any, as appropriate.</p>
@@ -860,46 +785,6 @@
- /**
- * <p>Return <code>true</code> if the new value is different from the
- * previous value.</p>
- *
- * @param previous old value of this component (if any)
- * @param value new value of this component (if any)
- */
- protected boolean compareValues(Object previous, Object value) {
-
- if (previous == null) {
- return (value != null);
- } else if (value == null) {
- return (true);
- } else {
- if (previous instanceof Object[]) {
- return !Arrays.equals((Object[]) previous, (Object[]) value);
- } else {
- return (!(previous.equals(value)));
- }
- }
-
- }
-
-
- /**
- * Executes validation logic.
- */
- private void executeValidate(FacesContext context) {
- try {
- validate(context);
- } catch (RuntimeException e) {
- context.renderResponse();
- throw e;
- }
-
- if (!isValid()) {
- context.renderResponse();
- }
- }
-
private boolean isEmpty(Object value) {
if (value == null) {
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-26 03:05:55 UTC (rev 4248)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-26 03:06:02 UTC (rev 4249)
@@ -78,7 +78,7 @@
protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new OrderingComponentRendererBase.ControlsHelper[] {
new OrderingComponentRendererBase.ControlsHelper("top", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
" rich-ordering-control-top", ATTRIBUTE_CLASS_TOP_CONTROL, ATTRIBUTE_CLASS_BUTTON,
- CONTROL_ID_TOP, ATTRIBUTE_CE_ONTOPCLICK, true, "topControlLabel") {
+ CONTROL_ID_TOP, ATTRIBUTE_CE_ONTOPCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isFastOrderControlsVisible();
@@ -87,7 +87,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledTop", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(), FACET_DIS_TOP,
" rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
- DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_TOP), null, false, "topControlLabel") {
+ DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_TOP), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isFastOrderControlsVisible();
@@ -96,7 +96,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("up", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
" rich-ordering-control-up", ATTRIBUTE_CLASS_UP_CONTROL, ATTRIBUTE_CLASS_BUTTON,
- CONTROL_ID_UP, ATTRIBUTE_CE_ONUPCLICK ,true, "upControlLabel") {
+ CONTROL_ID_UP, ATTRIBUTE_CE_ONUPCLICK ,true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isOrderControlsVisible();
@@ -105,7 +105,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledUp", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(), FACET_DIS_UP,
" rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
- DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_UP), null, false, "upControlLabel") {
+ DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_UP), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isOrderControlsVisible();
@@ -114,7 +114,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("down", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(), FACET_DOWN,
" rich-ordering-control-down", ATTRIBUTE_CLASS_DOWN_CONTROL, ATTRIBUTE_CLASS_BUTTON,
- CONTROL_ID_DOWN, ATTRIBUTE_CE_ONDOWNCLICK, true, "downControlLabel") {
+ CONTROL_ID_DOWN, ATTRIBUTE_CE_ONDOWNCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isOrderControlsVisible();
@@ -123,7 +123,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledDown", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(), FACET_DIS_DOWN,
" rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
- DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_DOWN), null, false, "downControlLabel") {
+ DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_DOWN), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isOrderControlsVisible();
@@ -132,7 +132,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("bottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(), FACET_BOTTOM,
" rich-ordering-control-bottom", ATTRIBUTE_CLASS_BOTTOM_CONTROL, ATTRIBUTE_CLASS_BUTTON,
- CONTROL_ID_BOTTOM, ATTRIBUTE_CE_ONBOTTOMCLICK, true, "bottomControlLabel") {
+ CONTROL_ID_BOTTOM, ATTRIBUTE_CE_ONBOTTOMCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isFastOrderControlsVisible();
@@ -141,7 +141,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledBottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
" rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
- DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_BOTTOM), null, false, "bottomControlLabel") {
+ DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_BOTTOM), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
return list.isFastOrderControlsVisible();
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-26 03:05:55 UTC (rev 4248)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-26 03:06:02 UTC (rev 4249)
@@ -66,7 +66,7 @@
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) {
+ String idSuffix, String customEvent, boolean isEnable) {
super();
this.name = name;
this.bundlePropertyName = bundlePropertyName;
@@ -79,7 +79,7 @@
this.customEvent = customEvent;
this.buttonStyleClass = buttonStyleClass;
this.enable = isEnable;
- this.labelAttributeName = labelAttributeName;
+ this.labelAttributeName = name + "ControlLabel";
}
public String getName() {
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-26 03:05:55 UTC (rev 4248)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-26 03:06:02 UTC (rev 4249)
@@ -363,9 +363,9 @@
},
saveState : function() {
- if (this.activeItem != null || (this.selectedItems.length > 0)) {
+ //if (this.activeItem != null || (this.selectedItems.length > 0)) {
this.valueKeeper.value = this.getAsString();
- }
+ //}
}
}
16 years, 5 months