JBoss Rich Faces SVN: r3547 - trunk/sandbox/ui/sortableHeader/poc.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-25 13:33:52 -0400 (Thu, 25 Oct 2007)
New Revision: 3547
Added:
trunk/sandbox/ui/sortableHeader/poc/StringBuilder.js
trunk/sandbox/ui/sortableHeader/poc/indexSorter.jspx
Log:
added new files to poc
Added: trunk/sandbox/ui/sortableHeader/poc/StringBuilder.js
===================================================================
--- trunk/sandbox/ui/sortableHeader/poc/StringBuilder.js (rev 0)
+++ trunk/sandbox/ui/sortableHeader/poc/StringBuilder.js 2007-10-25 17:33:52 UTC (rev 3547)
@@ -0,0 +1,55 @@
+/*
+/* sbuilder.js - Helper class to improve strings concatenation perfomance
+ * by Denis Morozov <dmorozov(a)exadel.com> distributed under the BSD license.
+ *
+ * Usage:
+ * var sb = new StringBuilder();
+ * sb.append("String 1").append("String 2");
+ * sb.append("String 3");
+ * var str = sb.toString();
+ */
+StringBuilder = function() {
+
+ this.length = 0;
+
+ this._current = 0;
+ this._parts = [];
+ this._string = null;
+
+ this.initialize();
+}
+
+StringBuilder.prototype.initialize = function(str) {
+ this._string = null;
+ this._current = 0;
+ this._parts = [];
+ this.length = 0;
+
+ if(str != null)
+ this.append(str);
+}
+StringBuilder.prototype.append = function(str) {
+ // append argument
+ //this.length += (this._parts[this._current++] = String(str)).length;
+ this._parts.push(String(str));
+
+ // reset cache
+ this._string = null;
+ return this;
+}
+
+StringBuilder.prototype.toString = function () {
+ if (this._string != null)
+ return this._string;
+
+ var s = this._parts.join("");
+ this._parts = [];
+ this._current = 1;
+ this.length = s.length;
+
+ return this._string = s;
+}
+
+StringBuilder.prototype.clean = function(str) {
+ this.initialize();
+}
Added: trunk/sandbox/ui/sortableHeader/poc/indexSorter.jspx
===================================================================
--- trunk/sandbox/ui/sortableHeader/poc/indexSorter.jspx (rev 0)
+++ trunk/sandbox/ui/sortableHeader/poc/indexSorter.jspx 2007-10-25 17:33:52 UTC (rev 3547)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ version="2.0">
+
+ <ui:composition>
+ <f:verbatim escape="true"><?xml version="1.0" encoding="ISO-8859-1" ?></f:verbatim>
+ <f:verbatim escape="true"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></f:verbatim>
+
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Conent-Type" content="text/html; charset=iso-8859-1" />
+ <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>
+ <META HTTP-EQUIV="EXPIRES" CONTENT="-1"/>
+ <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"/>
+ <script src="#{facesContext.externalContext.requestContextPath}/scripts/StringBuilder.js" type="text/javascript"></script>
+ <script src="#{facesContext.externalContext.requestContextPath}/scripts/tableSorter.js" type="text/javascript"></script>
+
+ <title>dgdgdfgdfg</title>
+ </head>
+ <body>
+ <style>
+ .header {
+ text-align:left;
+ }
+ </style>
+ <h:form id="form">
+ <h:dataTable id="table" value="#{sorterBean.items}" var="item" headerClass="header">
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(0);return false;">Disk Id</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.diskId}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(1);return false;">Artist</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.artist}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(2);return false;">Title</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.title}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(3);return false;">Disk Year</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.diskYear}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(4);return false;">Genre</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.genre}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink href="#" onclick="sort(5);return false;">Description</h:commandLink>
+ </f:facet>
+ <h:outputText escape="true" value="#{item.description}" />
+ </h:column>
+ </h:dataTable>
+ <script>
+ var table = new DataTable("form:table", 0);
+ function sort(index) {
+ table.sortedColumnIndex = index;
+ var tt = new Date();
+ table.singleSorting();
+ table.rebuildTable();
+ var tf = new Date();
+ alert(tf-tt);
+ }
+ </script>
+
+ </h:form>
+ </body>
+</html>
+</ui:composition>
+</jsp:root>
\ No newline at end of file
17 years, 2 months
JBoss Rich Faces SVN: r3546 - in trunk/sandbox/ui: sortableHeader and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-25 13:31:37 -0400 (Thu, 25 Oct 2007)
New Revision: 3546
Added:
trunk/sandbox/ui/sortableHeader/
trunk/sandbox/ui/sortableHeader/poc/
trunk/sandbox/ui/sortableHeader/poc/tableSorter.js
Log:
added sortableHeader proof of concept
Added: trunk/sandbox/ui/sortableHeader/poc/tableSorter.js
===================================================================
--- trunk/sandbox/ui/sortableHeader/poc/tableSorter.js (rev 0)
+++ trunk/sandbox/ui/sortableHeader/poc/tableSorter.js 2007-10-25 17:31:37 UTC (rev 3546)
@@ -0,0 +1,139 @@
+QuickSort = function() {}
+
+QuickSort.prototype.partition = function(array, begin, end, pivot) {
+ var piv = array[pivot][0];
+ array.swap(pivot, end - 1);
+ var store = begin;
+ var ix;
+ for(ix = begin; ix < end-1; ++ix) {
+ if(array[ix][0] <= piv) {
+ array.swap(store, ix);
+ ++store;
+ }
+ }
+ array.swap(end - 1, store);
+
+ return store;
+}
+
+QuickSort.prototype.quickSort = function(array, begin, end) {
+ if(end - 1 > begin) {
+ var pivot = begin + Math.floor(Math.random() * (end - begin));
+
+ pivot = this.partition(array, begin, end, pivot);
+
+ this.quickSort(array, begin, pivot);
+ this.quickSort(array, pivot + 1, end);
+ }
+}
+
+/**
+ * Sorting
+ */
+QuickSort.prototype.sorting = function(array) {
+ return this.quickSort(array, 0, array.length);
+}
+
+
+JSSort = function() {}
+
+JSSort.prototype.compare = function(obj1, obj2) {
+ var obj1 = obj1[0];
+ var obj2 = obj2[0];
+ return ((obj1 == obj2) ? 0 : ((obj1 < obj2) ? -1 : 1));
+}
+
+/**
+ * Sorting
+ */
+JSSort.prototype.sorting = function(array) {
+ return array.sort(this.compare);
+}
+
+DataTable = function(tableId, defaultColumnIndex) {
+ this.table = document.getElementById(tableId);
+ this.sortedColumnIndex = defaultColumnIndex;
+ this.oldSortedColumnIndex = -1; //default value
+ this.sortedArray = null;
+ this.tbody = this.table.tBodies[0];
+
+ this.sortStrategy = new JSSort();
+
+ this.sortOrder = DataTable.ASCENDING;
+
+}
+
+DataTable.ASCENDING = "asc";
+DataTable.DESCENDING = "desc";
+
+/**
+ * Returns the cell text
+ */
+DataTable.prototype.getCellValue = function(targetTd) {
+ return targetTd.innerHTML;
+}
+
+
+DataTable.prototype.initTargetCollection = function(sortedColumnIndex) {
+ var targetCollection = new Array();
+ var currentRow = null;
+
+ for (var i = 0; i < this.tbody.rows.length; i++) {
+ targetCollection[i] = new Array();
+
+ currentRow = this.tbody.rows[i];
+ targetCollection[i][0] = this.getCellValue(currentRow.cells[this.sortedColumnIndex]);
+ targetCollection[i][1] = this.tbody.rows[i];
+ }
+
+ return targetCollection;
+}
+
+
+DataTable.prototype.sort = function(targetCollection) {
+ this.sortedArray = this.sortStrategy.sorting(targetCollection);
+}
+
+DataTable.prototype.reverse = function(targetCollection) {
+ this.sortedArray = targetCollection.reverse();
+}
+
+DataTable.prototype.singleSorting = function() {
+ var array = this.initTargetCollection(table.sortedColumnIndex);
+
+ if ((this.oldSortedColumnIndex == this.sortedColumnIndex)
+ && (this.sortOrder == DataTable.ASCENDING)) {
+ this.reverse(array);
+ this.sortOrder = DataTable.DESCENDING;
+ } else {
+ this.sort(array);
+ this.sortOrder = DataTable.ASCENDING;
+ }
+}
+
+DataTable.prototype.rebuildTable = function() {
+ var newTbody = document.createElement("tbody");
+ for (var i = 0; i < this.sortedArray.length; i++) {
+ newTbody.appendChild(this.sortedArray[i][1]);
+ }
+ //this.table.appendChild(newTbody);
+
+ this.tbody.parentNode.removeChild(this.tbody);
+ this.table.appendChild(newTbody);
+ this.tbody = this.table.tBodies[0];
+ //this.table.appendChild(newTbody);
+
+ this.oldSortedColumnIndex = this.sortedColumnIndex;
+}
+
+/*DataTable.prototype.rebuildTable1 = function() {
+ var newTbody = new StringBuilder();
+ for (var i = 0; i < this.sortedArray.length; i++) {
+ newTbody.append("<tr>");
+ newTbody.append(this.sortedArray[i][1].innerHTML);
+ newTbody.append("</tr>");
+ }
+ var content = newTbody.toString();
+ this.table.tBodies[0].innerHTML = content;
+ this.oldSortedColumnIndex = this.sortedColumnIndex;
+}*/
17 years, 2 months
JBoss Rich Faces SVN: r3545 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-10-25 13:03:59 -0400 (Thu, 25 Oct 2007)
New Revision: 3545
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
small fix: selectedDateElement changed to selectedDateCellId that contains ID string (was dom element)
RF-1132
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-25 16:30:07 UTC (rev 3544)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-25 17:03:59 UTC (rev 3545)
@@ -453,7 +453,7 @@
this.todayDate = new Date();
- this.selectedDateElement;
+ this.selectedDateCellId = null;
this.firstWeekendDayNumber = 6-this.params.firstWeekDay;
this.secondWeekendDayNumber = (this.params.firstWeekDay>0 ? 7-this.params.firstWeekDay : 0);
@@ -1026,9 +1026,9 @@
//var _d=new Date();
- if (this.selectedDateElement) {
- Element.classNames(this.selectedDateElement).remove("rich-calendar-select");
- this.selectedDateElement = null;
+ if (this.selectedDateCellId) {
+ Element.classNames(this.selectedDateCellId).remove("rich-calendar-select");
+ this.selectedDateCellId = null;
}
for (var k=1;k<7;k++)
@@ -1143,7 +1143,7 @@
}
if (selectedflag && dataobj._month==0 && dataobj.day==selecteddate) {
- this.selectedDateElement = element;
+ this.selectedDateCellId = element.id;
e.add("rich-calendar-select");
}
@@ -1326,8 +1326,8 @@
{
// find cell and change style class
var e = $(this.DATE_ELEMENT_ID+(this.firstDateIndex + this.selectedDate.getDate()-1));
- if (this.selectedDateElement) Element.removeClassName(this.selectedDateElement, "rich-calendar-select");
- this.selectedDateElement = e;
+ if (this.selectedDateCellId) Element.removeClassName(this.selectedDateCellId, "rich-calendar-select");
+ this.selectedDateCellId = e.id;
Element.addClassName(e, "rich-calendar-select");
this.renderHeader();
@@ -1344,10 +1344,10 @@
{
this.selectedDate = null;
field.value = "";
- if (this.selectedDateElement)
+ if (this.selectedDateCellId)
{
- Element.removeClassName(this.selectedDateElement, "rich-calendar-select");
- this.selectedDateElement = null;
+ Element.removeClassName(this.selectedDateCellId, "rich-calendar-select");
+ this.selectedDateCellId = null;
this.renderHeader();
this.renderFooter();
}
@@ -1378,10 +1378,10 @@
{
this.selectedDate = null;
$(this.INPUT_DATE_ID).value = "";
- if (this.selectedDateElement)
+ if (this.selectedDateCellId)
{
- Element.removeClassName(this.selectedDateElement, "rich-calendar-select");
- this.selectedDateElement = null;
+ Element.removeClassName(this.selectedDateCellId, "rich-calendar-select");
+ this.selectedDateCellId = null;
}
this.renderHeader();
this.renderFooter();
@@ -1399,6 +1399,11 @@
this.currentDate.setDate(1);
this.onUpdate();
}
+ else
+ {
+ // highlight Selected Date
+
+ }
}
});
17 years, 2 months
JBoss Rich Faces SVN: r3544 - in trunk/sandbox: samples/listShuttleDemo and 58 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-25 12:30:07 -0400 (Thu, 25 Oct 2007)
New Revision: 3544
Added:
trunk/sandbox/samples/listShuttleDemo/
trunk/sandbox/samples/listShuttleDemo/pom.xml
trunk/sandbox/samples/listShuttleDemo/src/
trunk/sandbox/samples/listShuttleDemo/src/main/
trunk/sandbox/samples/listShuttleDemo/src/main/java/
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/listShuttleDemo/src/main/resources/
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/listShuttleDemo/src/test/
trunk/sandbox/samples/listShuttleDemo/src/test/java/
trunk/sandbox/samples/listShuttleDemo/src/test/java/org/
trunk/sandbox/samples/listShuttleDemo/src/test/java/org/richfaces/
trunk/sandbox/samples/listShuttleDemo/src/test/java/org/richfaces/BeanTest.java
trunk/sandbox/samples/orderingListDemo/
trunk/sandbox/samples/orderingListDemo/pom.xml
trunk/sandbox/samples/orderingListDemo/src/
trunk/sandbox/samples/orderingListDemo/src/main/
trunk/sandbox/samples/orderingListDemo/src/main/java/
trunk/sandbox/samples/orderingListDemo/src/main/java/org/
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/orderingListDemo/src/main/resources/
trunk/sandbox/samples/orderingListDemo/src/main/webapp/
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/orderingListDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/
trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/orderingListDemo/src/test/
trunk/sandbox/samples/orderingListDemo/src/test/java/
trunk/sandbox/samples/orderingListDemo/src/test/java/org/
trunk/sandbox/samples/orderingListDemo/src/test/java/org/richfaces/
trunk/sandbox/samples/orderingListDemo/src/test/java/org/richfaces/BeanTest.java
trunk/sandbox/ui/listShuttle/
trunk/sandbox/ui/listShuttle/design/
trunk/sandbox/ui/listShuttle/pom.xml
trunk/sandbox/ui/listShuttle/src/
trunk/sandbox/ui/listShuttle/src/main/
trunk/sandbox/ui/listShuttle/src/main/config/
trunk/sandbox/ui/listShuttle/src/main/config/component/
trunk/sandbox/ui/listShuttle/src/main/config/component/README
trunk/sandbox/ui/listShuttle/src/main/java/
trunk/sandbox/ui/listShuttle/src/main/java/org/
trunk/sandbox/ui/listShuttle/src/main/java/org/richfaces/
trunk/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/
trunk/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/listShuttle/src/main/resources/
trunk/sandbox/ui/listShuttle/src/main/templates/
trunk/sandbox/ui/listShuttle/src/main/templates/README
trunk/sandbox/ui/listShuttle/src/test/
trunk/sandbox/ui/listShuttle/src/test/java/
trunk/sandbox/ui/listShuttle/src/test/java/org/
trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/
trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/component/
trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/component/JSFComponentTest.java
trunk/sandbox/ui/orderingList/
trunk/sandbox/ui/orderingList/design/
trunk/sandbox/ui/orderingList/pom.xml
trunk/sandbox/ui/orderingList/src/
trunk/sandbox/ui/orderingList/src/main/
trunk/sandbox/ui/orderingList/src/main/config/
trunk/sandbox/ui/orderingList/src/main/config/component/
trunk/sandbox/ui/orderingList/src/main/config/component/README
trunk/sandbox/ui/orderingList/src/main/java/
trunk/sandbox/ui/orderingList/src/main/java/org/
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/component/
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/orderingList/src/main/resources/
trunk/sandbox/ui/orderingList/src/main/templates/
trunk/sandbox/ui/orderingList/src/main/templates/README
trunk/sandbox/ui/orderingList/src/test/
trunk/sandbox/ui/orderingList/src/test/java/
trunk/sandbox/ui/orderingList/src/test/java/org/
trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/
trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/component/
trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/component/JSFComponentTest.java
Removed:
trunk/sandbox/ui/calendar/
Modified:
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
trunk/sandbox/ui/state/
trunk/sandbox/ui/treeTable/
Log:
Shuttle component placeholders added
Property changes on: trunk/sandbox/samples/listShuttleDemo
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/samples/listShuttleDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/pom.xml (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>listShuttleDemo</artifactId>
+ <packaging>war</packaging>
+ <name>listShuttleDemo Maven Webapp</name>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <finalName>listShuttleDemo</finalName>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/web.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/index.jsp 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.xhtml (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.xhtml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/listShuttleDemo/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/test/java/org/richfaces/BeanTest.java (rev 0)
+++ trunk/sandbox/samples/listShuttleDemo/src/test/java/org/richfaces/BeanTest.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
Property changes on: trunk/sandbox/samples/orderingListDemo
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/samples/orderingListDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/pom.xml (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>orderingListDemo</artifactId>
+ <packaging>war</packaging>
+ <name>orderingListDemo Maven Webapp</name>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <finalName>orderingListDemo</finalName>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/orderingListDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/index.jsp 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.xhtml (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.xhtml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/orderingListDemo/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/test/java/org/richfaces/BeanTest.java (rev 0)
+++ trunk/sandbox/samples/orderingListDemo/src/test/java/org/richfaces/BeanTest.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-10-25 16:27:09 UTC (rev 3543)
+++ trunk/sandbox/samples/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.richfaces</groupId>
@@ -14,5 +15,7 @@
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
+ <module>orderingListDemo</module>
+ <module>listShuttleDemo</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/listShuttle
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/ui/listShuttle/pom.xml
===================================================================
--- trunk/sandbox/ui/listShuttle/pom.xml (rev 0)
+++ trunk/sandbox/ui/listShuttle/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>listShuttle</artifactId>
+ <name>listShuttle</name>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>listShuttle</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/listShuttle/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/ui/listShuttle/src/main/templates/README
===================================================================
Added: trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/listShuttle/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+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.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
Property changes on: trunk/sandbox/ui/orderingList
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/ui/orderingList/pom.xml
===================================================================
--- trunk/sandbox/ui/orderingList/pom.xml (rev 0)
+++ trunk/sandbox/ui/orderingList/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>orderingList</artifactId>
+ <name>orderingList</name>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>orderingList</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/orderingList/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/ui/orderingList/src/main/templates/README
===================================================================
Added: trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/orderingList/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-10-25 16:30:07 UTC (rev 3544)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+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.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-10-25 16:27:09 UTC (rev 3543)
+++ trunk/sandbox/ui/pom.xml 2007-10-25 16:30:07 UTC (rev 3544)
@@ -13,8 +13,9 @@
<modules>
<module>panel2</module>
<module>simpleTogglePanel2</module>
- <module>state</module>
- <module>treeTable</module>
-
+ <module>state</module>
+ <module>treeTable</module>
+ <module>listShuttle</module>
+ <module>orderingList</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/state
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
Property changes on: trunk/sandbox/ui/treeTable
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
17 years, 2 months
JBoss Rich Faces SVN: r3543 - in trunk: samples/calendar-sample/src/main/webapp/pages and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-10-25 12:27:09 -0400 (Thu, 25 Oct 2007)
New Revision: 3543
Modified:
trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-1117
Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-10-25 16:07:57 UTC (rev 3542)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-10-25 16:27:09 UTC (rev 3543)
@@ -45,7 +45,8 @@
private boolean popup;
private boolean readonly;
private boolean showInput;
- private boolean enableManualInput;
+ private boolean enableManualInput;
+ private boolean disabled;
private String pattern;
private Date currentDate;
private Date selectedDate;
@@ -100,6 +101,7 @@
enableManualInput=false;
showInput=true;
boundary = "inactive";
+ disabled = false;
}
@@ -223,4 +225,12 @@
public int getCounter() {
return counter++;
}
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
}
\ No newline at end of file
Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-10-25 16:07:57 UTC (rev 3542)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-10-25 16:27:09 UTC (rev 3543)
@@ -20,9 +20,6 @@
.Selecteddayclass {
background-color: #0087FF;
}
- .even-day {
- background-color: #44aa00;
- }
</style>
</head>
<body>
@@ -54,6 +51,7 @@
direction="#{calendarBean.direction}"
buttonLabel="Select Date"
enableManualInput="#{calendarBean.enableManualInput}"
+ disabled="#{calendarBean.disabled}"
showInput="#{calendarBean.showInput}"
boundaryDatesMode="#{calendarBean.boundary}"
currentDateChangeListener="#{calendarBean.dcl}"
@@ -71,6 +69,8 @@
<h:outputText value="optionalFooter Facet" />
</f:facet>
+ <f:facet name="weekDay"><f:verbatim><span style="padding: 2px; font-size: 10px" >{weekDayLabel + weekDayLabelShort}</span></f:verbatim></f:facet>
+
<f:validator validatorId="org.richfaces.CalendarValidator" />
<h:panelGrid columns="2">
@@ -132,6 +132,10 @@
<h:selectBooleanCheckbox value="#{calendarBean.showInput}"
onclick="submit()">
</h:selectBooleanCheckbox>
+ <h:outputText value="Disabled:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{calendarBean.disabled}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-25 16:07:57 UTC (rev 3542)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-25 16:27:09 UTC (rev 3543)
@@ -570,6 +570,17 @@
if(this.params.submitFunction) this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
+
+ // add onclick event handlers to input field and popup button
+ if (this.params.popup && !this.params.disabled)
+ {
+ var handler = new Function ('event', "$('"+this.id+"').component.doSwitch();").bindAsEventListener();
+ Event.observe(this.POPUP_BUTTON_ID, "click", handler, false);
+ if (!this.params.enableManualInput)
+ {
+ Event.observe(this.INPUT_DATE_ID, "click", handler, false);
+ }
+ }
},
doCollapse: function() {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-25 16:07:57 UTC (rev 3542)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-25 16:27:09 UTC (rev 3543)
@@ -13,83 +13,6 @@
<h:styles>/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
- <div id="#{clientId}"
- style="z-index: #{component.attributes['zindex']}; #{component.attributes['style']}"
- class="rich-calendar-popup #{component.attributes['styleClass']}"
- x:passThruWithExclusions="value,name,type,id,styleClass,class,style">
- <script type="text/javascript">
- new Calendar('#{clientId}', {
-
- <jsp:scriptlet>/*<![CDATA[*/
- String mode = (String) component.getAttributes().get("mode");
- if(org.richfaces.component.UICalendar.AJAX_MODE.equals(mode)){
- /*]]>*/</jsp:scriptlet>
-
- submitFunction: <jsp:scriptlet>/*<![CDATA[*/writeSubmitFunction(context, component);/*]]>*/</jsp:scriptlet>,
-
- <jsp:scriptlet>/*<![CDATA[*/
- }
- /*]]>*/</jsp:scriptlet>
-
- dayListTableId: '#{clientId}Day',
- weekNumberBarId: '#{clientId}WeekNum',
- weekDayBarId: '#{clientId}WeekDay',
- currentDate: #{this:getCurrentDate(context, component)},
- selectedDate: #{this:getSelectedDate(context, component)},
- datePattern: '#{component.datePattern}',
- jointPoint: '#{component.jointPoint}',
- direction: '#{component.direction}',
- toolTipMode:'#{component.toolTipMode}',
- boundaryDatesMode:'#{component.boundaryDatesMode}',
- popup: #{component.popup},
- enableManualInput: #{component.attributes['enableManualInput']},
- showInput: #{component.attributes['showInput']},
- disabled: #{component.disabled},
- ajaxSingle: #{component.attributes['ajaxSingle']},
- verticalOffset:'#{component.verticalOffset}',
- horizontalOffset: '#{component.horizontalOffset}',
- cellHeight:'#{component.cellHeight}',
- cellWidth:'#{component.cellWidth}',
- <f:call name="writeDayStyleClass"/>
- <f:call name="writeIsDayEnabled"/>
- <f:call name="writeSymbols" />,
- firstWeekDay: #{this:getFirstWeekDay(context, component)},
- minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
-
- <f:call name="writeEventHandlerFunction"><f:parameter value="ondateselected" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="ondateselect" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseover" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseout" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="onexpand" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
-
-
-
- <jsp:scriptlet>/*<![CDATA[*/
- if (component.getChildCount() != 0) {
- /*]]>*/</jsp:scriptlet>
- ,dayListMarkup:
- <jsp:scriptlet>/*<![CDATA[*/
- writeMarkupScriptBody(context, component, true);
- }
- /*]]>*/</jsp:scriptlet>
-
- <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalHeader" /></f:call>
- <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalFooter" /></f:call>
-
- <f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekDay" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekNumber" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter value="header" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter value="footer" /></f:call>
-
- }).load(
- <jsp:scriptlet>/*<![CDATA[*/
- writePreloadBody(context, component);
- /*]]>*/</jsp:scriptlet>
- );
- </script></div>
-
<f:call name="addPopupToAjaxRendered" />
<span id="#{clientId}Popup"> <jsp:scriptlet>
@@ -101,20 +24,13 @@
boolean disabled = getUtils().isBooleanAttribute(component, "disabled");
boolean showInput = getUtils().isBooleanAttribute(component, "showInput");
boolean manualInput = getUtils().isBooleanAttribute(component, "enableManualInput");
+ variables.setVariable("manualInput",new Boolean(!manualInput));
String onfieldclick =null;
String type="text";
- if(manualInput){
- variables.setVariable("manualInput",new Boolean(!manualInput));
- }
- else{
- variables.setVariable("manualInput",new Boolean(!manualInput));
- onfieldclick = "$('"+clientId+"').component.doSwitch();";
- }
if (!showInput){
type="hidden";
}
- variables.setVariable("onfieldclick",onfieldclick);
variables.setVariable("type",type);
variables.setVariable("disabled",new Boolean(disabled));
]]>
@@ -133,7 +49,7 @@
onselect="#{component.attributes['oninputselect']}"
onfocus="#{component.attributes['oninputfocus']}"
onblur="#{component.attributes['oninputblur']}"
- onclick="#{onfieldclick} #{component.attributes['oninputclick']}"
+ onclick="#{component.attributes['oninputclick']}"
onkeypress="#{component.attributes['oninputkeypress']}"
onkeydown="#{component.attributes['oninputkeydown']}"
onkeyup="#{component.attributes['oninputkeyup']}"
@@ -152,14 +68,14 @@
]]>
</jsp:scriptlet> <img id="#{clientId}PopupButton"
class="rich-calendar-button #{component.attributes['buttonClass']}"
- accesskey="#{component.attributes['accesskey']}" name="#{clientId}"
+ accesskey="#{component.attributes['accesskey']}"
style="vertical-align: middle"
tabindex="#{component.attributes['tabindex']}">
<jsp:scriptlet>
<![CDATA[
if(!disabled){
- getUtils().writeAttribute(writer, "onclick", "$('"+clientId+"').component.doSwitch();");
+ //getUtils().writeAttribute(writer, "onclick", "$('"+clientId+"').component.doSwitch();");
if(buttonIcon==null){
getUtils().writeAttribute(writer, "src", variables.getVariable("icon"));
}
@@ -169,7 +85,7 @@
}
else{
- getUtils().writeAttribute(writer, "onclick", null);
+ //getUtils().writeAttribute(writer, "onclick", null);
if(buttonIconDisabled==null){
getUtils().writeAttribute(writer, "src", variables.getVariable("disabledIcon"));
}
@@ -184,8 +100,7 @@
else{
]]>
</jsp:scriptlet>
- <button type="button" id="#{clientId}PopupButton" name="#{clientId}"
- onclick="$('#{clientId}').component.doSwitch();return true; #{component.attributes['oninputclick']}"
+ <button type="button" id="#{clientId}PopupButton" name="#{clientId}PopupButton"
style="vertical-align: middle"
class="rich-calendar-button #{component.attributes['buttonClass']}"
tabindex="#{component.attributes['tabindex']}" disabled="#{disabled}">
@@ -199,4 +114,82 @@
}
]]>
</jsp:scriptlet> </span>
+
+ <div id="#{clientId}"
+ style="z-index: #{component.attributes['zindex']}; #{component.attributes['style']}"
+ class="rich-calendar-popup #{component.attributes['styleClass']}"
+ x:passThruWithExclusions="value,name,type,id,styleClass,class,style">
+ <script type="text/javascript">
+ new Calendar('#{clientId}', {
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ String mode = (String) component.getAttributes().get("mode");
+ if(org.richfaces.component.UICalendar.AJAX_MODE.equals(mode)){
+ /*]]>*/</jsp:scriptlet>
+
+ submitFunction: <jsp:scriptlet>/*<![CDATA[*/writeSubmitFunction(context, component);/*]]>*/</jsp:scriptlet>,
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ }
+ /*]]>*/</jsp:scriptlet>
+
+ dayListTableId: '#{clientId}Day',
+ weekNumberBarId: '#{clientId}WeekNum',
+ weekDayBarId: '#{clientId}WeekDay',
+ currentDate: #{this:getCurrentDate(context, component)},
+ selectedDate: #{this:getSelectedDate(context, component)},
+ datePattern: '#{component.datePattern}',
+ jointPoint: '#{component.jointPoint}',
+ direction: '#{component.direction}',
+ toolTipMode:'#{component.toolTipMode}',
+ boundaryDatesMode:'#{component.boundaryDatesMode}',
+ popup: #{component.popup},
+ enableManualInput: #{component.attributes['enableManualInput']},
+ showInput: #{component.attributes['showInput']},
+ disabled: #{component.disabled},
+ ajaxSingle: #{component.attributes['ajaxSingle']},
+ verticalOffset:'#{component.verticalOffset}',
+ horizontalOffset: '#{component.horizontalOffset}',
+ cellHeight:'#{component.cellHeight}',
+ cellWidth:'#{component.cellWidth}',
+ <f:call name="writeDayStyleClass"/>
+ <f:call name="writeIsDayEnabled"/>
+ <f:call name="writeSymbols" />,
+ firstWeekDay: #{this:getFirstWeekDay(context, component)},
+ minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
+
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ondateselected" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ondateselect" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseover" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseout" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="onexpand" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
+
+
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ if (component.getChildCount() != 0) {
+ /*]]>*/</jsp:scriptlet>
+ ,dayListMarkup:
+ <jsp:scriptlet>/*<![CDATA[*/
+ writeMarkupScriptBody(context, component, true);
+ }
+ /*]]>*/</jsp:scriptlet>
+
+ <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalHeader" /></f:call>
+ <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalFooter" /></f:call>
+
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekDay" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekNumber" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter value="header" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter value="footer" /></f:call>
+
+ }).load(
+ <jsp:scriptlet>/*<![CDATA[*/
+ writePreloadBody(context, component);
+ /*]]>*/</jsp:scriptlet>
+ );
+ </script></div>
+
</f:root>
17 years, 2 months
JBoss Rich Faces SVN: r3542 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-25 12:07:57 -0400 (Thu, 25 Oct 2007)
New Revision: 3542
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-1042 - chanchged section place in the guide.
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-25 15:15:16 UTC (rev 3541)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-25 16:07:57 UTC (rev 3542)
@@ -128,93 +128,8 @@
incorrect HTML code. </listitem>
</itemizedlist>
</section>
- <section id="HowTo...">
- <?dbhtml filename="HowTo.html"?>
- <title>How To...</title>
- <section id="SendAnAJAXRequest">
- <?dbhtml filename="SendAnAJAXRequest.html"?>
- <title>Send an Ajax request</title>
- <para>There are different ways to send Ajax requests from your JSF page. For example you can
- use <emphasis role="bold">
- <property><a4j:commandButton></property>
- </emphasis>, <emphasis role="bold">
- <property><a4j:commandLink></property>, <emphasis role="bold">
- <property><a4j:poll></property>
- </emphasis>
- </emphasis> or <emphasis role="bold">
- <property><a4j:support></property>
- </emphasis> tags or any other. </para>
- <para>All these tags hide the usual JavaScript activities that are required for an
- XMHttpRequest object building and an Ajax request sending. Also, they allow you to decide
- which components of your JSF page are to be re-rendered as a result of the Ajax response
- (you can list the IDs of these components in the "reRender" attribute). </para>
- <para>
- <emphasis role="bold">
- <property><a4j:commandButton></property>
- </emphasis> and <emphasis role="bold">
- <property><a4j:commandLink></property>
- </emphasis> tags are used to send an Ajax request on "onclick" JavaScript
- event. </para>
- <para>
- <emphasis role="bold">
- <property><a4j:poll></property>
- </emphasis> tag is used to send an Ajax request periodically using a timer. </para>
- <para>The <emphasis role="bold">
- <property><a4j:support></property>
- </emphasis> tag allows you to add Ajax functionality to standard JSF components and send
- Ajax request onto a chosen JavaScript event: "onkeyup",
- "onmouseover", etc. </para>
- <!--para>Most important attributes of components that provide Ajax request calling features are:</para>
- <itemizedlist>
- <listitem>
- <emphasis>
- <property>"reRender"</property>
- </emphasis>attribute as it was mentioned <link linkend="SendAnAJAXRequest">before</link>
- specifies components to be reRendered after Ajax response. The attribute can be specified
- using EL expression and formed dynamicaly on the server side (see <ulink
- url="index.html#FAQ">FAQ chapter</ulink>). </listitem>
- <listitem>
- <emphasis>
- <property>"RequestDelay"</property>
- </emphasis> attribute is used for a requests frequency regulation. </listitem>
- </itemizedlist>
- <programlisting role="XML"><![CDATA[<h:inputText size="50" value="#{bean.text}">
- <a4j:support event="onkeyup" RequestDelay="3"/>
-</h:inputText>]]></programlisting>
- <para>So every next request from the frequent keyboard events will be delayed on 3 ms to
- reduce the number of requests. </para>
- <itemizedlist>
- <listitem>
- <emphasis>
- <property>"EventsQueue"</property>
- </emphasis> is a queue that stores the next request. </listitem>
- <listitem>
- <emphasis>
- <property>"LimitToList"</property>
- </emphasis> attribute is used to regulate updatable regions. Setting it to true limits the
- updatable areas only to ones specified in a reRender list, in other case all Output Panels
- of the region are updated. </listitem>
- <listitem>
- <emphasis>
- <property>"ajaxSingle"</property>
- </emphasis> attributes specify regions to be sent with a request, if
- "false" it is a full region, in other case it's is only a
- control caused event. </listitem>
-
- <listitem>
- <emphasis>
- <property>"timeout"</property>
- </emphasis>attribute is used for response waiting time on a particular request. If a
- response is not received during this time, the request is aborted. </listitem>
-
- <listitem>
- <emphasis>
- <property>"ignoreDupResponses"</property>
- </emphasis> is used to abort unfinished request on new event. </listitem>
- </itemizedlist-->
- </section>
-
- <section id="AjaxRequestOptimization">
+
+ <section id="AjaxRequestOptimization">
<?dbhtml filename="AjaxRequestOptimization.html"?>
<title>Ajax Request Optimization</title>
<section id="Re-Rendering">
@@ -578,7 +493,95 @@
</section>
</section>
+
+ <section id="HowTo...">
+ <?dbhtml filename="HowTo.html"?>
+ <title>How To...</title>
+ <section id="SendAnAJAXRequest">
+ <?dbhtml filename="SendAnAJAXRequest.html"?>
+ <title>Send an Ajax request</title>
+ <para>There are different ways to send Ajax requests from your JSF page. For example you can
+ use <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>, <emphasis role="bold">
+ <property><a4j:commandLink></property>, <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis>
+ </emphasis> or <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> tags or any other. </para>
+ <para>All these tags hide the usual JavaScript activities that are required for an
+ XMHttpRequest object building and an Ajax request sending. Also, they allow you to decide
+ which components of your JSF page are to be re-rendered as a result of the Ajax response
+ (you can list the IDs of these components in the "reRender" attribute). </para>
+ <para>
+ <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis> and <emphasis role="bold">
+ <property><a4j:commandLink></property>
+ </emphasis> tags are used to send an Ajax request on "onclick" JavaScript
+ event. </para>
+ <para>
+ <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> tag is used to send an Ajax request periodically using a timer. </para>
+ <para>The <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> tag allows you to add Ajax functionality to standard JSF components and send
+ Ajax request onto a chosen JavaScript event: "onkeyup",
+ "onmouseover", etc. </para>
+ <!--para>Most important attributes of components that provide Ajax request calling features are:</para>
+ <itemizedlist>
+ <listitem>
+ <emphasis>
+ <property>"reRender"</property>
+ </emphasis>attribute as it was mentioned <link linkend="SendAnAJAXRequest">before</link>
+ specifies components to be reRendered after Ajax response. The attribute can be specified
+ using EL expression and formed dynamicaly on the server side (see <ulink
+ url="index.html#FAQ">FAQ chapter</ulink>). </listitem>
+ <listitem>
+ <emphasis>
+ <property>"RequestDelay"</property>
+ </emphasis> attribute is used for a requests frequency regulation. </listitem>
+ </itemizedlist>
+ <programlisting role="XML"><![CDATA[<h:inputText size="50" value="#{bean.text}">
+ <a4j:support event="onkeyup" RequestDelay="3"/>
+</h:inputText>]]></programlisting>
+ <para>So every next request from the frequent keyboard events will be delayed on 3 ms to
+ reduce the number of requests. </para>
+ <itemizedlist>
+ <listitem>
+ <emphasis>
+ <property>"EventsQueue"</property>
+ </emphasis> is a queue that stores the next request. </listitem>
+ <listitem>
+ <emphasis>
+ <property>"LimitToList"</property>
+ </emphasis> attribute is used to regulate updatable regions. Setting it to true limits the
+ updatable areas only to ones specified in a reRender list, in other case all Output Panels
+ of the region are updated. </listitem>
+ <listitem>
+ <emphasis>
+ <property>"ajaxSingle"</property>
+ </emphasis> attributes specify regions to be sent with a request, if
+ "false" it is a full region, in other case it's is only a
+ control caused event. </listitem>
+ <listitem>
+ <emphasis>
+ <property>"timeout"</property>
+ </emphasis>attribute is used for response waiting time on a particular request. If a
+ response is not received during this time, the request is aborted. </listitem>
+
+ <listitem>
+ <emphasis>
+ <property>"ignoreDupResponses"</property>
+ </emphasis> is used to abort unfinished request on new event. </listitem>
+ </itemizedlist-->
+ </section>
+
+
+
<section id="DecideWhatToSend">
<?dbhtml filename="DecideWhatToSend.html"?>
<title>Decide What to Send</title>
17 years, 2 months
JBoss Rich Faces SVN: r3541 - trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-25 11:15:16 -0400 (Thu, 25 Oct 2007)
New Revision: 3541
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxListenerTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxPageTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxStatusTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxSupportTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/KeepAliveTag.java
Log:
http://jira.jboss.com/jira/browse/RF-999
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -22,16 +22,16 @@
package org.ajax4jsf.taglib.html.jsp;
import javax.el.ValueExpression;
-import javax.faces.application.Application;
import javax.faces.component.ActionSource;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.UIComponentClassicTagBase;
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.UIActionParameter;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
+import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
/**
@@ -63,17 +63,18 @@
// value already implemented in UIComponentTagBase
private ValueExpression _name;
private ValueExpression _assignTo;
- private String _converter;
- private String _noEscape;
+ private ValueExpression _converter;
+ private ValueExpression _noEscape;
protected void setProperties(UIComponent component)
{
super.setProperties(component);
- setStringProperty(component, "name", _name.getExpressionString());
+ setStringProperty(component, "name", _name);
setBooleanProperty(component, "noEscape", _noEscape);
//Find parent UIComponentTag
- UIComponentTag componentTag = UIComponentTag.getParentUIComponentTag(pageContext);
+ UIComponentClassicTagBase componentTag =
+ UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);
if (componentTag == null)
{
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_UI_COMPONENT_TAG_ANCESTOR_ERROR, "ActionParameterTag"));
@@ -85,16 +86,19 @@
UIComponent parentComponent = componentTag.getComponentInstance();
if (parentComponent instanceof ActionSource)
{
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
- if (_assignTo != null) {
- if (!UIComponentTag.isValueReference(_assignTo.getExpressionString())) throw new IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR_2, _assignTo));
+
+ if (_assignTo != null) {
+ if (_assignTo.isLiteralText()) throw new IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR_2, _assignTo));
UIActionParameter al = (UIActionParameter)component;
- al.setAssignToBinding(application.createValueBinding(_assignTo.getExpressionString()));
+ al.setAssignToBinding(new ValueBindingValueExpressionAdaptor(_assignTo));
if (_converter != null)
{
- Converter converter = application.createConverter(_converter);
- al.setConverter(converter);
+ if (!_converter.isLiteralText()) {
+ component.setValueExpression("converter", _converter);
+ } else {
+ Converter conv = FacesContext.getCurrentInstance().getApplication().createConverter(_converter.getExpressionString());
+ al.setConverter(conv);
+ }
}
((ActionSource)parentComponent).addActionListener(al);
}
@@ -111,7 +115,7 @@
/**
* @param converter The converter to set.
*/
- public void setConverter(String converter)
+ public void setConverter(ValueExpression converter)
{
this._converter = converter;
}
@@ -119,7 +123,7 @@
/**
* @param noEscape The noEscape to set.
*/
- public void setNoEscape(String noEscape)
+ public void setNoEscape(ValueExpression noEscape)
{
this._noEscape = noEscape;
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxListenerTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxListenerTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxListenerTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,11 +21,10 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.el.ReferenceSyntaxException;
-import javax.faces.el.ValueBinding;
-import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.UIComponentClassicTagBase;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
@@ -34,6 +33,7 @@
import org.ajax4jsf.event.AjaxListener;
import org.ajax4jsf.event.AjaxListenerHelper;
import org.ajax4jsf.event.AjaxSource;
+import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
/**
@@ -51,9 +51,9 @@
/**
* class name for ajax events listener.
*/
- private String type = null;
+ private ValueExpression type = null;
- private String binding = null;
+ private ValueExpression binding = null;
/**
*
@@ -61,14 +61,14 @@
public AjaxListenerTag() {
}
- public void setType(String type) {
+ public void setType(ValueExpression type) {
this.type = type;
}
/**
* @param binding the binding to set
*/
- public void setBinding(String binding) {
+ public void setBinding(ValueExpression binding) {
this.binding = binding;
}
@@ -78,8 +78,8 @@
}
//Find parent UIComponentTag
- UIComponentTag componentTag = UIComponentTag
- .getParentUIComponentTag(pageContext);
+ UIComponentClassicTagBase componentTag =
+ UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);
if (componentTag == null) {
throw new JspException(
Messages.getMessage(Messages.NO_UI_COMPONENT_TAG_ANCESTOR_ERROR, "AjaxListenerTag"));
@@ -91,28 +91,13 @@
if (component instanceof AjaxSource) {
AjaxListener listener;
if(null != binding){
- ValueBinding valueBinding;
- try {
- valueBinding = FacesContext.getCurrentInstance().getApplication().createValueBinding(binding);
- } catch (ReferenceSyntaxException e) {
- throw new JspException(e);
- }
- listener = new AjaxListenerHelper(valueBinding);
+ listener = new AjaxListenerHelper(new ValueBindingValueExpressionAdaptor(binding));
} else {
- String className;
- if (UIComponentTag.isValueReference(type)) {
- FacesContext facesContext = FacesContext
- .getCurrentInstance();
- ValueBinding valueBinding = facesContext.getApplication()
- .createValueBinding(type);
- className = (String) valueBinding.getValue(facesContext);
- } else {
- className = type;
- }
try {
+ String className = (String) type.getValue(FacesContext.getCurrentInstance().getELContext());
listener = (AjaxListener) Class.forName(className).newInstance();
} catch (Exception e) {
- throw new JspException(Messages.getMessage(Messages.INSTANTIATE_LISTENER_ERROR, className, component.getId()), e);
+ throw new JspException(Messages.getMessage(Messages.INSTANTIATE_LISTENER_ERROR, type, component.getId()), e);
}
}
((AjaxSource) component).addAjaxListener(listener);
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxPageTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxPageTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxPageTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,6 +21,7 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import org.ajax4jsf.renderkit.html.AjaxPageRenderer;
@@ -35,8 +36,8 @@
*/
public class AjaxPageTag extends AjaxRegionTag {
- private String onload;
- private String onunload;
+ private ValueExpression onload;
+ private ValueExpression onunload;
/* (non-Javadoc)
* @see javax.faces.webapp.UIComponentTag#getRendererType()
@@ -63,25 +64,25 @@
/**
* @return Returns the onload.
*/
- public String getOnload() {
+ public ValueExpression getOnload() {
return onload;
}
/**
* @return Returns the onunload.
*/
- public String getOnunload() {
+ public ValueExpression getOnunload() {
return onunload;
}
/**
* @param onload The onload to set.
*/
- public void setOnload(String onload) {
+ public void setOnload(ValueExpression onload) {
this.onload = onload;
}
/**
* @param onunload The onunload to set.
*/
- public void setOnunload(String onunload) {
+ public void setOnunload(ValueExpression onunload) {
this.onunload = onunload;
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,15 +21,16 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
-import javax.faces.el.MethodBinding;
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxContainer;
import org.ajax4jsf.component.UIAjaxRegion;
-import org.ajax4jsf.event.AjaxListener;
import org.ajax4jsf.renderkit.html.AjaxRegionRenderer;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
+import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
/**
@@ -42,15 +43,15 @@
*/
public class AjaxRegionTag extends UIComponentTagBase {
- private String ajaxListener = null;
+ private MethodExpression ajaxListener = null;
- private String reRender = null;
+ private ValueExpression reRender = null;
- private String immediate = null;
+ private ValueExpression immediate = null;
- private String selfRendered = null;
+ private ValueExpression selfRendered = null;
- private String javascriptLocation = null;
+ private ValueExpression javascriptLocation = null;
/**
*
@@ -109,14 +110,10 @@
if (!(component instanceof AjaxContainer)) {
throw new IllegalArgumentException(Messages.getMessage(Messages.NOT_AJAX_CONTAINER_ERROR, component.getClientId(getFacesContext())));
}
- if (isValueReference(ajaxListener)) {
- MethodBinding mb = getFacesContext().getApplication()
- .createMethodBinding(ajaxListener,
- AjaxListener.AJAX_LISTENER_ARGS);
- ((AjaxContainer) component).setAjaxListener(mb);
- } else {
+ if (ajaxListener.isLiteralText()) {
getFacesContext().getExternalContext().log(Messages.getMessage(Messages.INVALID_EXPRESSION, ajaxListener));
}
+ ((AjaxContainer) component).setAjaxListener(new MethodBindingMethodExpressionAdaptor(ajaxListener));
}
}
@@ -125,7 +122,7 @@
* @param ajaxAreas
* The ajaxAreas to set.
*/
- public void setReRender(String ajaxAreas) {
+ public void setReRender(ValueExpression ajaxAreas) {
this.reRender = ajaxAreas;
}
@@ -133,7 +130,7 @@
* @param ajaxListener
* The ajaxListener to set.
*/
- public void setAjaxListener(String ajaxListener) {
+ public void setAjaxListener(MethodExpression ajaxListener) {
this.ajaxListener = ajaxListener;
}
@@ -141,14 +138,14 @@
* @param immediate
* The immediate to set.
*/
- public void setImmediate(String immediate) {
+ public void setImmediate(ValueExpression immediate) {
this.immediate = immediate;
}
/**
* @param selfRendered The selfRendered to set.
*/
- public void setSelfRendered(String selfRendered) {
+ public void setSelfRendered(ValueExpression selfRendered) {
this.selfRendered = selfRendered;
}
@@ -156,7 +153,7 @@
// return javascriptLocation;
// }
//
- public void setJavascriptLocation(String javascriptLocation) {
+ public void setJavascriptLocation(ValueExpression javascriptLocation) {
this.javascriptLocation = javascriptLocation;
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxStatusTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxStatusTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxStatusTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,6 +21,7 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import org.ajax4jsf.component.UIAjaxStatus;
@@ -38,37 +39,37 @@
public class AjaxStatusTag extends HtmlComponentTagBase
{
- private String _for = null;
+ private ValueExpression _for = null;
/**
* Text to output on start request
*/
- private String _startText = null;
+ private ValueExpression _startText = null;
/**
* Text to display on complete request
*/
- private String _stopText = null;
+ private ValueExpression _stopText = null;
/**
* Style for display on start request
*/
- private String _startStyle = null;
+ private ValueExpression _startStyle = null;
/**
* Style for displaying on complete
*/
- private String _stopStyle = null;
+ private ValueExpression _stopStyle = null;
/**
* Style class for display on request
*/
- private String _startStyleClass = null;
+ private ValueExpression _startStyleClass = null;
/**
* Style class for display on complete request
*/
- private String _stopStyleClass = null;
+ private ValueExpression _stopStyleClass = null;
/**
* Force id to render in Html as is
*/
- private String _forceId = null;
+ private ValueExpression _forceId = null;
/* (non-Javadoc)
* @see javax.faces.webapp.UIComponentTag#getComponentType()
*/
@@ -125,7 +126,7 @@
/**
* @param _for The _for to set.
*/
- public void setFor(String _for)
+ public void setFor(ValueExpression _for)
{
this._for = _for;
}
@@ -133,7 +134,7 @@
/**
* @param style The _startStyle to set.
*/
- public void setStartStyle(String style)
+ public void setStartStyle(ValueExpression style)
{
_startStyle = style;
}
@@ -141,7 +142,7 @@
/**
* @param styleClass The _startStyleClass to set.
*/
- public void setStartStyleClass(String styleClass)
+ public void setStartStyleClass(ValueExpression styleClass)
{
_startStyleClass = styleClass;
}
@@ -149,7 +150,7 @@
/**
* @param text The _startText to set.
*/
- public void setStartText(String text)
+ public void setStartText(ValueExpression text)
{
_startText = text;
}
@@ -157,7 +158,7 @@
/**
* @param stopText The stopText to set.
*/
- public void setStopText(String stopText)
+ public void setStopText(ValueExpression stopText)
{
this._stopText = stopText;
}
@@ -165,7 +166,7 @@
/**
* @param style The _stopStyle to set.
*/
- public void setStopStyle(String style)
+ public void setStopStyle(ValueExpression style)
{
_stopStyle = style;
}
@@ -173,7 +174,7 @@
/**
* @param styleClass The _stopStyleClass to set.
*/
- public void setStopStyleClass(String styleClass)
+ public void setStopStyleClass(ValueExpression styleClass)
{
_stopStyleClass = styleClass;
}
@@ -181,7 +182,7 @@
/**
* @param forceId The forceId to set.
*/
- public void setForceId(String forceId)
+ public void setForceId(ValueExpression forceId)
{
this._forceId = forceId;
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxSupportTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxSupportTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxSupportTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,8 +21,10 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
-import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.UIComponentClassicTagBase;
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.UIAjaxSupport;
@@ -62,31 +64,31 @@
* Id ( in form of findComponent method param ) of JSF component,
* updated by this component ( parnt tag ) action.
*/
- private String reRender = null;
+ private ValueExpression reRender = null;
/**
* Generate script for given event ( onclick, onenter ... )
*/
- private String event = null;
+ private ValueExpression event = null;
/**
* Id of request status component.
*/
- private String status = null;
+ private ValueExpression status = null;
/**
* JavaScript function for call after request completed.
*/
- private String oncomplete = null ;
+ private ValueExpression oncomplete = null ;
- private String action = null;
- private String actionListener = null;
- private String limitToList = null;
- private String disableDefault = null;
- private String value = null;
- private String immediate = null;
- private String ajaxSingle = null;
+ private MethodExpression action = null;
+ private MethodExpression actionListener = null;
+ private ValueExpression limitToList = null;
+ private ValueExpression disableDefault = null;
+ private ValueExpression value = null;
+ private ValueExpression immediate = null;
+ private ValueExpression ajaxSingle = null;
@@ -94,7 +96,7 @@
/**
* @param type The type to set.
*/
- public void setDisableDefault(String ajaxType)
+ public void setDisableDefault(ValueExpression ajaxType)
{
this.disableDefault = ajaxType;
}
@@ -103,7 +105,7 @@
* @param reRender
* The targetId to set.
*/
- public void setReRender(String ajaxId) {
+ public void setReRender(ValueExpression ajaxId) {
this.reRender = ajaxId;
}
@@ -111,7 +113,7 @@
/**
* @param event The event to set.
*/
- public void setEvent(String event)
+ public void setEvent(ValueExpression event)
{
this.event = event;
}
@@ -119,7 +121,7 @@
/**
* @param oncomplete The oncomplete to set.
*/
- public void setOncomplete(String oncomplete)
+ public void setOncomplete(ValueExpression oncomplete)
{
this.oncomplete = oncomplete;
}
@@ -127,7 +129,7 @@
/**
* @param status The status to set.
*/
- public void setStatus(String status)
+ public void setStatus(ValueExpression status)
{
this.status = status;
}
@@ -135,7 +137,7 @@
/**
* @param limitToList The submitForm to set.
*/
- public void setLimitToList(String limitToList)
+ public void setLimitToList(ValueExpression limitToList)
{
this.limitToList = limitToList;
}
@@ -143,7 +145,7 @@
/**
* @param action The action to set.
*/
- public void setAction(String action)
+ public void setAction(MethodExpression action)
{
this.action = action;
}
@@ -151,7 +153,7 @@
/**
* @param actionListener The actionListener to set.
*/
- public void setActionListener(String actionListener)
+ public void setActionListener(MethodExpression actionListener)
{
this.actionListener = actionListener;
}
@@ -159,9 +161,9 @@
protected void setParentProperties(UIAjaxSupport uiComponent) {
//Find parent UIComponentTag
- UIComponentTag componentTag = null;
+ UIComponentClassicTagBase componentTag = null;
try {
- componentTag = UIComponentTag.getParentUIComponentTag(pageContext);
+ componentTag = UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);
if (componentTag == null) {
throw new IllegalArgumentException(
Messages.getMessage(Messages.NO_UI_COMPONENT_TAG_ANCESTOR_ERROR, "AjaxSupportTag"));
@@ -217,21 +219,21 @@
/**
* @param value The value to set.
*/
- public void setValue(String value) {
+ public void setValue(ValueExpression value) {
this.value = value;
}
/**
* @param immediate The immediate to set.
*/
- public void setImmediate(String immediate) {
+ public void setImmediate(ValueExpression immediate) {
this.immediate = immediate;
}
/**
* @param ajaxSingle The ajaxSingle to set.
*/
- public void setAjaxSingle(String ajaxSingle) {
+ public void setAjaxSingle(ValueExpression ajaxSingle) {
this.ajaxSingle = ajaxSingle;
}
@@ -256,12 +258,15 @@
setParentProperties((UIAjaxSupport) component);
}
+
private void setReRenderProperty(UIComponent component) {
if (reRender != null) {
- if (isValueReference(reRender)) {
+ if (reRender.isLiteralText()) {
setStringProperty(component, "reRender", reRender);
} else {
- ((UIAjaxSupport) component).setReRender( AjaxRendererUtils.asSet(reRender));
+ //FIXME: Why do we evaluate reRender right now?
+ //Collection can change any time.
+ ((UIAjaxSupport) component).setReRender( AjaxRendererUtils.asSet(reRender.getValue(getELContext())));
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -180,7 +180,7 @@
throw new FacesException(e);
}
} else {
- component.setValueExpression("value", this.viewId);
+ component.setValueExpression("viewId", this.viewId);
}
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/KeepAliveTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/KeepAliveTag.java 2007-10-25 15:15:06 UTC (rev 3540)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/KeepAliveTag.java 2007-10-25 15:15:16 UTC (rev 3541)
@@ -21,9 +21,11 @@
package org.ajax4jsf.taglib.html.jsp;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.application.Application;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
@@ -44,19 +46,19 @@
private String beanName = null;
- private String ajaxOnly = null;
+ private ValueExpression ajaxOnly = null;
/**
* @return the ajaxOnly
*/
- public String getAjaxOnly() {
+ public ValueExpression getAjaxOnly() {
return ajaxOnly;
}
/**
* @param ajaxOnly the ajaxOnly to set
*/
- public void setAjaxOnly(String ajaxOnly) {
+ public void setAjaxOnly(ValueExpression ajaxOnly) {
this.ajaxOnly = ajaxOnly;
}
@@ -81,28 +83,34 @@
if (beanName == null) {
throw new JspException(Messages.getMessage(Messages.NULL_TYPE_ATTRIBUTE_ERROR));
}
- if(UIComponentTag.isValueReference(beanName)){
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Application application = facesContext.getApplication();
+ ExpressionFactory factory = application.getExpressionFactory();
+ ELContext elContext = facesContext.getELContext();
+ ValueExpression beanNameEL =
+ factory.createValueExpression(elContext, beanName, String.class);
+ if(!beanNameEL.isLiteralText()){
throw new JspException(Messages.getMessage(Messages.NAME_MUST_BE_LITERAL));
}
boolean isAjaxOnly = false;
- FacesContext facesContext = FacesContext.getCurrentInstance();
if (null != ajaxOnly) {
- if (UIComponentTag.isValueReference(ajaxOnly))
+ if (ajaxOnly.isLiteralText())
{
- ValueBinding vb = facesContext.getApplication().createValueBinding(ajaxOnly);
- isAjaxOnly = Boolean.TRUE.equals(vb.getValue(facesContext));
+ //TODO: More sophisticated way to convert boolean value (yes/no, 1/0, on/off, etc.)
+ isAjaxOnly = Boolean.parseBoolean(ajaxOnly.getExpressionString());
}
else
{
- //TODO: More sophisticated way to convert boolean value (yes/no, 1/0, on/off, etc.)
- isAjaxOnly = Boolean.parseBoolean(ajaxOnly);
+ isAjaxOnly = Boolean.TRUE.equals(ajaxOnly.getValue(elContext));
}
}
// Get bean instance from EL expression.
String beanExpression = "#{"+beanName+"}";
- ValueBinding valueBinding = facesContext.getApplication().createValueBinding(beanExpression);
- Object bean = valueBinding.getValue(facesContext);
+ ValueExpression valueExpression =
+ factory.createValueExpression(elContext, beanExpression, Object.class);
+ Object bean = valueExpression.getValue(elContext);
// Put bean instance to ViewRoot.
String beanAttributeName = isAjaxOnly?AjaxPhaseListener.AJAX_BEAN_PREFIX:AjaxPhaseListener.VIEW_BEAN_PREFIX+beanName;
facesContext.getViewRoot().getAttributes().put(beanAttributeName, bean);
17 years, 2 months
JBoss Rich Faces SVN: r3540 - in trunk/framework/impl/src/main/java/org/ajax4jsf: webapp/taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-25 11:15:06 -0400 (Thu, 25 Oct 2007)
New Revision: 3540
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
Log:
http://jira.jboss.com/jira/browse/RF-999
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java 2007-10-25 14:48:37 UTC (rev 3539)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java 2007-10-25 15:15:06 UTC (rev 3540)
@@ -28,9 +28,6 @@
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
-import org.ajax4jsf.event.AjaxEvent;
-import org.ajax4jsf.event.AjaxListener;
-
/**
* Helper class to keep reference to listener binded as EL-expression.
* @author shura
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2007-10-25 14:48:37 UTC (rev 3539)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2007-10-25 15:15:06 UTC (rev 3540)
@@ -27,22 +27,56 @@
return getFacesContext().getApplication().getExpressionFactory();
}
+ protected void setProperty(UIComponent component, String propName, ValueExpression valueExpression) {
+ if (valueExpression != null) {
+ if (valueExpression.isLiteralText()) {
+ component.getAttributes().put(propName,valueExpression.getValue(getELContext()));
+ } else {
+ component.setValueExpression(propName, valueExpression);
+ }
+ }
+ }
+
protected void setProperty(UIComponent component, Class<?> type,
String propName, String value) {
if (value != null) {
ValueExpression valueExpression = getExpressionFactory()
.createValueExpression(getELContext(), value, type);
-
- if (valueExpression.isLiteralText()) {
- component.getAttributes().put(propName,
- getExpressionFactory().coerceToType(value, type));
- } else {
- component.setValueExpression(propName, valueExpression);
- }
+ setProperty(component, propName, valueExpression);
}
}
protected void setIntegerProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setLongProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setFloatProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setDoubleProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setStringProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setBooleanProperty(UIComponent component, String propName,
+ ValueExpression value) {
+ setProperty(component, propName, value);
+ }
+
+ protected void setIntegerProperty(UIComponent component, String propName,
String value) {
setProperty(component, Integer.class, propName, value);
}
@@ -71,12 +105,17 @@
String value) {
setProperty(component, Boolean.class, propName, value);
}
-
protected void setValueProperty(UIComponent component, String value) {
if (value != null) {
ValueExpression expression = getExpressionFactory()
.createValueExpression(getELContext(), value, Object.class);
+ setValueProperty(component, expression);
+ }
+ }
+ protected void setValueProperty(UIComponent component, ValueExpression expression) {
+ if (expression != null) {
+ String value = expression.getExpressionString();
if (!expression.isLiteralText()) {
component.setValueExpression("value", expression);
} else if (component instanceof UICommand) {
17 years, 2 months
JBoss Rich Faces SVN: r3539 - branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel.
by richfaces-svn-commits@lists.jboss.org
Author: viktor_volkov
Date: 2007-10-25 10:48:37 -0400 (Thu, 25 Oct 2007)
New Revision: 3539
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml
Log:
Adding components to Panel in Richpanels application
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml 2007-10-25 14:07:36 UTC (rev 3538)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml 2007-10-25 14:48:37 UTC (rev 3539)
@@ -1,71 +1,99 @@
-<f:subview id="panelSubviewID"
- xmlns:rich="http://richfaces.org/rich"
+<h:form xmlns:rich="http://richfaces.org/rich"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jstl/core">
- <h:form>
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:outputText
- value="Panel 1, rendered: #{!panel.rendered}; Panel 2, rendered #{panel.rendered};"></h:outputText>
+ <rich:spacer width="10" height="50"></rich:spacer>
+
+ <rich:panel rendered="true" id="any"
+ style="width:#{panel.width};height:#{panel.height};overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:any"></h:outputText>
+ </f:facet>
- <rich:panel rendered="#{!panel.rendered}" id="p1"
- style="width:#{panel.width};height:#{panel.height};overflow:auto;">
- <f:facet name="header">
- <h:outputText id="t1" value="#{panel.title[0]} (Panel 1)" />
- </f:facet>
+ </rich:panel>
+
+ <rich:panel rendered="true" id="Panel"
+ style="width:500px;height:700px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:panel"></h:outputText>
+ </f:facet>
+ <ui:include src="/Panel/Panel.xhtml" />
+ </rich:panel>
- <rich:panel>
- <f:facet name="header">
- <h:outputText id="t2" value="#{panel.title[1]}" />
- </f:facet>
- <h:panelGrid columns="2">
- <h:outputText id="o1" value="width #{panel.title[2]}, eg. 250px"></h:outputText>
- <h:inputText value="#{w}">
- <a4j:support event="onchange" reRender="p3"></a4j:support>
- </h:inputText>
+ <rich:spacer width="10" height="50"></rich:spacer>
- <h:outputText id="o2" value="height #{panel.title[2]}, eg. 200px"></h:outputText>
- <h:inputText value="#{h}">
- <a4j:support event="onchange" reRender="p3"></a4j:support>
- </h:inputText>
- </h:panelGrid>
+ <rich:panel rendered="true" id="Calendar"
+ style="width:900px;height:850px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:calendar"></h:outputText>
+ </f:facet>
+ <ui:include src="/Calendar/Calendar.xhtml" />
+ </rich:panel>
- <rich:panel id="p3" style="width:#{w};height:#{h};overflow:auto;">
- <f:facet name="header">
- <h:outputText id="t3" value="#{panel.title[2]}" />
- </f:facet>
- <h:graphicImage value="/pics/asus.jpg" width="150" height="100"></h:graphicImage>
- </rich:panel>
- </rich:panel>
- </rich:panel>
+ <rich:spacer width="10" height="50"></rich:spacer>
- <rich:panel onmousedown="alert('OnMouseDown');" id="panelId"
- onclick="submit()" rendered="#{panel.rendered}"
- style="width:#{panel.width};height:#{panel.height}">
- <f:verbatim>This is panel 2 example...</f:verbatim>
+ <rich:panel rendered="true" id="DataFilterSlider"
+ style="width:500px;height:500px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:dataFilterSlider"></h:outputText>
+ </f:facet>
+ <ui:include src="/DataFilterSlider/DataFilterSlider.xhtml" />
+ </rich:panel>
- </rich:panel>
+ <rich:spacer width="10" height="50"></rich:spacer>
- <h:panelGrid columns="2" cellpadding="10px">
- <h:outputText value="Title"></h:outputText>
- <h:inputText valueChangeListener="#{panel.makeTitle}">
- <a4j:support event="onchange" reRender="t1,t2,t3,o1,o2"></a4j:support>
- </h:inputText>
+ <rich:panel rendered="true" id="DataScroller"
+ style="width:500px;height:500px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:datascroller"></h:outputText>
+ </f:facet>
+ <ui:include src="/DataScroller/DS.xhtml" />
+ </rich:panel>
- <h:outputText value="Width: "></h:outputText>
- <h:inputText value="#{panel.width}">
- <a4j:support event="onchange" reRender="panelId,p1"></a4j:support>
- </h:inputText>
+ <rich:spacer width="10" height="50"></rich:spacer>
+
+ <rich:panel rendered="true" id="DataTable"
+ style="width:600px;height:1900px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:dataTable"></h:outputText>
+ </f:facet>
+ <ui:include src="/DataTable/DT.xhtml" />
+ </rich:panel>
+
+ <rich:spacer width="10" height="50"></rich:spacer>
+
+ <rich:panel rendered="true" id="DragAndDrop"
+ style="width:700px;height:800px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:dragSupport, rich:dropSupport, rich:dragIndicator, rich:dndParam "></h:outputText>
+ </f:facet>
+ <ui:include src="/DragAndDrop/DragAndDrop.xhtml" />
+ </rich:panel>
+
+ <rich:spacer width="10" height="50"></rich:spacer>
+
+ <rich:panel rendered="true" id="DropDownMenu"
+ style="500px;height:500px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:dropDownMenu"></h:outputText>
+ </f:facet>
+ <ui:include src="/DropDownMenu/DDMenu.xhtml" />
+ </rich:panel>
+
+ <rich:spacer width="10" height="50"></rich:spacer>
+
+ <rich:panel rendered="true" id="Effect"
+ style="width:500px;height:500px;overflow:auto;">
+ <f:facet name="header">
+ <h:outputText value="rich:effect"></h:outputText>
+ </f:facet>
+ <ui:include src="/Effect/Effect.xhtml" />
+ </rich:panel>
- <h:outputText value="Height: "></h:outputText>
- <h:inputText value="#{panel.height}">
- <a4j:support event="onchange" reRender="panelId,p1"></a4j:support>
- </h:inputText>
- <h:outputText value="Rendered:"></h:outputText>
- <h:selectBooleanCheckbox value="#{panel.rendered}" onclick="submit()"></h:selectBooleanCheckbox>
- </h:panelGrid>
- </h:form>
-</f:subview>
+</h:form>
+
17 years, 2 months
JBoss Rich Faces SVN: r3538 - trunk/ui/togglePanel/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-25 10:07:36 -0400 (Thu, 25 Oct 2007)
New Revision: 3538
Modified:
trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
Log:
RF-1240
Modified: trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
===================================================================
--- trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2007-10-25 13:44:00 UTC (rev 3537)
+++ trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2007-10-25 14:07:36 UTC (rev 3538)
@@ -145,6 +145,8 @@
HtmlElement div = page.getHtmlElementById(togglePanel
.getClientId(facesContext));
+ String classAttr0 = div.getAttributeValue("class");
+ assertTrue(classAttr0.contains("rich-toggle-panel"));
assertNotNull(div);
assertEquals("div", div.getNodeName());
@@ -232,7 +234,8 @@
togglePanel.broadcast(new SwitchablePanelSwitchEvent(togglePanel,
"null", toggleControl));
assertTrue(((String) togglePanel.getValue()).equals("c"));
-
+
+ togglePanel.setStateOrder("");
toggleControl.setSwitchToState("d");
try {
togglePanel.broadcast(new SwitchablePanelSwitchEvent(togglePanel,
17 years, 2 months