JBoss Rich Faces SVN: r16201 - in branches/community/3.3.X: ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-23 07:31:44 -0500 (Wed, 23 Dec 2009)
New Revision: 16201
Added:
branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-4612.xhtml
branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-5751.xhtml
branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-6439.xhtml
branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-7173.xhtml
branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-8072.xhtml
Modified:
branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
Log:
ExtendedDataTable duplicate Id exception
https://jira.jboss.org/jira/browse/RF-8223
Added: branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-4612.xhtml
===================================================================
--- branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-4612.xhtml (rev 0)
+++ branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-4612.xhtml 2009-12-23 12:31:44 UTC (rev 16201)
@@ -0,0 +1,64 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:extdt="http://labs.jboss.com/jbossrichfaces/ui/extendedDataTable"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<head>
+<title></title>
+</head>
+<body>
+<f:view>
+ <h:form id="productionsForm">
+
+ <rich:extendedDataTable id="productionsTable"
+ value="#{extendedDataTableBean.dataModel}"
+ var="production"
+
+ width="#{extendedDataTableControlBean.width}"
+ height="#{extendedDataTableControlBean.height}"
+ selection="#{extendedDataTableBean.selection}"
+
+ onRowMouseOver="this.style.backgroundColor='#{a4jSkin.additionalBackgroundColor}'"
+ onRowMouseOut="this.style.backgroundColor=''"
+ selectionMode="single"
+ selectedClass="rich-sdt-row-selected"
+ rowClasses="rvgRowOne,rvgRowTwo">
+
+
+ <!-- action="#{extendedDataTableControlBean.onSelectionChange}" -->
+
+ <a4j:support
+ event="onselectionchange"
+ immediate="true"
+ reRender="col1"
+ oncomplete="alert('OnSelectionChange WORK!!!');"
+ />
+
+ <rich:column width="150px" id="col1">
+ <f:facet name="header">First</f:facet>
+
+ <h:selectOneMenu onclick="Event.stop(event);">
+ <f:selectItem itemValue="1" itemLabel="1" />
+ <f:selectItem itemValue="2" itemLabel="2" />
+ <f:selectItem itemValue="3" itemLabel="3" />
+ </h:selectOneMenu>
+ </rich:column>
+
+ <rich:column width="150px" id="col2">
+ <f:facet name="header">Second</f:facet>
+
+ <h:selectOneMenu onclick="Event.stop(event);">
+ <f:selectItem itemValue="1" itemLabel="1" />
+ <f:selectItem itemValue="2" itemLabel="2" />
+ <f:selectItem itemValue="3" itemLabel="3" />
+ </h:selectOneMenu>
+ </rich:column>
+ </rich:extendedDataTable>
+ </h:form>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Added: branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-5751.xhtml
===================================================================
--- branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-5751.xhtml (rev 0)
+++ branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-5751.xhtml 2009-12-23 12:31:44 UTC (rev 16201)
@@ -0,0 +1,51 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <style>
+ #ClientUI_Box0 {
+ height:0px;
+ font-size:0px;
+ display:none;
+ }
+
+ #ClientUI_Box1 {
+ height:0px;
+ font-size:0px;
+ display:none;
+ }
+ </style>
+
+ <h:form id="f">
+ <rich:extendedDataTable id="table"
+ value="#{extendedTableBean.capitalsDataModel}" var="cap"
+ width="300px" height="400px"
+ >
+
+ <rich:column sortable="true" sortBy="#{cap.state}" width="120px" filterBy="#{cap.state}" filterEvent="onkeyup">
+ <f:facet name="header">
+ <h:outputText value="Make" />
+ </f:facet>
+ <h:outputText value="#{cap.state}" />
+ </rich:column>
+
+ <rich:column width="120px">
+ <f:facet name="header">
+ <h:outputText value="Model" />
+ </f:facet>
+ <h:outputText value="#{cap.name}" />
+ </rich:column>
+
+ <rich:column width="120px">
+ <f:facet name="header">
+ <h:outputText value="Price" />
+ </f:facet>
+ <h:outputText value="#{cap.timeZone}" />
+ </rich:column>
+ </rich:extendedDataTable>
+ </h:form>
+</html>
Added: branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-6439.xhtml
===================================================================
--- branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-6439.xhtml (rev 0)
+++ branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-6439.xhtml 2009-12-23 12:31:44 UTC (rev 16201)
@@ -0,0 +1,39 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <rich:modalPanel id="p" width="650" height="650">
+ <f:facet name="header">
+ <h:panelGroup>Doc</h:panelGroup>
+ </f:facet>
+ <f:facet name="controls">
+ <h:panelGroup>
+ <h:graphicImage value="/img/break.gif" style="cursor: pointer;">
+ <rich:componentControl for="p" operation="hide" event="onclick" />
+ </h:graphicImage>
+ </h:panelGroup>
+ </f:facet>
+ <h:form id="f">
+ <rich:extendedDataTable value="#{extendedTableBean.capitalsDataModel}"
+ var="field1" id="ed">
+ <rich:column>#{field1}</rich:column>
+ </rich:extendedDataTable>
+ </h:form>
+ </rich:modalPanel>
+
+
+ <h:form id="f2">
+ <a4j:commandLink value="open panel" reRender="ed" oncomplete="Richfaces.showModalPanel('p');"/>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-7173.xhtml
===================================================================
--- branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-7173.xhtml (rev 0)
+++ branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-7173.xhtml 2009-12-23 12:31:44 UTC (rev 16201)
@@ -0,0 +1,46 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <style>
+ #ClientUI_Box0 {
+ height:0px;
+ font-size:0px;
+ display:none;
+ }
+
+ #ClientUI_Box1 {
+ height:0px;
+ font-size:0px;
+ display:none;
+ }
+ </style>
+
+ <h:form id="f">
+ <rich:extendedDataTable
+ value="#{extendedTableBean.capitalsDataModel}"
+ var="cap"
+ id="table"
+ width="580px"
+ height="400px"
+ >
+ <rich:column label="State Name">
+ <f:facet name="header"><h:outputText value="State Name"/></f:facet>
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column label="State Capital">
+ <f:facet name="header"><h:outputText value="State Capital"/></f:facet>
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column label="Time Zone">
+ <f:facet name="header"><h:outputText value="Time Zone"/></f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+ </rich:extendedDataTable>
+
+ </h:form>
+</html>
Added: branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-8072.xhtml
===================================================================
--- branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-8072.xhtml (rev 0)
+++ branches/community/3.3.X/samples/extendedDataTable-sample/src/main/webapp/pages/RF-8072.xhtml 2009-12-23 12:31:44 UTC (rev 16201)
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:extdt="http://labs.jboss.com/jbossrichfaces/ui/extendedDataTable"
+ xmlns:dt="http://labs.jboss.com/jbossrichfaces/ui/dataTable"
+ xmlns:a4j="http://richfaces.org/a4j">
+<body>
+<f:view>
+ <h:form id="form">
+ <extdt:extendedDataTable id="table">
+ <dt:column >Hello</dt:column>
+ </extdt:extendedDataTable>
+ </h:form>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Modified: branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
===================================================================
--- branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2009-12-23 11:42:32 UTC (rev 16200)
+++ branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2009-12-23 12:31:44 UTC (rev 16201)
@@ -155,6 +155,7 @@
UIMenuSeparator sep = (UIMenuSeparator) context.getApplication()
.createComponent(UIMenuSeparator.COMPONENT_TYPE);
+ sep.setId(getId("sep_1"));
menu.getChildren().add(sep);
// add menu item for grouping
@@ -162,11 +163,13 @@
sep = (UIMenuSeparator) context.getApplication().createComponent(
UIMenuSeparator.COMPONENT_TYPE);
+ sep.setId(getId("sep_2"));
menu.getChildren().add(sep);
// add menu items for changing column visibility
UIMenuGroup group = (HtmlMenuGroup) context.getApplication()
.createComponent(UIMenuGroup.COMPONENT_TYPE);
+ group.setId(getId("visibility"));
group.setValue(ComponentMessageUtil.getMessage(context, MSG_COLUMNS,
new Object[] {}).getSummary());
group.setIcon(iconColumnsURI);
@@ -177,9 +180,13 @@
while (columns.hasNext()) {
buildMenuItem(group, columns.next());
- }// while
+ }
}// buildMenu
+ private String getId(String str) {
+ return column.getId() + "_rich_" + str;
+ }
+
/**
* Builds menu item for sorting.
*
@@ -195,6 +202,9 @@
.createComponent(UIMenuItem.COMPONENT_TYPE);
menuItem.setSubmitMode("none");
+
+ String ascStr = asc ? "asc" : "desc";
+ menuItem.setId(getId("sort_" + asc));
String actionScript = null;
StringBuilder actionScriptBuilder = new StringBuilder();
if ((Boolean) column.getAttributes().get("sortable")) {
@@ -214,9 +224,9 @@
actionScript = actionScript.replace("{columnId}",
columnClientId);
}
- if (actionScript.contains("{sortDirection}"))
- actionScript = actionScript.replace("{sortDirection}",
- asc ? "asc" : "desc");
+ if (actionScript.contains("{sortDirection}")) {
+ actionScript = actionScript.replace("{sortDirection}", ascStr);
+ }
}
} else {
menuItem.setDisabled(true);
@@ -247,6 +257,7 @@
.createComponent(UIMenuItem.COMPONENT_TYPE);
menuItem.setSubmitMode("none");
+ menuItem.setId("group");
String actionScript = null;
StringBuilder actionScriptBuilder = new StringBuilder();
boolean isGroupingColumn = column.getId().equalsIgnoreCase(
@@ -254,21 +265,18 @@
if ((Boolean) column.getAttributes().get("sortable")) {
if (groupFunction != null) {
if (prepareFunction != null) {
- actionScriptBuilder.append(prepareFunction.toScript())
- .append("; ");
+ actionScriptBuilder.append(prepareFunction.toScript()).append("; ");
}
actionScriptBuilder.append(groupFunction.toScript());
actionScript = actionScriptBuilder.toString();
if (actionScript.contains("{columnId}")) {
- String columnClientId = (String) column.getAttributes()
- .get("columnClientId");
+ String columnClientId = (String) column.getAttributes().get("columnClientId");
if (columnClientId == null)
columnClientId = column.getClientId(context);
if (isGroupingColumn) {
columnClientId = "";
}
- actionScript = actionScript.replace("{columnId}",
- columnClientId);
+ actionScript = actionScript.replace("{columnId}", columnClientId);
}
}
} else {
@@ -304,35 +312,32 @@
if (col.isRendered(false)) {
UIMenuItem menuItem = (UIMenuItem) context.getApplication()
.createComponent(UIMenuItem.COMPONENT_TYPE);
+ menuItem.setId(parent.getId() + '_' + col.getId());
+ menuItem.setSubmitMode("none");
+ menuItem.setStyle("text-align: left;");
- menuItem.setSubmitMode("none");
+ String label = (String)col.getAttributes().get("label");
+ menuItem.setValue(label == null ? "" : label);
+
boolean columnVisible = col.isVisible();
+
String actionScript = null;
- StringBuilder actionScriptBuilder = new StringBuilder();
-
- menuItem.setStyle("text-align: left;");
-
- if ((!columnVisible) || (visibleColumnsCount > 1)) {
+ if (!columnVisible || (visibleColumnsCount > 1)) {
if (changeColumnVisibilityFunction != null) {
+ StringBuilder actionScriptBuilder = new StringBuilder();
if (prepareFunction != null) {
- actionScriptBuilder.append(prepareFunction.toScript())
- .append("; ");
+ actionScriptBuilder.append(prepareFunction.toScript()).append("; ");
}
- actionScriptBuilder.append(changeColumnVisibilityFunction
- .toScript());
+ actionScriptBuilder.append(changeColumnVisibilityFunction.toScript());
actionScript = actionScriptBuilder.toString();
if (actionScript.contains("{columnId}"))
- actionScript = actionScript.replace("{columnId}",
- col.getId());
+ actionScript = actionScript.replace("{columnId}", col.getId());
}
}// if
- String label = (String)col.getAttributes().get("label");
- menuItem.setValue(label == null ? "" : label);
+
menuItem.setIcon(columnVisible ? iconCheckedURI : iconUncheckedURI);
if (menuItem instanceof HtmlMenuItem) {
- ((HtmlMenuItem) menuItem)
- .setOnclick(actionScript == null ? "return false;"
- : actionScript);
+ ((HtmlMenuItem) menuItem).setOnclick(actionScript == null ? "return false;" : actionScript);
}
// add item to menu
15 years
JBoss Rich Faces SVN: r16200 - in branches/community/3.3.X/ui: dataTable/src/main/java/org/richfaces/taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-23 06:42:32 -0500 (Wed, 23 Dec 2009)
New Revision: 16200
Added:
branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnHandlerComponentConfig.java
branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandlerIterationContext.java
Modified:
branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java
Log:
ThreadLocal/Memory leak in ColumnsHandler
https://jira.jboss.org/jira/browse/RF-8216
Added: branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnHandlerComponentConfig.java
===================================================================
--- branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnHandlerComponentConfig.java (rev 0)
+++ branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnHandlerComponentConfig.java 2009-12-23 11:42:32 UTC (rev 16200)
@@ -0,0 +1,83 @@
+/**
+ * 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.taglib;
+
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.Tag;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributes;
+import com.sun.facelets.FaceletHandler;
+
+/**
+ * @author akolonitsky
+ * @since Dec 20, 2009
+ */
+class ColumnHandlerComponentConfig implements ComponentConfig {
+
+ private static final String ITERATION_INDEX_EXPRESSION = "#{" + ColumnsHandler.ITERATION_INDEX_VARIABLE + "}";
+
+ private Tag tag;
+ private final ComponentConfig config;
+
+ ColumnHandlerComponentConfig(ComponentConfig config) {
+ this.config = config;
+ Tag initialTag = config.getTag();
+ TagAttribute[] allInitialAttributes = initialTag.getAttributes().getAll();
+ TagAttribute[] attributes = new TagAttribute[allInitialAttributes.length];
+ for (int i = 0; i < allInitialAttributes.length; i++) {
+ TagAttribute initialAttribute = allInitialAttributes[i];
+ String localName = initialAttribute.getLocalName();
+ String attributeValue = initialAttribute.getValue();
+
+ if ("id".equals(localName)) {
+ attributeValue += ITERATION_INDEX_EXPRESSION;
+ }
+
+ attributes[i] = new TagAttribute(initialAttribute.getLocation(), initialAttribute.getNamespace(),
+ localName, initialAttribute.getQName(), attributeValue);
+ }
+
+ TagAttributes tagAttributes = new TagAttributes(attributes);
+ this.tag = new Tag(initialTag, tagAttributes);
+ }
+
+ public String getComponentType() {
+ return config.getComponentType();
+ }
+
+ public String getRendererType() {
+ return config.getRendererType();
+ }
+
+ public FaceletHandler getNextHandler() {
+ return config.getNextHandler();
+ }
+
+ public Tag getTag() {
+ return tag;
+ }
+
+ public String getTagId() {
+ return config.getTagId();
+ }
+
+}
Modified: branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
===================================================================
--- branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2009-12-23 11:33:55 UTC (rev 16199)
+++ branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2009-12-23 11:42:32 UTC (rev 16200)
@@ -27,42 +27,28 @@
package org.richfaces.taglib;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.servlet.jsp.JspTagException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.el.ELBuilder;
-import org.richfaces.iterator.ForEachIterator;
-import org.richfaces.iterator.SimpleForEachIterator;
-
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletHandler;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.MetaTagHandler;
import com.sun.facelets.tag.Metadata;
import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.Tag;
import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributes;
import com.sun.facelets.tag.jsf.ComponentConfig;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.el.ELBuilder;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.util.Iterator;
-
/**
* TODO Class description goes here.
*
@@ -73,80 +59,21 @@
private static final Log log = LogFactory.getLog(ColumnsHandler.class);
- com.sun.facelets.tag.jsf.ComponentHandler handler;
+ private com.sun.facelets.tag.jsf.ComponentHandler handler;
- private static final String ITERATION_INDEX_VARIABLE = "__richfaces_iteration_index_variable";
+ static final String ITERATION_INDEX_VARIABLE = "__richfaces_iteration_index_variable";
- private static final String ITERATION_INDEX_EXPRESSION = "#{" + ITERATION_INDEX_VARIABLE + "}";
-
private static final String F_GENERATION_SERIES_ATTRIBUTE = "org.richfaces.F_COLUMNS_GENERATION_SERIES";
/** value attribute */
private TagAttribute value;
- /** end attribute */
- private TagAttribute columns;
-
- /** begin attribute */
- private TagAttribute begin;
-
- /** var attribute */
- private TagAttribute var;
-
- /** index attribute */
+ /** index attribute */
private TagAttribute index;
- /** end attribute */
- private TagAttribute end;
+ private ThreadLocal<ColumnsHandlerIterationContext> iterationContextLocal = new ThreadLocal<ColumnsHandlerIterationContext>();
- class IterationContext {
-
- /** Iterator for columns's tag value attribute */
- public ForEachIterator items; // our 'digested' items
-
- /** Value attribute value */
- public Object rawItems; // our 'raw' items
-
- /** Var attr - defines page variable for current item */
- public String _indexId;
-
- /** Integer value begin attr */
- public Integer _begin;
-
- /** Integer value end attr */
- public Integer _end;
-
- /** Integer value of end attr. */
- public Integer _columns;
-
- /** String value of var attr */
- public String _itemId = null;
-
- /** Current column counter */
- public Integer _index = 0;
-
- /** Expression for var item */
- public IteratedExpression iteratedExpression;
-
- public String valueExpr;
-
- public String getVarReplacement() {
- if (valueExpr == null) {
- return String.valueOf(index);
- }else if (items.getVarReplacement() != null) {
- return items.getVarReplacement();
- }
- return valueExpr + "[" + _index + "]";
- }
-
- public String getIndexReplacement() {
- return String.valueOf(_index);
- }
- };
-
- ThreadLocal<IterationContext> iterationContextLocal = new ThreadLocal<IterationContext>();
-
- public IterationContext getIterationContext() {
+ private ColumnsHandlerIterationContext getIterationContext() {
return iterationContextLocal.get();
}
@@ -162,61 +89,13 @@
TagAttribute idAttribute = config.getTag().getAttributes().get("id");
if (idAttribute != null && idAttribute.isLiteral()) {
- columnConfig = new ComponentConfig() {
-
- private Tag tag;
-
- {
- Tag initialTag = config.getTag();
- TagAttribute[] allInitialAttributes = initialTag.getAttributes().getAll();
- TagAttribute[] attributes = new TagAttribute[allInitialAttributes.length];
- for (int i = 0; i < allInitialAttributes.length; i++) {
- TagAttribute initialAttribute = allInitialAttributes[i];
- String localName = initialAttribute.getLocalName();
- String attributeValue = initialAttribute.getValue();
-
- if ("id".equals(localName)) {
- attributeValue += ITERATION_INDEX_EXPRESSION;
- }
-
- attributes[i] = new TagAttribute(initialAttribute.getLocation(),
- initialAttribute.getNamespace(),
- localName,
- initialAttribute.getQName(),
- attributeValue);
- }
-
- TagAttributes tagAttributes = new TagAttributes(attributes);
- this.tag = new Tag(initialTag, tagAttributes);
- }
-
- public String getComponentType() {
- return config.getComponentType();
- }
-
- public String getRendererType() {
- return config.getRendererType();
- }
-
- public FaceletHandler getNextHandler() {
- return config.getNextHandler();
- }
-
- public Tag getTag() {
- return tag;
- }
-
- public String getTagId() {
- return config.getTagId();
- }
-
- };
+ columnConfig = new ColumnHandlerComponentConfig(config);
} else {
columnConfig = config;
}
handler = new ColumnTagHandler(columnConfig) {
-
+
@Override
protected MetaRuleset createMetaRuleset(Class type) {
MetaRuleset ruleset = super.createMetaRuleset(type);
@@ -225,21 +104,20 @@
@Override
public Metadata applyRule(final String name,
final TagAttribute attribute, MetadataTarget meta) {
- if (ColumnsAttributes.FILTER_ATTRIBUTES.indexOf(name) != -1 ||
+ if (ColumnsAttributes.FILTER_ATTRIBUTES.indexOf(name) != -1 ||
ColumnsAttributes.SORT_ATTRIBUTES.indexOf(name) != -1) {
-
+
return new Metadata() {
@Override
- public void applyMetadata(FaceletContext ctx,
- Object instance) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
if (!attribute.isLiteral()) {
String expr = attribute.getValue();
- IterationContext itContext = iterationContextLocal.get();
+ ColumnsHandlerIterationContext itContext = iterationContextLocal.get();
- ValueExpression ve = ELBuilder.createValueExpression(expr, Object.class, ctx.getExpressionFactory(), ctx,
- itContext._itemId, itContext._indexId,
- itContext.getVarReplacement(), itContext.getIndexReplacement());
+ ValueExpression ve = ELBuilder.createValueExpression(expr, Object.class, ctx.getExpressionFactory(), ctx,
+ itContext.getItemId(), itContext.getIndexId(),
+ itContext.getVarReplacement(index), itContext.getIndexReplacement());
((UIComponent)instance).setValueExpression(name, ve);
}else {
((UIComponent)instance).getAttributes().put(name, attribute.getValue());
@@ -264,248 +142,68 @@
};
}
+ /**
+ * Method prepares all we need for starting of tag rendering
+ *
+ * @param ctx
+ */
+ private void prepare(FaceletContext ctx) {
+ ColumnsHandlerIterationContext itContext = getIterationContext();
- /**
- * Extracts tags attributes values
- */
- private void initVariables(FaceletContext ctx) {
- initColumnsCount(ctx);
- initIndex(ctx);
- initVar(ctx);
- initBegin(ctx);
- initEnd(ctx);
- }
+ try {
+ this.index = getAttribute("index");
+ itContext.setIndex(ctx, this.index);
- /**
- * Method prepares all we need for starting of tag rendering
- *
- * @throws JspTagException
- */
- private void prepare(FaceletContext ctx) {
+ itContext.setColumnsCount(ctx, getAttribute("columns"));
+ itContext.setVar(ctx, getAttribute("var"));
+ itContext.setBegin(ctx, getAttribute("begin"));
+ itContext.setEnd(ctx, getAttribute("end"));
- initVariables(ctx);
+ this.value = getAttribute("value");
+ itContext.setValue(ctx, this.value);
- IterationContext itContext = getIterationContext();
+ } catch (Exception e) {
+ log.error(e.getLocalizedMessage(), e);
+ // TODO: handle exception
+ }
- try {
+ itContext.correctFirst();
+ }
- this.value = getAttribute("value");
-
- // produce the right sort of ForEachIterator
- if (this.value != null) {
- itContext.valueExpr = ELBuilder.getVarReplacement(this.value.getValue());
-
- // If this is a deferred expression, make a note and get
- // the 'items' instance.
-
- itContext.rawItems = this.value.getObject(ctx);
-
- // extract an iterator over the 'items' we've got
- itContext.items = SimpleForEachIterator
- .supportedTypeForEachIterator(itContext.rawItems);
- } else {
- // no 'items', so use 'begin' and 'end'
- itContext.items = SimpleForEachIterator.beginEndForEachIterator(itContext._columns - 1);
- }
- } catch (Exception e) {
- log.error(e.getLocalizedMessage(), e);
- // TODO: handle exception
- }
-
- correctFirst(ctx);
- }
-
- /**
- * Inits first iteration item
- */
- private void correctFirst(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- if (itContext.items != null) {
- if (itContext._begin > 0 && (itContext._index < itContext._begin)) {
- while ((itContext._index < itContext._begin && hasNext())) {
- next(ctx);
- }
- if (!hasNext()) {
- itContext._index = 0;
- }
- }
- }
- }
-
- /**
- * Return true if we didn't complete column's count
- *
- * @return
- * @throws JspTagException
- */
- private boolean hasNext() {
- IterationContext itContext = getIterationContext();
- try {
- if (itContext._end != 0) {
- return (itContext._index < itContext._end) ? itContext.items.hasNext() : false;
- } else {
- return itContext.items.hasNext();
- }
- } catch (Exception e) {
- return false;
- }
-
- }
-
- /**
- * Iterate to next column
- *
- * @return
- * @throws JspTagException
- */
- private Object next(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- try {
- Object o = itContext.items.next();
- itContext._index++;
- return o;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Extracts integer value from end attr
- */
- private void initColumnsCount(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- this.columns = getAttribute("columns");
- if (columns != null) {
- try {
- itContext._columns = Integer.parseInt((String) columns.getObject(ctx));
- if (itContext._columns < 0) {
- itContext._columns = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- itContext._columns = 0;
- }
- } else {
- itContext._columns = 0;
- }
- }
-
- /**
- * Extracts integer value from begin attr
- */
- private void initBegin(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- this.begin = getAttribute("begin");
- if (begin != null) {
- try {
- Object o = begin.getObject(ctx);
- if (o instanceof Number) {
- itContext._begin = ((Number)o).intValue();
- }else if (o instanceof String) {
- itContext._begin = Integer.parseInt((String) o);
- }
- itContext._begin--;
- if (itContext._begin < 0) {
- itContext._begin = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- itContext._begin = 0;
- }
- } else {
- itContext._begin = 0;
- }
- }
-
- /**
- * Extracts integer value from end attr
- */
- private void initEnd(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- this.end = getAttribute("end");
- if (end != null) {
- try {
- Object o = end.getObject(ctx);
- if (o instanceof Number) {
- itContext._end = ((Number)o).intValue();
- }else if ( o instanceof String) {
- itContext._end = Integer.parseInt((String) o);
- }
- if (itContext._end < 0) {
- itContext._end = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- itContext._end = 0;
- }
- } else {
- itContext._end = 0;
- }
- }
-
- /**
- * Extracts string value from var attr
- */
- private void initVar(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- this.var = getAttribute("var");
- if (var != null) {
- try {
- itContext._itemId = (String) var.getObject(ctx);
- } catch (ClassCastException e) {
- itContext._itemId = null;
- }
-
- }
- }
-
- /**
- * Extracts string value from index attr
- */
- private void initIndex(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- this.index = getAttribute("index");
- if (index != null) {
- try {
- itContext._indexId = (String) index.getObject(ctx);
- } catch (ClassCastException e) {
- itContext._indexId = null;
- }
-
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
- //@Override
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent)
+ */
public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, ELException {
+ throws IOException, FacesException, ELException {
- IterationContext iterationContext = new IterationContext();
- iterationContextLocal.set(iterationContext);
+ clearOldColumns(ctx.getFacesContext(), parent);
- clearOldColumns(ctx.getFacesContext(), parent);
- prepare(ctx); // prepare data
+ ColumnsHandlerIterationContext iterationContext = new ColumnsHandlerIterationContext();
+ iterationContextLocal.set(iterationContext);
+ prepare(ctx);
try {
- while (hasNext()) { // for each
+ while (iterationContext.hasNext()) {
exposeVariables(ctx);
handler.apply(ctx, parent);
- next(ctx);
+ iterationContext.next();
}
} catch (Exception e) {
log.error(e.getLocalizedMessage(), e);
// TODO: handle exception
} finally {
- release();
+ iterationContext.release();
unExposeVariables(ctx);
- }
+ iterationContextLocal.remove();
+ }
}
- private void clearOldColumns(FacesContext context, UIComponent parent) {
+ private static void clearOldColumns(FacesContext context, UIComponent parent) {
if (parent.getChildCount() > 0) {
Integer generatedId = RequestUniqueIdGenerator.generateId(context);
@@ -521,100 +219,62 @@
}
}
- /**
- * Sets page request variables
- *
- * @throws JspTagException
- */
- private void exposeVariables(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- VariableMapper vm = ctx.getVariableMapper();
- int k = itContext._index;
+ /**
+ * Sets page request variables
+ *
+ * @param ctx
+ */
+ private void exposeVariables(FaceletContext ctx) {
+ VariableMapper vm = ctx.getVariableMapper();
+ if (vm == null) {
+ return;
+ }
- if (itContext._itemId != null) {
- if (vm != null) {
- if (value != null) {
- ValueExpression srcVE = value.getValueExpression(ctx,
- Object.class);
- ValueExpression ve = getVarExpression(ctx, srcVE);
- vm.setVariable(itContext._itemId, ve);
- }
- }
+ ColumnsHandlerIterationContext itContext = getIterationContext();
+ if (itContext.getItemId() != null) {
+ if (value != null) {
+ ValueExpression srcVE = value.getValueExpression(ctx, Object.class);
+ ValueExpression ve = itContext.getVarExpression(ctx, srcVE);
+ vm.setVariable(itContext.getItemId(), ve);
+ }
+ }
- }
+ // Set up index variable
+ if (itContext.getIndexId() != null) {
+ ValueExpression ve = new IteratedIndexExpression(itContext.getIndex());
+ vm.setVariable(itContext.getIndexId(), ve);
+ }
- // Set up index variable
+ int componentsCount = itContext.getIndex() - itContext.getBegin();
+ if (componentsCount != 0) {
+ ValueExpression ve = ctx.getExpressionFactory().createValueExpression(
+ UIViewRoot.UNIQUE_ID_PREFIX + componentsCount, String.class);
+
+ vm.setVariable(ITERATION_INDEX_VARIABLE, ve);
+ }
+ }
- if (itContext._indexId != null) {
- if (vm != null) {
- ValueExpression ve = new IteratedIndexExpression(k);
- vm.setVariable(itContext._indexId, ve);
- }
+ /**
+ * Removes page attributes that we have exposed and, if applicable, restores
+ * them to their prior values (and scopes).
+ *
+ * @param ctx
+ */
+ private void unExposeVariables(FaceletContext ctx) {
+ VariableMapper vm = ctx.getVariableMapper();
+ if (vm == null) {
+ return;
+ }
- }
+ // "nested" variables are now simply removed
+ ColumnsHandlerIterationContext itContext = getIterationContext();
+ if (itContext.getItemId() != null) {
+ vm.setVariable(itContext.getItemId(), null);
+ }
+ if (itContext.getIndexId() != null) {
+ vm.setVariable(itContext.getIndexId(), null);
+ }
- int componentsCount = itContext._index - itContext._begin;
- if (componentsCount != 0) {
- ValueExpression ve = ctx.getExpressionFactory().createValueExpression(UIViewRoot.UNIQUE_ID_PREFIX + componentsCount, String.class);
- vm.setVariable(ITERATION_INDEX_VARIABLE, ve);
- }
- }
-
- /**
- * Removes page attributes that we have exposed and, if applicable, restores
- * them to their prior values (and scopes).
- */
- private void unExposeVariables(FaceletContext ctx) {
- IterationContext itContext = getIterationContext();
- VariableMapper vm = ctx.getVariableMapper();
- // "nested" variables are now simply removed
- if (itContext._itemId != null) {
- if (vm != null)
- vm.setVariable(itContext._itemId, null);
- }
- if (itContext._indexId != null) {
- if (vm != null)
- vm.setVariable(itContext._indexId, null);
- }
-
- vm.setVariable(ITERATION_INDEX_VARIABLE, null);
- }
-
- /**
- * Return expression for page variables
- *
- * @param expr
- * @return
- */
- private ValueExpression getVarExpression(FaceletContext ctx,
- ValueExpression expr/*, IterationContext itContext*/) {
- IterationContext itContext = getIterationContext();
- Object o = expr.getValue(ctx.getFacesContext().getELContext());
- int k = itContext._index;
- if (o.getClass().isArray() || o instanceof List) {
- return new IndexedValueExpression(expr, k);
- }
-
- if (o instanceof Collection || o instanceof Iterator
- || o instanceof Enumeration || o instanceof Map
- || o instanceof String) {
-
- if (itContext.iteratedExpression == null) {
- itContext.iteratedExpression = new IteratedExpression(expr, ",");
- }
- return new IteratedValueExpression(itContext.iteratedExpression, k);
- }
-
- throw new ELException("FOREACH_BAD_ITEMS");
- }
-
- /**
- * Release iteration variables
- */
- private void release() {
- IterationContext itContext = getIterationContext();
- itContext.items = null;
- itContext._index = 0;
- }
-
+ vm.setVariable(ITERATION_INDEX_VARIABLE, null);
+ }
}
Added: branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandlerIterationContext.java
===================================================================
--- branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandlerIterationContext.java (rev 0)
+++ branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandlerIterationContext.java 2009-12-23 11:42:32 UTC (rev 16200)
@@ -0,0 +1,290 @@
+/**
+ * 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.taglib;
+
+import org.richfaces.iterator.ForEachIterator;
+import org.richfaces.iterator.SimpleForEachIterator;
+import org.richfaces.el.ELBuilder;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.FaceletContext;
+
+import javax.servlet.jsp.JspTagException;
+import javax.el.ValueExpression;
+import javax.el.ELException;
+import java.util.List;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Enumeration;
+import java.util.Map;
+
+/**
+ * @author akolonitsky
+ * @since Dec 21, 2009
+ */
+class ColumnsHandlerIterationContext {
+ /**
+ * Iterator for columns's tag value attribute
+ */
+ private ForEachIterator items; // our 'digested' items
+
+ /**
+ * Var attr - defines page variable for current item
+ */
+ private String indexId;
+
+ /**
+ * Integer value begin attr
+ */
+ private Integer begin;
+
+ /**
+ * Integer value end attr
+ */
+ private Integer end;
+
+ /**
+ * Integer value of end attr.
+ */
+ private Integer columnsCount;
+
+ /**
+ * String value of var attr
+ */
+ private String itemId = null;
+
+ /**
+ * Current column counter
+ */
+ private Integer index = 0;
+
+ /**
+ * Expression for var item
+ */
+ private IteratedExpression iteratedExpression;
+
+ private String valueExpr;
+
+ public String getVarReplacement(TagAttribute index) {
+ if (valueExpr == null) {
+ return String.valueOf(index);
+ }
+
+ if (items != null && items.getVarReplacement() != null) {
+ return items.getVarReplacement();
+ }
+
+ return valueExpr + "[" + this.index + "]";
+ }
+
+ public String getIndexReplacement() {
+ return String.valueOf(index);
+ }
+
+ /**
+ * Return true if we didn't complete column's count
+ *
+ * @return hasNext
+ */
+ boolean hasNext() {
+ try {
+ return (end == 0 || index < end) && items.hasNext();
+ } catch (Exception e) {
+ return false;
+ }
+
+ }
+
+ /**
+ * Inits first iteration item
+ */
+ void correctFirst() {
+ if (items != null) {
+ if (begin > 0 && (index < begin)) {
+ while (index < begin && hasNext()) {
+ next();
+ }
+ if (!hasNext()) {
+ index = 0;
+ }
+ }
+ }
+ }
+
+ /**
+ * Iterate to next column
+ *
+ * @param ctx
+ * @return
+ */
+ Object next() {
+ try {
+ Object o = items.next();
+ index++;
+ return o;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ void setColumnsCount(FaceletContext ctx, TagAttribute columns) {
+ if (columns != null) {
+ try {
+ this.columnsCount = Integer.parseInt((String) columns.getObject(ctx));
+ if (this.columnsCount < 0) {
+ this.columnsCount = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ this.columnsCount = 0;
+ }
+ } else {
+ this.columnsCount = 0;
+ }
+ }
+
+
+ void setBegin(FaceletContext ctx, TagAttribute begin) {
+ if (begin != null) {
+ try {
+ Object o = begin.getObject(ctx);
+ if (o instanceof Number) {
+ this.begin = ((Number)o).intValue();
+ }else if (o instanceof String) {
+ this.begin = Integer.parseInt((String) o);
+ }
+ this.begin--;
+ if (this.begin < 0) {
+ this.begin = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ this.begin = 0;
+ }
+ } else {
+ this.begin = 0;
+ }
+ }
+
+
+ void setEnd(FaceletContext ctx, TagAttribute end) {
+ if (end != null) {
+ try {
+ Object o = end.getObject(ctx);
+ if (o instanceof Number) {
+ this.end = ((Number)o).intValue();
+ }else if ( o instanceof String) {
+ this.end = Integer.parseInt((String) o);
+ }
+ if (this.end < 0) {
+ this.end = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ this.end = 0;
+ }
+ } else {
+ this.end = 0;
+ }
+ }
+
+ void setIndex(FaceletContext ctx, TagAttribute index) {
+ if (index != null) {
+ try {
+ indexId = (String) index.getObject(ctx);
+ } catch (ClassCastException e) {
+ indexId = null;
+ }
+ }
+ }
+
+ void setVar(FaceletContext ctx, TagAttribute var) {
+ if (var != null) {
+ try {
+ itemId = (String) var.getObject(ctx);
+ } catch (ClassCastException e) {
+ itemId = null;
+ }
+ }
+ }
+
+ void setValue(FaceletContext ctx, TagAttribute value) throws JspTagException {
+ // produce the right sort of ForEachIterator
+ if (value != null) {
+ valueExpr = ELBuilder.getVarReplacement(value.getValue());
+
+ // If this is a deferred expression, make a note and get the 'items' instance.
+ // extract an iterator over the 'items' we've got
+ items = SimpleForEachIterator.supportedTypeForEachIterator(value.getObject(ctx));
+ } else {
+ // no 'items', so use 'begin' and 'end'
+ items = SimpleForEachIterator.beginEndForEachIterator(columnsCount - 1);
+ }
+ }
+
+ /**
+ * Return expression for page variables
+ *
+ * @param ctx
+ * @param expr
+ * @return
+ */
+ ValueExpression getVarExpression(FaceletContext ctx, ValueExpression expr) {
+ Object o = expr.getValue(ctx.getFacesContext().getELContext());
+ int k = index;
+ if (o.getClass().isArray() || o instanceof List) {
+ return new IndexedValueExpression(expr, k);
+ }
+
+ if (o instanceof Collection || o instanceof Iterator
+ || o instanceof Enumeration || o instanceof Map
+ || o instanceof String) {
+
+ if (iteratedExpression == null) {
+ iteratedExpression = new IteratedExpression(expr, ",");
+ }
+ return new IteratedValueExpression(iteratedExpression, k);
+ }
+
+ throw new ELException("FOREACH_BAD_ITEMS");
+ }
+
+ /**
+ * Release iteration variables
+ */
+ void release() {
+ items = null;
+ index = 0;
+ }
+
+ public String getIndexId() {
+ return indexId;
+ }
+
+ public String getItemId() {
+ return itemId;
+ }
+
+ public Integer getBegin() {
+ return begin;
+ }
+
+ public Integer getIndex() {
+ return index;
+ }
+}
Modified: branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
===================================================================
--- branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2009-12-23 11:33:55 UTC (rev 16199)
+++ branches/community/3.3.X/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2009-12-23 11:42:32 UTC (rev 16200)
@@ -261,8 +261,8 @@
* @param sortOrder -
* new value
*/
- public void setSortOrder(ValueExpression __sortOrder) {
- this._sortOrder = __sortOrder;
+ public void setSortOrder(ValueExpression sortOrder) {
+ this._sortOrder = sortOrder;
}
/**
@@ -272,8 +272,8 @@
* @param sortBy -
* new value
*/
- public void setSortBy(ValueExpression __sortBy) {
- this._sortBy = __sortBy;
+ public void setSortBy(ValueExpression sortBy) {
+ this._sortBy = sortBy;
}
/**
@@ -283,8 +283,8 @@
* @param style -
* new value
*/
- public void setStyle(ValueExpression __style) {
- this._style = __style;
+ public void setStyle(ValueExpression style) {
+ this._style = style;
}
/*
@@ -734,8 +734,8 @@
/**
* Create custom context with VariableMapper override.
*
- * @param context
- * @return
+ * @param cont
+ * @return
*/
private ELContext getContext(final ELContext cont) {
return new ELContext() {
@@ -921,8 +921,8 @@
* @param value -
* new value
*/
- public void setValue(ValueExpression __value) {
- this.__value = __value;
+ public void setValue(ValueExpression value) {
+ this.__value = value;
}
/**
@@ -932,8 +932,8 @@
* @param var -
* new value
*/
- public void setVar(ValueExpression __var) {
- this.__var = __var;
+ public void setVar(ValueExpression var) {
+ this.__var = var;
}
/**
@@ -942,8 +942,8 @@
* @param colspan -
* new value
*/
- public void setColspan(ValueExpression __colspan) {
- this._colspan = __colspan;
+ public void setColspan(ValueExpression colspan) {
+ this._colspan = colspan;
}
/**
@@ -952,8 +952,8 @@
* @param styleClass -
* new value
*/
- public void setStyleClass(ValueExpression __styleClass) {
- this._styleClass = __styleClass;
+ public void setStyleClass(ValueExpression styleClass) {
+ this._styleClass = styleClass;
}
/**
@@ -963,8 +963,8 @@
* @param width -
* new value
*/
- public void setWidth(ValueExpression __width) {
- this._width = __width;
+ public void setWidth(ValueExpression width) {
+ this._width = width;
}
/**
@@ -973,8 +973,8 @@
* @param breakBefore -
* new value
*/
- public void setBreakBefore(ValueExpression __breakBefore) {
- this._breakBefore = __breakBefore;
+ public void setBreakBefore(ValueExpression breakBefore) {
+ this._breakBefore = breakBefore;
}
/**
@@ -984,8 +984,8 @@
* @param comparator -
* new value
*/
- public void setComparator(ValueExpression __comparator) {
- this._comparator = __comparator;
+ public void setComparator(ValueExpression comparator) {
+ this._comparator = comparator;
}
/**
@@ -1004,8 +1004,8 @@
* @param filterBy -
* new value
*/
- public void setFilterBy(ValueExpression __filterBy) {
- this._filterBy = __filterBy;
+ public void setFilterBy(ValueExpression filterBy) {
+ this._filterBy = filterBy;
}
/**
@@ -1015,8 +1015,8 @@
* @param filterDefaultLabel -
* new value
*/
- public void setFilterDefaultLabel(ValueExpression __filterDefaultLabel) {
- this._filterDefaultLabel = __filterDefaultLabel;
+ public void setFilterDefaultLabel(ValueExpression filterDefaultLabel) {
+ this._filterDefaultLabel = filterDefaultLabel;
}
/**
@@ -1026,8 +1026,8 @@
* @param filterEvent -
* new value
*/
- public void setFilterEvent(ValueExpression __filterEvent) {
- this._filterEvent = __filterEvent;
+ public void setFilterEvent(ValueExpression filterEvent) {
+ this._filterEvent = filterEvent;
}
/**
@@ -1037,8 +1037,8 @@
* @param filterExpression -
* new value
*/
- public void setFilterExpression(ValueExpression __filterExpression) {
- this._filterExpression = __filterExpression;
+ public void setFilterExpression(ValueExpression filterExpression) {
+ this._filterExpression = filterExpression;
}
/**
@@ -1048,8 +1048,8 @@
* @param filterMethod -
* new value
*/
- public void setFilterMethod(MethodExpression __filterMethod) {
- this._filterMethod = __filterMethod;
+ public void setFilterMethod(MethodExpression filterMethod) {
+ this._filterMethod = filterMethod;
}
/**
@@ -1059,8 +1059,8 @@
* @param filterValue -
* new value
*/
- public void setFilterValue(ValueExpression __filterValue) {
- this._filterValue = __filterValue;
+ public void setFilterValue(ValueExpression filterValue) {
+ this._filterValue = filterValue;
}
/**
@@ -1070,8 +1070,8 @@
* @param footerClass -
* new value
*/
- public void setFooterClass(ValueExpression __footerClass) {
- this._footerClass = __footerClass;
+ public void setFooterClass(ValueExpression footerClass) {
+ this._footerClass = footerClass;
}
/**
@@ -1081,8 +1081,8 @@
* @param headerClass -
* new value
*/
- public void setHeaderClass(ValueExpression __headerClass) {
- this._headerClass = __headerClass;
+ public void setHeaderClass(ValueExpression headerClass) {
+ this._headerClass = headerClass;
}
/**
@@ -1091,8 +1091,8 @@
* @param rowspan -
* new value
*/
- public void setRowspan(ValueExpression __rowspan) {
- this._rowspan = __rowspan;
+ public void setRowspan(ValueExpression rowspan) {
+ this._rowspan = rowspan;
}
/**
@@ -1102,8 +1102,8 @@
* @param selfSorted -
* new value
*/
- public void setSelfSorted(ValueExpression __selfSorted) {
- this._selfSorted = __selfSorted;
+ public void setSelfSorted(ValueExpression selfSorted) {
+ this._selfSorted = selfSorted;
}
/**
@@ -1113,8 +1113,8 @@
* @param sortable -
* new value
*/
- public void setSortable(ValueExpression __sortable) {
- this._sortable = __sortable;
+ public void setSortable(ValueExpression sortable) {
+ this._sortable = sortable;
}
/**
@@ -1124,18 +1124,18 @@
* @param sortExpression -
* new value
*/
- public void setSortExpression(ValueExpression __sortExpression) {
- this._sortExpression = __sortExpression;
+ public void setSortExpression(ValueExpression sortExpression) {
+ this._sortExpression = sortExpression;
}
/**
* Attribute defines whether to render component or not
* Setter for rendered
*
- * @param __rendered - new value
+ * @param rendered - new value
*/
- public void setRendered(ValueExpression __rendered) {
- this._rendered = __rendered;
+ public void setRendered(ValueExpression rendered) {
+ this._rendered = rendered;
}
/**
Modified: branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java
===================================================================
--- branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java 2009-12-23 11:33:55 UTC (rev 16199)
+++ branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java 2009-12-23 11:42:32 UTC (rev 16200)
@@ -56,7 +56,9 @@
public Metadata applyRule(String name, final TagAttribute attribute, MetadataTarget metadataTarget) {
if (FILTER_METHOD.equals(name)) {
return new Metadata() {
- public void applyMetadata(FaceletContext context, Object object) {
+
+ @Override
+ public void applyMetadata(FaceletContext context, Object object) {
FacesContext facesContext = context.getFacesContext();
MethodExpression expression = facesContext.getApplication().getExpressionFactory().
15 years
JBoss Rich Faces SVN: r16199 - branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-23 06:33:55 -0500 (Wed, 23 Dec 2009)
New Revision: 16199
Modified:
branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
Log:
javadoc for suggestion box. unescaped characters causes info missing.
https://jira.jboss.org/jira/browse/RF-8221
Modified: branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2009-12-23 11:27:59 UTC (rev 16198)
+++ branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2009-12-23 11:33:55 UTC (rev 16199)
@@ -135,7 +135,7 @@
* Method calls an expression to get a collection of suggestion data
* on request. It must have one parameter with a type of Object with
* content of input component and must return any type allowed for
- * <h:datatable>;
+ * <h:datatable>
*
* @return suggestionAction value from local variable or value bindings
*/
15 years
JBoss Rich Faces SVN: r16198 - branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-23 06:27:59 -0500 (Wed, 23 Dec 2009)
New Revision: 16198
Modified:
branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
ComboBox: It is not possible to select current selection again after clearing the input field
https://jira.jboss.org/jira/browse/RF-8200
Modified: branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-12-23 05:20:44 UTC (rev 16197)
+++ branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-12-23 11:27:59 UTC (rev 16198)
@@ -15,7 +15,7 @@
this.comboValue = document.getElementById(id + "comboboxValue");
this.field = document.getElementById(id + "comboboxField");
this.tempItem;
-
+
this.BUTTON_WIDTH = 17; //px
this.BUTTON_LEFT_BORDER = 1; //px
this.BUTTON_RIGHT_BORDER = 1; //px
@@ -439,7 +439,10 @@
this.field.prevValue = newValue;
this.field.value = newValue;
Richfaces.invokeEvent(this.onchange, this.combobox, "onchange", {value:newValue});
- }
+ } else if (newValue && (newValue != this.field.value)) {
+ // https://jira.jboss.org/jira/browse/RF-8200
+ this.field.value = newValue;
+ }
},
applyDefaultText : function() {
15 years
JBoss Rich Faces SVN: r16197 - in root/docs/trunk/Component_Reference/en-US: images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-12-23 00:20:44 -0500 (Wed, 23 Dec 2009)
New Revision: 16197
Added:
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Basic_column_example.png
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Column_spanning_example.png
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Row_spanning_example.png
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups.png
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_Ajax_attributes.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Introduction.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Panels_and_containers.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
Log:
Fixed rendering issues
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -64,9 +64,9 @@
The <varname>converter</varname> attribute can be used to specify how to convert the value before it is submitted to the data model. The property is assigned the new value during the <emphasis>Update Model</emphasis> phase.
</para>
<note>
- <title>Note</title>
+ <title>Validation failure</title>
<para>
- If the validation of the form fails the <emphasis>Update Model</emphasis> phase will be skipped and the property will not be updated.
+ If the validation of the form fails, the <emphasis>Update Model</emphasis> phase will be skipped and the property will not be updated.
</para>
</note>
<para>
@@ -80,7 +80,7 @@
The <sgmltag><a4j:ajax></sgmltag> component allows Ajax capability to be added to any non-Ajax component. It is placed as a direct child to the component that requires Ajax support. The <sgmltag><a4j:ajax></sgmltag> component uses the common attributes listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />.
</para>
<note>
- <title>Note</title>
+ <title>Attaching JavaScript functions</title>
<para>
When attaching the <sgmltag><a4j:ajax></sgmltag> component to non-Ajax JavaServer Faces command components, such as <sgmltag><h:commandButton></sgmltag> and <sgmltag><h:commandLink></sgmltag>, it is important to set <code>disabledDefault="true"</code>. If this attribute is not set, a non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
</para>
@@ -148,7 +148,7 @@
The <sgmltag><a4j:commandButton></sgmltag> requires only the <varname>value</varname> and <varname>render</varname> attributes to function. The <varname>value</varname> attribute specifies the text of the button and the <varname>render</varname> attribute specifies which areas are to be updated. The <sgmltag><a4j:commandButton></sgmltag> uses the <varname>onclick</varname> event instead of the <varname>onsubmit</varname> event, but otherwise uses all common Ajax attributes as listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />.
</para>
<note>
- <title>Note</title>
+ <title>Set <code>disabledDefault="true"</code></title>
<para>
When attaching a JavaScript function to a <sgmltag><a4j:commandButton></sgmltag> with the help of a <sgmltag><rich:componentControl></sgmltag>, do not use the <varname>attachTo</varname> attribute of <sgmltag><rich:componentControl></sgmltag>. The attribute adds event handlers using <classname>Event.observe</classname> but <sgmltag><a4j:commandButton></sgmltag> does not include this event.
</para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_Ajax_attributes.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_Ajax_attributes.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_Ajax_attributes.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -40,7 +40,7 @@
The value of the <varname>render</varname> attribute can also be an expression written using JavaServer Faces' Expression Language (<acronym>EL</acronym>); this can either be a <type>Set</type>, <type>Collection</type>, <type>Array</type>, or <type>String</type>.
</para>
<important>
- <title>Important</title>
+ <title><varname>rendered</varname> attributes</title>
<para>
A common problem with using <varname>render</varname> occurs when the referenced component has a <varname>rendered</varname> attribute. <acronym>JSF</acronym> does not mark the place in the browser's Document Object Model (<acronym>DOM</acronym>) where the rendered component would be placed in case the <varname>rendered</varname> attribute returns <literal>false</literal>. As such, when RichFaces sends the render code to the client, the page does not update as the place for the update is not known.
</para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -34,7 +34,7 @@
The <sgmltag><a4j:form></sgmltag> builds on the functionality of the JavaServer Faces (<acronym>JSF</acronym>) component <sgmltag><h:form></sgmltag>, adding Ajax capabilities to the form.
</para>
<note>
- <title>Note</title>
+ <title>Command link rendering fixed</title>
<para>
The <acronym>JSF</acronym> component <sgmltag><h:form></sgmltag>, on which the <sgmltag><a4j:form></sgmltag> component is based, had an issue whereby the <sgmltag><h:commandLink></sgmltag> component could not be re-rendered without re-rendering the entire form. <sgmltag><a4j:form></sgmltag> and <sgmltag><a4j:commandLink></sgmltag> fix this issue.
</para>
@@ -43,7 +43,7 @@
The <sgmltag><a4j:form></sgmltag> component can add indirect Ajax support to non-Ajax components on the form by setting <code>ajaxSubmit="true"</code>. It then uses the standard Ajax component attributes and updates components specified with the <varname>render</varname> attribute.
</para>
<important>
- <title>Important</title>
+ <title><varname>ajaxSubmit</varname></title>
<para>
<sgmltag><a4j:form></sgmltag> should not use <code>ajaxSubmit="true"</code> if it contains other Ajax-capable components.
</para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Introduction.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Introduction.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Introduction.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -15,7 +15,7 @@
The RichFaces framework as it now stands is made up of two tag libraries: the <classname>a4j</classname> library and the <classname>rich</classname> library. The <classname>a4j</classname> tag library represents Ajax4jsf, which provides page-level Ajax support with core Ajax components. This allows developers to make use of custom Ajax behavior with existing components. The <classname>rich</classname> tag library provides Ajax support at the component level instead, and includes ready-made, self-contained components. These components don't require additional configuration in order to send requests or update.
</para>
<note>
- <title>Note</title>
+ <title>Ajax support</title>
<para>
All components in the <classname>a4j</classname> library feature built-in Ajax support, so it is unnecessary to add the <sgmltag><a4j:ajax></sgmltag> behavior.
</para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Panels_and_containers.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Panels_and_containers.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Panels_and_containers.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -12,7 +12,7 @@
The <sgmltag><rich:modalPanel></sgmltag> component provides a modal panel or window that blocks interaction with the rest of the application while active. It can be easily positioned on the screen, dragged to a new position by the user, and re-sized.
</para>
<important>
- <title>Important</title>
+ <title>Placement</title>
<para>
The <sgmltag><rich:modalPanel></sgmltag> component should always be placed outside the original <sgmltag><h:form></sgmltag>, and must include its own <sgmltag><h:form></sgmltag> if performing submissions.
</para>
@@ -103,7 +103,7 @@
The <sgmltag><rich:tabPanel></sgmltag> component provides a set of tabbed panels for displaying one panel of content at a time. The tabs can be highly customized and themed.
</para>
<note>
- <title>Note</title>
+ <title>Form elements required</title>
<para>
All <sgmltag><rich:tabPanel></sgmltag> components should be wrapped in a form element so that content is correctly submitted.
</para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -59,7 +59,7 @@
</listitem>
</itemizedlist>
<para>
- The <sgmltag><a4j:queue></sgmltag> features several events relating to queuing actions:
+ The <sgmltag><a4j:queue></sgmltag> component features several events relating to queuing actions:
</para>
<itemizedlist>
<listitem>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2009-12-23 03:22:00 UTC (rev 16196)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2009-12-23 05:20:44 UTC (rev 16197)
@@ -60,14 +60,14 @@
<programlisting language="XML" role="XML">
<xi:include href="extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-0.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
- </example>
- <para>
- The validation is performed using the <classname>ValidationBean</classname> class:
- </para>
+ <para>
+ The validation is performed using the <classname>ValidationBean</classname> class:
+ </para>
<programlisting language="Java" role="JAVA">
-<xi:include href="extras/exam-Component_Reference-exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
+ </example>
</section>
<section id="sect-Component_Reference-Validation-richbeanValidator">
@@ -119,7 +119,7 @@
</para>
<programlisting language="Java" role="JAVA">
-<xi:include href="extras/exam-Component_Reference-exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</example>
</section>
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Basic_column_example.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Basic_column_example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Column_spanning_example.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Column_spanning_example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Row_spanning_example.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumn-Row_spanning_example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years
JBoss Rich Faces SVN: r16196 - in root/docs/trunk/Component_Reference/en-US: extras and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-12-22 22:22:00 -0500 (Tue, 22 Dec 2009)
New Revision: 16196
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample
Modified:
root/docs/trunk/Component_Reference/en-US/Book_Info.xml
root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
root/docs/trunk/Component_Reference/en-US/Preface.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
Log:
Finished Processing Management
Modified: root/docs/trunk/Component_Reference/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-12-23 02:03:22 UTC (rev 16195)
+++ root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-12-23 03:22:00 UTC (rev 16196)
@@ -29,7 +29,7 @@
<year>&YEAR;</year>
<holder>&HOLDER;</holder>
</copyright>
- <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-12-23 02:03:22 UTC (rev 16195)
+++ root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-12-23 03:22:00 UTC (rev 16196)
@@ -3,9 +3,9 @@
]>
<book status="draft">
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--
+ <!--
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_Ajax_attributes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_features.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<part id="part-Component_Reference-a4j_tag_library">
Modified: root/docs/trunk/Component_Reference/en-US/Preface.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-12-23 02:03:22 UTC (rev 16195)
+++ root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-12-23 03:22:00 UTC (rev 16196)
@@ -3,10 +3,10 @@
]>
<preface id="pref-Component_Reference-Preface">
<title>Preface</title>
- <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
- <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
</xi:fallback>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2009-12-23 02:03:22 UTC (rev 16195)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2009-12-23 03:22:00 UTC (rev 16196)
@@ -4,27 +4,231 @@
<chapter id="chap-Component_Reference-Processing_management">
<title>Processing management</title>
<para>
- Incomplete
+ This chapter covers those components that manage the processing of information, requests, and updates.
</para>
<section id="sect-Component_Reference-Processing_management-a4jqueue">
<title><a4j:queue></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-family: <classname>org.ajax4jsf.Queue</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.ajax4jsf.component.html.HtmlQueue</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.ajax4jsf.QueueRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tag-class: <classname>org.ajax4jsf.taglib.html.jsp.QueueTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><a4j:queue></sgmltag> component manages a queue of Ajax requests to control message processing.
</para>
+ <para>
+ The queue can be disabled by setting the <varname>disabled</varname> attribute to <literal>true</literal>. The <varname>size</varname> attribute specifies the number of requests that can be stored in the queue at a time; smaller queue sizes help prevent server overloads. When the queue's size is exceeded, the <varname>sizeExceededBehavior</varname> determines the way in which the queue handles the requests:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>dropNext</literal> drops the next request currently in the queue.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>dropNew</literal> drops the incoming request.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>fireNext</literal> immediately sends the next request currently in the queue.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>fireNew</literal> immediately sends the incoming request.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <sgmltag><a4j:queue></sgmltag> features several events relating to queuing actions:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <varname>oncomplete</varname> event attribute is fired after a request is completed. The request object is passed as a parameter to the event handler, so the queue is accessible using <code>request.queue</code> and the element which was the source of the request is accessible using <code>this</code>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <varname>onrequestqueue</varname> event attribute is fired after a new request has been added to the queue.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <varname>onrequestdequeue</varname> event attribute is fired after a request has been removed from the queue.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <varname>onsizeexceeded</varname> event attribute is fired when the queue has been exceeded.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <varname>onsubmit</varname> event attribute is fired before the request is sent.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <varname>onsuccess</varname> event attribute is fired after a successful request bu before the <acronym>DOM</acronym> is updated on the client side.
+ </para>
+ </listitem>
+ </itemizedlist>
</section>
<section id="sect-Component_Reference-Processing_management-a4jlog">
<title><a4j:log></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.ajax4jsf.Log</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.ajax4jsf.Log</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.ajax4jsf.component.html.AjaxLog</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.ajax4jsf.LogRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><a4j:log></sgmltag> component generates JavaScript that opens a debug window, logging application information such as requests, responses, and <acronym>DOM</acronym> changes.
</para>
+ <para>
+ The <varname>popup</varname> attribute causes the logging data to appear in a new pop-up window if set to <literal>true</literal>, or in place on the current page if set to <literal>false</literal>. The window is set to be opened by pressing the key combination <keycombo action="simul"><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>L</keycap></keycombo>; this can be partially reconfigured with the <varname>hotkey</varname> attribute, which specifies the letter key to use in combination with <keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap></keycombo> instead of <keycap>L</keycap>.
+ </para>
+ <para>
+ The amount of data logged can be determined with the <varname>level</varname> attribute:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>ERROR</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>FATAL</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>INFO</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WARN</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>ALL</literal>, the default setting, logs all data.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <example id="exam-Component_Reference-a4jlog-a4jlog_example">
+ <title><sgmltag><a4j:log></sgmltag> example</title>
+
+<programlisting language="XML" role="XML">
+<a4j:log level="ALL" popup="false" width="400" height="200" />
+</programlisting>
+ </example>
+ <note>
+ <title>Log renewal</title>
+ <para>
+ The log is automatically renewed after each Ajax request. It does not need to be explicitly re-rendered.
+ </para>
+ </note>
</section>
<section id="sect-Component_Reference-Processing_management-a4jstatus">
<title><a4j:status></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.ajax4jsf.Status</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>javax.faces.Panel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxStatus</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.ajax4jsf.components.AjaxStatusRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><a4j:status></sgmltag> component displays the status of current Ajax requests; the status can be either in progress or complete.
</para>
+ <para>
+ The <varname>startText</varname> attribute defines the text shown after the request has been started and is currently in progress. This text can be styled with the <varname>startStyle</varname> and <varname>startStyleClass</varname> attributes. Similarly, the <varname>stopText</varname> attribute defines the text shown once the request is complete, and text is styled with the <varname>stopStyle</varname> and <varname>stopStyleClass</varname> attributes. Alternatively, the text styles can be customized using facets, with the facet name set to either <literal>start</literal> or <literal>stop</literal> as required. If the <varname>stopText</varname> attribute is not defined, and no facet exists for the stopped state, the status is simply not shown; in this way only the progress of the request is displayed to the user.
+ </para>
+ <example id="exam-Component_Reference-a4jstatus-Basic_a4jstatus_usage">
+ <title>Basic <sgmltag><a4j:status></sgmltag> usage</title>
+
+<programlisting language="XML" role="XML">
+<a4j:status startText="In progress..." stopText="Complete" />
+</programlisting>
+ </example>
+ <para>
+ The <sgmltag><a4j:status></sgmltag> component works for each Ajax component inside the local region. If no region is defined, every request made on the page will activate the <sgmltag><a4j:status></sgmltag> component. Alternatively, the <sgmltag><a4j:status></sgmltag> component can be linked to specific components in one of two ways:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <varname>for</varname> attribute can be used to specify the component for which the status is to be monitored.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ With an <varname>id</varname> identifier attribute specified for the <sgmltag><a4j:status></sgmltag>, individual components can have their statuses monitored by referencing the identifier with their own <varname>status</varname> attributes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <example id="exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component">
+ <title>Updating a common <sgmltag><a4j:status></sgmltag> component</title>
+
+<programlisting language="XML" role="XML">
+<xi:include parse="text" href="extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ </example>
</section>
</chapter>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample 2009-12-23 03:22:00 UTC (rev 16196)
@@ -0,0 +1,38 @@
+<a4j:region id="extr">
+ <h:form>
+ <h:outputText value="Status:" />
+ <a4j:status id="commonstatus" startText="In Progress...." stopText="" />
+
+ <a4j:region id="intr">
+ <h:panelGrid columns="2">
+ <h:outputText value="Name" />
+ <h:inputText id="name" value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="out" status="commonstatus" />
+ </h:inputText>
+
+ <h:outputText value="Job" />
+ <h:inputText id="job" value="#{userBean.job}">
+ <a4j:support event="onkeyup" reRender="out" status="commonstatus" />
+ </h:inputText>
+
+ <h:panelGroup />
+
+ </h:panelGrid>
+ </a4j:region>
+ <a4j:region>
+ <br />
+ <rich:spacer height="5" />
+ <b><h:outputText id="out"
+ value="Name: #{userBean.name}, Job: #{userBean.job}" /></b>
+ <br />
+ <rich:spacer height="5" />
+ <br />
+ <a4j:commandButton ajaxSingle="true" value="Clean Up Form"
+ reRender="name, job, out" status="commonstatus">
+ <a4j:actionparam name="n" value="" assignTo="#{userBean.name}" />
+ <a4j:actionparam name="j" value="" assignTo="#{userBean.job}" />
+ </a4j:commandButton>
+ </a4j:region>
+
+ </h:form>
+</a4j:region>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample 2009-12-23 03:22:00 UTC (rev 16196)
@@ -0,0 +1,30 @@
+<h:form id="graphValidatorForm2">
+ <a4j:region renderRegionOnly="true">
+ <rich:graphValidator summary="Invalid values: " value="#{dayStatistics}">
+ <table>
+ <thead>
+ <tr>
+ <th>Activity</th>
+ <th>Time</th>
+ </tr>
+ </thead>
+ <tbody>
+ <a4j:repeat value="#{dayStatistics.dayPasstimes}" var="pt"
+ id="table">
+ <tr>
+ <td align="center" width="100px"><h:outputText
+ value="#{pt.title}" /></td>
+ <td align="center" width="100px"><rich:inputNumberSpinner
+ minValue="0" maxValue="24" value="#{pt.time}" id="time">
+ </rich:inputNumberSpinner></td>
+ <td><rich:message for="time" /></td>
+ </tr>
+ </a4j:repeat>
+ </tbody>
+ </table>
+ </rich:graphValidator>
+ <a4j:commandButton value="Store my details"
+ actionListener="#{dayStatistics.store}" reRender="panel" />
+ <rich:messages infoClass="green" errorClass="red" />
+ </a4j:region>
+</h:form>
15 years
JBoss Rich Faces SVN: r16195 - in root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk: apt and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-12-22 21:03:22 -0500 (Tue, 22 Dec 2009)
New Revision: 16195
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
Log:
Fixed AptBuilder lost during refactoring: http://fisheye.jboss.org/browse/RichFaces/root/cdk/trunk/plugins/generato...
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java 2009-12-23 01:25:02 UTC (rev 16194)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java 2009-12-23 02:03:22 UTC (rev 16195)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import java.io.File;
@@ -31,6 +29,7 @@
import java.util.List;
import java.util.Map;
+import org.richfaces.cdk.apt.AptBuilder;
import org.richfaces.cdk.generate.java.ComponentClassGenerator;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.templatecompiler.RendererClassGenerator;
@@ -48,10 +47,10 @@
* <p class="changed_added_4_0">Base CDK context class. Particular build tool ( Ant, Maven ) should extend that class with
* tool-specific methods.</p>
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class CdkContextBase implements CdkContext {
-
+
/* Map contains writer classes for standard outputs.
*/
static final ImmutableMap<OutputType, Class<? extends CdkWriter>> WRITERS =
@@ -62,10 +61,10 @@
/**
* map contain library model builder classes for each source type.
*/
- static final ImmutableMap<SourceType, Class<? extends ModelBuilder>> BUILDERS =
- ImmutableMap.<SourceType, Class<? extends ModelBuilder>>builder().put(StandardSources.FACES_CONFIGS,
- FacesConfigParser.class).put(StandardSources.RENDERER_TEMPLATES,
- RendererTemplateParser.class).build();
+ static final ImmutableMap<SourceType, Class<? extends ModelBuilder>> BUILDERS =
+ ImmutableMap.<SourceType, Class<? extends ModelBuilder>> builder().put(StandardSources.FACES_CONFIGS,
+ FacesConfigParser.class).put(StandardSources.JAVA_SOURCES, AptBuilder.class).put(
+ StandardSources.RENDERER_TEMPLATES, RendererTemplateParser.class).build();
private Map<String, String> options = Maps.newHashMap();
private Map<SourceType, Iterable<File>> sources = Maps.newHashMap();
@@ -81,7 +80,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.richfaces.cdk.CdkContext#getLoader()
*/
public CdkClassLoader getLoader() {
@@ -226,7 +225,7 @@
public String getOption(String name) {
return options.get(name);
}
-
+
/**
* This method returns instance of {@link CdkWriter} for given output type.
* @param type
@@ -237,18 +236,18 @@
public CdkWriter getGeneratorFor(OutputType type) throws CdkException {
CdkWriter generator = null;
Class<? extends CdkWriter> writerClass = CdkContextBase.WRITERS.get(type);
-
+
if (null != writerClass) {
generator = getWorker(writerClass);
} else {
generator = new DummyGenerator();
generator.init(this);
-
+
// TODO - make service method for new source types.
// throw new CdkException("No generator for type " +
// type.getName());
}
-
+
return generator;
}
@@ -262,18 +261,18 @@
public ModelBuilder getBuilderFor(SourceType type) throws CdkException {
ModelBuilder builder;
Class<? extends ModelBuilder> builderClass = CdkContextBase.BUILDERS.get(type);
-
+
if (null != builderClass) {
builder = getWorker(builderClass);
} else {
builder = new DummyBuilder();
builder.init(this);
-
+
// TODO - make service method for new source types.
// throw new CdkException("No model builder for source type " +
// type.getName());
}
-
+
return builder;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-12-23 01:25:02 UTC (rev 16194)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-12-23 02:03:22 UTC (rev 16195)
@@ -47,9 +47,9 @@
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.CdkWorker;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.LoggerFactory;
+import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.StandardOutputs;
import org.richfaces.cdk.StandardSources;
@@ -63,7 +63,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public class AptBuilder implements CdkWorker {
+public class AptBuilder implements ModelBuilder {
private static final Logger LOG = LoggerFactory.getLogger();
private boolean initialized = false;
private CdkContext context;
15 years
JBoss Rich Faces SVN: r16194 - in root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk: xmlconfig/model and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-12-22 20:25:02 -0500 (Tue, 22 Dec 2009)
New Revision: 16194
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
Log:
Generate default namespace for faces-config elements.
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2009-12-23 00:57:40 UTC (rev 16193)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2009-12-23 01:25:02 UTC (rev 16194)
@@ -16,8 +16,12 @@
@XmlAccessorType(XmlAccessType.NONE)
@javax.xml.bind.annotation.XmlSchema(
namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk", namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)}
-)
+ location = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION,
+ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED,
+ xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
+ namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE),
+ @javax.xml.bind.annotation.XmlNs(prefix = "",
+ namespaceURI = ComponentLibrary.FACES_CONFIG_NAMESPACE)})
package org.richfaces.cdk.model;
import javax.xml.bind.annotation.XmlAccessType;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-12-23 00:57:40 UTC (rev 16193)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-12-23 01:25:02 UTC (rev 16194)
@@ -8,8 +8,11 @@
@XmlAccessorType(XmlAccessType.NONE)
@javax.xml.bind.annotation.XmlSchema(namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
location = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION,
+ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED,
xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
- namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)})
+ namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE),
+ @javax.xml.bind.annotation.XmlNs(prefix = "",
+ namespaceURI = ComponentLibrary.FACES_CONFIG_NAMESPACE)})
@XmlJavaTypeAdapters({
@XmlJavaTypeAdapter(type = ClassDescription.class, value = ClassAdapter.class),
@XmlJavaTypeAdapter(type = ComponentLibrary.class, value = FacesConfigAdapter.class)
15 years
JBoss Rich Faces SVN: r16193 - root/docs/trunk/Component_Reference/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-12-22 19:57:40 -0500 (Tue, 22 Dec 2009)
New Revision: 16193
Modified:
root/docs/trunk/Component_Reference/en-US/Book_Info.xml
root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
root/docs/trunk/Component_Reference/en-US/Preface.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
Log:
Finished Validators
Modified: root/docs/trunk/Component_Reference/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-12-23 00:46:27 UTC (rev 16192)
+++ root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-12-23 00:57:40 UTC (rev 16193)
@@ -29,7 +29,7 @@
<year>&YEAR;</year>
<holder>&HOLDER;</holder>
</copyright>
- <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-12-23 00:46:27 UTC (rev 16192)
+++ root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-12-23 00:57:40 UTC (rev 16193)
@@ -3,9 +3,9 @@
]>
<book status="draft">
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--
+ <!--
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_Ajax_attributes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_features.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<part id="part-Component_Reference-a4j_tag_library">
Modified: root/docs/trunk/Component_Reference/en-US/Preface.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-12-23 00:46:27 UTC (rev 16192)
+++ root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-12-23 00:57:40 UTC (rev 16193)
@@ -3,10 +3,10 @@
]>
<preface id="pref-Component_Reference-Preface">
<title>Preface</title>
- <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
- <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
</xi:fallback>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2009-12-23 00:46:27 UTC (rev 16192)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2009-12-23 00:57:40 UTC (rev 16193)
@@ -66,7 +66,7 @@
</para>
<programlisting language="Java" role="JAVA">
-<xi:include href="extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="extras/exam-Component_Reference-exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</section>
@@ -100,8 +100,28 @@
</listitem>
</itemizedlist>
<para>
- Incomplete
+ The <sgmltag><rich:beanValidator></sgmltag> component provides model-based constraints using Hibernate Validator. This allows Hibernate Validator to be used similar to its use with Seam-based applications.
</para>
+ <para>
+ The <varname>summary</varname> attribute is used for displaying messages about validation errors.
+ </para>
+ <example id="exam-Component_Reference-richbeanValidator-richbeanValidator_example">
+ <title><sgmltag><rich:beanValidator></sgmltag> example</title>
+ <para>
+ This example shows the bean-based validation of a simple form, containing the user's name, email, and age. The <sgmltag><rich:beanValidator></sgmltag> component is defined in the same way as for <acronym>JSF</acronym> validators.
+ </para>
+
+<programlisting language="XML" role="XML">
+<xi:include href="extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <para>
+ The accompanying bean contains the validation data:
+ </para>
+
+<programlisting language="Java" role="JAVA">
+<xi:include href="extras/exam-Component_Reference-exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ </example>
</section>
<section id="sect-Component_Reference-Validation-richgraphValidator">
@@ -134,8 +154,38 @@
</listitem>
</itemizedlist>
<para>
- Incomplete
+ The <sgmltag><rich:graphValidator></sgmltag> component is used to wrap a group of input components for overall validation with Hibernate Validators. This is different from the <sgmltag><rich:beanValidator></sgmltag> component, which is used as a child element to individual input components.
</para>
+ <para>
+ The <varname>summary</varname> attribute is used for displaying messages about validation errors.
+ </para>
+ <example id="exam-Component_Reference-richgraphValidator-richgraphValidator_example">
+ <title><sgmltag><rich:graphValidator></sgmltag> example</title>
+ <para>
+ This example shows the validation of a simple form, containing the user's name, email, and age. The <sgmltag><rich:graphValidator></sgmltag> component wraps the input components to validate them together.
+ </para>
+
+<programlisting language="XML" role="XML">
+<xi:include href="extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <para>
+ The accompanying bean contains the validation data:
+ </para>
+
+<programlisting language="Java" role="JAVA">
+<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ </example>
+ <para>
+ The optional <varname>value</varname> attribute can be used to define a value bound to the bean. The bean properties are then validated again <emphasis>after</emphasis> the model has been updated.
+ </para>
+ <example id="exam-Component_Reference-richgraphValidator-Using_the_value_attribute">
+ <title>Using the <varname>value</varname> attribute</title>
+
+<programlisting language="XML" role="XML">
+<xi:include href="extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ </example>
</section>
</chapter>
15 years
JBoss Rich Faces SVN: r16192 - root/docs/trunk/Component_Reference/en-US/extras.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-12-22 19:46:27 -0500 (Tue, 22 Dec 2009)
New Revision: 16192
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample
Removed:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js
Log:
Adding examples
Copied: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js (from rev 16187, root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js)
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js 2009-12-23 00:46:27 UTC (rev 16192)
@@ -0,0 +1,65 @@
+package org.richfaces.demo.validation;
+
+import org.hibernate.validator.Email;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+
+public class ValidationBean {
+
+ private String progressString="Fill the form in";
+
+ @NotEmpty
+ @Pattern(regex=".*[^\\s].*", message="This string contains only spaces")
+ @Length(min=3,max=12)
+ private String name;
+ @Email
+ @NotEmpty
+ private String email;
+
+ @NotNull
+ @Min(18)
+ @Max(100)
+ private Integer age;
+
+ public ValidationBean() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+ public void success() {
+ setProgressString(getProgressString() + "(Stored successfully)");
+ }
+
+ public String getProgressString() {
+ return progressString;
+ }
+
+ public void setProgressString(String progressString) {
+ this.progressString = progressString;
+ }
+}
Deleted: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js 2009-12-23 00:09:13 UTC (rev 16191)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js 2009-12-23 00:46:27 UTC (rev 16192)
@@ -1,65 +0,0 @@
-package org.richfaces.demo.validation;
-
-import org.hibernate.validator.Email;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.Max;
-import org.hibernate.validator.Min;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
-
-public class ValidationBean {
-
- private String progressString="Fill the form in";
-
- @NotEmpty
- @Pattern(regex=".*[^\\s].*", message="This string contains only spaces")
- @Length(min=3,max=12)
- private String name;
- @Email
- @NotEmpty
- private String email;
-
- @NotNull
- @Min(18)
- @Max(100)
- private Integer age;
-
- public ValidationBean() {
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public Integer getAge() {
- return age;
- }
-
- public void setAge(Integer age) {
- this.age = age;
- }
- public void success() {
- setProgressString(getProgressString() + "(Stored successfully)");
- }
-
- public String getProgressString() {
- return progressString;
- }
-
- public void setProgressString(String progressString) {
- this.progressString = progressString;
- }
-}
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample 2009-12-23 00:46:27 UTC (rev 16192)
@@ -0,0 +1,27 @@
+<h:form id="beanValidatorForm">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{validationBean.progressString}" id="progress"/>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <rich:beanValidator summary="Invalid name"/>
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email">
+ <rich:beanValidator summary="Invalid email"/>
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}" id="age">
+ <rich:beanValidator summary="Wrong age"/>
+ </h:inputText>
+ <rich:message for="age" />
+ <f:facet name="footer">
+ <a4j:commandButton value="Submit" action="#{validationBean.success}" reRender="progress"/>
+ </f:facet>
+ </h:panelGrid>
+ </rich:panel>
+</h:form>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample 2009-12-23 00:46:27 UTC (rev 16192)
@@ -0,0 +1,33 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="graphValidatorForm">
+ <a4j:region renderRegionOnly="true">
+ <rich:panel id="panel">
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <rich:graphValidator summary="Invalid values: ">
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="2" />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email" />
+ <rich:message for="email" />
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}" id="age" />
+ <rich:message for="age" />
+ </h:panelGrid>
+ </rich:graphValidator>
+ <a4j:commandButton value="Store changes" />
+ </rich:panel>
+ </a4j:region>
+ </h:form>
+</ui:composition>
15 years