JBoss Rich Faces SVN: r2076 - in trunk/ui/separator/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-08-06 10:56:08 -0400 (Mon, 06 Aug 2007)
New Revision: 2076
Modified:
trunk/ui/separator/src/main/config/component/separator.xml
trunk/ui/separator/src/main/java/org/richfaces/component/UISeparator.java
trunk/ui/separator/src/main/java/org/richfaces/renderkit/html/SeparatorRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-542
Modified: trunk/ui/separator/src/main/config/component/separator.xml
===================================================================
--- trunk/ui/separator/src/main/config/component/separator.xml 2007-08-06 14:18:59 UTC (rev 2075)
+++ trunk/ui/separator/src/main/config/component/separator.xml 2007-08-06 14:56:08 UTC (rev 2076)
@@ -37,7 +37,7 @@
<classname>java.lang.String</classname>
<description>The separator width that can be defined in pixels or in percents. The default value is 100%
</description>
- <defaultvalue>"100%"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>height</name>
Modified: trunk/ui/separator/src/main/java/org/richfaces/component/UISeparator.java
===================================================================
--- trunk/ui/separator/src/main/java/org/richfaces/component/UISeparator.java 2007-08-06 14:18:59 UTC (rev 2075)
+++ trunk/ui/separator/src/main/java/org/richfaces/component/UISeparator.java 2007-08-06 14:56:08 UTC (rev 2076)
@@ -30,7 +30,7 @@
public abstract class UISeparator extends UIComponentBase {
public static final String DEFAULT_HEIGHT = "6px";
- public static final String DEFAULT_WIDTH = "100%";
+ public static final String DEFAULT_WIDTH = "";
public static final String LINE_TYPE_BEVEL = "beveled";
public static final String LINE_TYPE_DOUBLE = "double";
public static final String LINE_TYPE_DOTTED = "dotted";
Modified: trunk/ui/separator/src/main/java/org/richfaces/renderkit/html/SeparatorRendererBase.java
===================================================================
--- trunk/ui/separator/src/main/java/org/richfaces/renderkit/html/SeparatorRendererBase.java 2007-08-06 14:18:59 UTC (rev 2075)
+++ trunk/ui/separator/src/main/java/org/richfaces/renderkit/html/SeparatorRendererBase.java 2007-08-06 14:56:08 UTC (rev 2076)
@@ -58,7 +58,11 @@
} else {
height = hO.toString();
}
- return getUtils().encodePctOrPx(height);
+ if (height.trim().length() == 0) {
+ return height;
+ } else {
+ return getUtils().encodePctOrPx(height);
+ }
}
protected Class getComponentClass() {
17 years, 5 months
JBoss Rich Faces SVN: r2075 - trunk/ui/calendar/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-08-06 10:18:59 -0400 (Mon, 06 Aug 2007)
New Revision: 2075
Modified:
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
added button "Reset" for readonly mode
added onclick attribute for input.
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-06 13:44:50 UTC (rev 2074)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-06 14:18:59 UTC (rev 2075)
@@ -63,9 +63,11 @@
addPopupToAjaxRendered(context, component);
Boolean readonly = Boolean.FALSE;
String hidden = "text";
+ String onclick =null;
String inputType = component.getAttributes().get("inputType").toString();
if(inputType.equals("readonly")){
readonly=Boolean.TRUE;
+ onclick = "$(this.form.id+':calendar').component.doExpand();";
}
else{
if (inputType.equals("hidden")){
@@ -74,6 +76,7 @@
}
variables.setVariable("readonly",readonly);
variables.setVariable("hidden",hidden);
+ variables.setVariable("onclick",onclick);
]]>
</jsp:scriptlet>
@@ -97,18 +100,34 @@
size="#{component.attributes['inputSize']}"
style="#{component.attributes['style']}"
tabindex="#{component.attributes['tabindex']}"
- onclick="#{component.attributes['onclick']}">
+ onclick="#{onclick}">
</input>
<button id="#{clientId}PopupButton"
accesskey="#{component.attributes['accesskey']}"
name="#{clientId}"
- onclick="$(this.form.id+':calendar').component.doExpand();"
-
+ onclick="$(this.form.id+':calendar').component.doExpand();"
style="#{component.attributes['style']}"
tabindex="#{component.attributes['tabindex']}"
type="button">
#{component.attributes['buttonLabel']}
</button>
+ <jsp:scriptlet>
+ <![CDATA[
+ if(readonly.booleanValue()){
+ ]]>
+ </jsp:scriptlet>
+ <button
+ id="#{clientId}ResetButton"
+ type="button"
+ onclick="$(this.form.id+':calendar').component.resetSelectedDate();"
+ >
+ Reset
+ </button>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
</span>
<jsp:scriptlet>
<![CDATA[
17 years, 5 months
JBoss Rich Faces SVN: r2074 - in trunk: framework/api/src/main/java/org/richfaces/event and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-06 09:44:50 -0400 (Mon, 06 Aug 2007)
New Revision: 2074
Added:
trunk/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java
trunk/framework/api/src/main/java/org/richfaces/component/Selectable.java
trunk/framework/api/src/main/java/org/richfaces/component/Sortable.java
trunk/framework/api/src/main/java/org/richfaces/event/scroll/
trunk/framework/api/src/main/java/org/richfaces/event/sort/
trunk/framework/api/src/main/java/org/richfaces/model/GridDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableGridRange.java
trunk/framework/api/src/main/java/org/richfaces/model/SortField.java
trunk/framework/api/src/main/java/org/richfaces/model/SortOrder.java
trunk/framework/api/src/main/java/org/richfaces/model/selection/
trunk/framework/impl/src/main/java/org/richfaces/model/
trunk/framework/impl/src/test/java/org/richfaces/model/
trunk/samples/scrollable-grid-demo/
trunk/ui/scrollable-grid/
Removed:
trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java
trunk/sandbox/api/src/main/java/org/richfaces/component/Selectable.java
trunk/sandbox/api/src/main/java/org/richfaces/component/Sortable.java
trunk/sandbox/api/src/main/java/org/richfaces/event/scroll/
trunk/sandbox/api/src/main/java/org/richfaces/event/sort/
trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java
trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java
trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java
trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java
trunk/sandbox/api/src/main/java/org/richfaces/model/selection/
trunk/sandbox/impl/src/main/java/org/richfaces/model/
trunk/sandbox/impl/src/test/java/org/richfaces/model/
trunk/sandbox/samples/scrollable-grid-demo/
trunk/sandbox/ui/scrollable-grid/
Modified:
trunk/samples/pom.xml
trunk/samples/scrollable-grid-demo/pom.xml
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
trunk/ui/pom.xml
trunk/ui/scrollable-grid/pom.xml
Log:
moved scrollable grid into ui project
Copied: trunk/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,13 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScriptExportable {
+ public String getScriptVar();
+ public void setScriptVar(String s);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/component/Selectable.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/component/Selectable.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Selectable.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Selectable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+import org.richfaces.model.selection.Selection;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface Selectable {
+ public Selection getSelection();
+ public void setSelection (Selection selection);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/component/Sortable.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/component/Sortable.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Sortable.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Sortable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,23 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/component/Sortable.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.component;
+
+import org.richfaces.model.SortOrder;
+
+
+/**
+ * @author Maksim Kaszynski
+ * Base interface for sort capable components
+ */
+public interface Sortable {
+ public SortOrder getSortOrder();
+ public void setSortOrder(SortOrder sortOrder);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/event/scroll (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/event/scroll)
Copied: trunk/framework/api/src/main/java/org/richfaces/event/sort (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/event/sort)
Copied: trunk/framework/api/src/main/java/org/richfaces/model/GridDataModel.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/GridDataModel.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/GridDataModel.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,208 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Base class for data models
+ * Subclasses must implement {@link #loadData(int, int, SortOrder)}
+ * For certain features (like selection and sorting) to work correctly together,
+ * {@link #getId(Object)} and {@link #getObjectById(Object)}
+ * methods need to be overriden
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class GridDataModel extends ExtendedDataModel {
+
+ /**
+ * Simple implementation - index-based row key
+ * @author Maksim Kaszynski
+ *
+ */
+ private static class SimpleRowKey implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ private int i;
+
+ public SimpleRowKey(int i) {
+ super();
+ this.i = i;
+ }
+
+ public int intValue() {
+ return i;
+ }
+
+ public String toString() {
+ return String.valueOf(i);
+ }
+ }
+
+
+ private static final Log log = LogFactory.getLog(GridDataModel.class);
+
+ private Object rowKey;
+
+ private Map mapping;
+
+ private SortOrder lastSortOrder;
+
+ /**
+ * Load range of data items from the source.
+ * Starting from startRow, and up to but excluding endRow
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return list of ordered data
+ */
+ public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
+
+
+ /**
+ * Load data range, and iterate over it
+ */
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ if (log.isTraceEnabled()) {
+ log.trace("Starting walk");
+ }
+
+ ScrollableGridRange sequenceRange = (ScrollableGridRange) range;
+
+ int startIndex = sequenceRange.getFirst();
+ int last = sequenceRange.getLast();
+
+ lastSortOrder = sequenceRange.getSortOrder();
+
+ List objects = loadData(startIndex, last, lastSortOrder);
+
+ mapping = new HashMap();
+
+ for (int i = 0; i < objects.size(); i++,startIndex++) {
+ Object data = objects.get(i);
+ Object key = getId(data);
+
+ if (key == null) {
+ key = new SimpleRowKey(startIndex);
+ }
+
+ mapping.put(key, data);
+
+ visitor.process(context, key, argument);
+
+ }
+
+ if (log.isTraceEnabled()) {
+ log.trace("Ending walk");
+ }
+
+ }
+
+
+ /**
+ * This method is the reverse of {@link #getId(Object)}
+ * If you override this method, you need to override {@link #getId(Object)} as well
+ * @param id
+ * @return
+ */
+ public Object getObjectById(Object id) {
+
+ if (id instanceof SimpleRowKey) {
+ int i = ((SimpleRowKey) id).intValue();
+
+ List l = loadData(i, i + 1, lastSortOrder);
+
+ return l.get(0);
+
+ }
+
+ return null;
+ }
+
+ /**
+ * To get rid of Entity interface, method is introduced
+ * Implementations may override it to provide domain-specific searches
+ * Id should be serializable
+ * Default implementation returns <code>null</code> anyway
+ * If you override this method, you need to override {@link #getObjectById(Object)} as well
+ * @param o
+ * @return
+ */
+ public Object getId(Object o) {
+ return null;
+ }
+
+
+ public Object getRowData() {
+
+ if (mapping != null && mapping.containsKey(rowKey)) {
+ return mapping.get(rowKey);
+ } else {
+ return loadAndMap(rowKey);
+ }
+
+ }
+
+ /**
+ * Row indexes navigation is no longer supported
+ */
+ public int getRowIndex() {
+ throw new UnsupportedOperationException("getRowIndex");
+ }
+
+ /**
+ * Quite simple implementation - data will be cached, so the call will be cheap
+ */
+ public boolean isRowAvailable() {
+ return getRowData() != null;
+ }
+
+ /**
+ * Row indexes navigation is no longer supported
+ */
+ public void setRowIndex(int arg0) {
+ throw new UnsupportedOperationException("setRowIndex");
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public void setRowKey(Object key) {
+ rowKey = key;
+ }
+
+ private Object loadAndMap(Object id) {
+
+ if (log.isTraceEnabled()) {
+ log.trace("loadAndMap " + id);
+ }
+
+ Object o = getObjectById(id);
+ if (o != null) {
+ if (mapping == null) {
+ mapping = new HashMap();
+ }
+ mapping.put(id, o);
+ }
+ return o;
+ }
+
+
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableGridRange.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableGridRange.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,93 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/ScrollableGridRange.java,v $
+ * $Revision: 1.7 $
+ */
+
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+import org.ajax4jsf.model.Range;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ */
+public class ScrollableGridRange implements Range, Serializable{
+
+ private static final long serialVersionUID = -6675002421400464892L;
+
+ private int first = 0;
+ private int last = 0;
+ private SortOrder sortOrder;
+
+ public ScrollableGridRange(int first, int last, SortOrder sortOrder) {
+ super();
+ this.first = first;
+ this.last = last;
+ this.sortOrder = sortOrder;
+ }
+
+ /**
+ * @return the bufferSize
+ */
+ public int getLast() {
+ return last;
+ }
+ /**
+ * @param bufferSize the bufferSize to set
+ */
+ public void setLast(int lastRow) {
+ this.last = lastRow;
+ }
+ /**
+ * @return the first
+ */
+ public int getFirst() {
+ return first;
+ }
+ /**
+ * @param first the first to set
+ */
+ public void setFirst(int first) {
+ this.first = first;
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ public boolean equals(Object obj) {
+
+ if(!(obj instanceof ScrollableGridRange)){
+ return super.equals(obj);
+ }
+
+ ScrollableGridRange ref = (ScrollableGridRange)obj;
+
+ boolean ret = (this.first == ref.first)&&(this.last == ref.last );
+
+ if(this.sortOrder != null){
+ ret = ret && this.sortOrder.equals(ref.sortOrder);
+ } else {
+ ret = (ret && (ref.sortOrder == null));
+ }
+
+ return ret;
+ }
+
+ public int hashCode() {
+ return super.hashCode();
+ }
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/SortField.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/SortField.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/SortField.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,89 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortField implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String name = null;
+ private int index = -1;
+ private Boolean ascending = null;
+
+
+
+ public SortField(String name, int index, Boolean ascending) {
+ super();
+ this.name = name;
+ this.index = index;
+ this.ascending = ascending;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public Boolean getAscending() {
+ return ascending;
+ }
+
+ public void setAscending(Boolean ascending) {
+ this.ascending = ascending;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((ascending == null) ? 0 : ascending.hashCode());
+ result = prime * result + index;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SortField other = (SortField) obj;
+ if (ascending == null) {
+ if (other.ascending != null)
+ return false;
+ } else if (!ascending.equals(other.ascending))
+ return false;
+ if (index != other.index)
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+
+
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/SortOrder.java (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/SortOrder.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/SortOrder.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -0,0 +1,70 @@
+package org.richfaces.model;
+
+import java.io.Serializable;
+import java.util.Arrays;
+/**
+ *
+ * @author Maksim Kaszynski
+ *
+ *
+ */
+public class SortOrder implements Serializable {
+
+ private static int hashCode(Object[] array) {
+ final int prime = 31;
+ if (array == null)
+ return 0;
+ int result = 1;
+ for (int index = 0; index < array.length; index++) {
+ result = prime * result
+ + (array[index] == null ? 0 : array[index].hashCode());
+ }
+ return result;
+ }
+
+ private static final long serialVersionUID = 2423450561570551363L;
+
+ private SortField [] fields;
+
+ public SortOrder() {
+
+ }
+
+ public SortOrder(SortField[] fields) {
+ super();
+ this.fields = fields;
+ }
+
+
+
+ public SortField[] getFields() {
+ return fields;
+ }
+
+ public void setFields(SortField[] fields) {
+ this.fields = fields;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + SortOrder.hashCode(fields);
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SortOrder other = (SortOrder) obj;
+ if (!Arrays.equals(fields, other.fields))
+ return false;
+ return true;
+ }
+
+
+
+}
\ No newline at end of file
Copied: trunk/framework/api/src/main/java/org/richfaces/model/selection (from rev 2069, trunk/sandbox/api/src/main/java/org/richfaces/model/selection)
Copied: trunk/framework/impl/src/main/java/org/richfaces/model (from rev 2069, trunk/sandbox/impl/src/main/java/org/richfaces/model)
Copied: trunk/framework/impl/src/test/java/org/richfaces/model (from rev 2069, trunk/sandbox/impl/src/test/java/org/richfaces/model)
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/samples/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -459,5 +459,6 @@
-->
<module>panelmenu-sample</module>
<module>rich-message-demo</module>
+ <module>scrollable-grid-demo</module>
</modules>
</project>
\ No newline at end of file
Copied: trunk/samples/scrollable-grid-demo (from rev 2069, trunk/sandbox/samples/scrollable-grid-demo)
Modified: trunk/samples/scrollable-grid-demo/pom.xml
===================================================================
--- trunk/sandbox/samples/scrollable-grid-demo/pom.xml 2007-08-06 10:39:16 UTC (rev 2069)
+++ trunk/samples/scrollable-grid-demo/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,17 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>samples</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>scrollable-grid-demo</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces.samples</groupId>
<packaging>war</packaging>
<name>scrollable-grid-demo Maven Webapp</name>
<dependencies>
<dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>scrollable-grid</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,13 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface ScriptExportable {
- public String getScriptVar();
- public void setScriptVar(String s);
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/component/Selectable.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/component/Selectable.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/component/Selectable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,15 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import org.richfaces.model.selection.Selection;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Selectable {
- public Selection getSelection();
- public void setSelection (Selection selection);
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/component/Sortable.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/component/Sortable.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/component/Sortable.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,23 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/component/Sortable.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.component;
-
-import org.richfaces.model.SortOrder;
-
-
-/**
- * @author Maksim Kaszynski
- * Base interface for sort capable components
- */
-public interface Sortable {
- public SortOrder getSortOrder();
- public void setSortOrder(SortOrder sortOrder);
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,208 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Base class for data models
- * Subclasses must implement {@link #loadData(int, int, SortOrder)}
- * For certain features (like selection and sorting) to work correctly together,
- * {@link #getId(Object)} and {@link #getObjectById(Object)}
- * methods need to be overriden
- *
- * @author Maksim Kaszynski
- *
- */
-public abstract class GridDataModel extends ExtendedDataModel {
-
- /**
- * Simple implementation - index-based row key
- * @author Maksim Kaszynski
- *
- */
- private static class SimpleRowKey implements Serializable{
-
- private static final long serialVersionUID = 1L;
- private int i;
-
- public SimpleRowKey(int i) {
- super();
- this.i = i;
- }
-
- public int intValue() {
- return i;
- }
-
- public String toString() {
- return String.valueOf(i);
- }
- }
-
-
- private static final Log log = LogFactory.getLog(GridDataModel.class);
-
- private Object rowKey;
-
- private Map mapping;
-
- private SortOrder lastSortOrder;
-
- /**
- * Load range of data items from the source.
- * Starting from startRow, and up to but excluding endRow
- * @param startRow
- * @param endRow
- * @param sortOrder
- * @return list of ordered data
- */
- public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
-
-
- /**
- * Load data range, and iterate over it
- */
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- if (log.isTraceEnabled()) {
- log.trace("Starting walk");
- }
-
- ScrollableGridRange sequenceRange = (ScrollableGridRange) range;
-
- int startIndex = sequenceRange.getFirst();
- int last = sequenceRange.getLast();
-
- lastSortOrder = sequenceRange.getSortOrder();
-
- List objects = loadData(startIndex, last, lastSortOrder);
-
- mapping = new HashMap();
-
- for (int i = 0; i < objects.size(); i++,startIndex++) {
- Object data = objects.get(i);
- Object key = getId(data);
-
- if (key == null) {
- key = new SimpleRowKey(startIndex);
- }
-
- mapping.put(key, data);
-
- visitor.process(context, key, argument);
-
- }
-
- if (log.isTraceEnabled()) {
- log.trace("Ending walk");
- }
-
- }
-
-
- /**
- * This method is the reverse of {@link #getId(Object)}
- * If you override this method, you need to override {@link #getId(Object)} as well
- * @param id
- * @return
- */
- public Object getObjectById(Object id) {
-
- if (id instanceof SimpleRowKey) {
- int i = ((SimpleRowKey) id).intValue();
-
- List l = loadData(i, i + 1, lastSortOrder);
-
- return l.get(0);
-
- }
-
- return null;
- }
-
- /**
- * To get rid of Entity interface, method is introduced
- * Implementations may override it to provide domain-specific searches
- * Id should be serializable
- * Default implementation returns <code>null</code> anyway
- * If you override this method, you need to override {@link #getObjectById(Object)} as well
- * @param o
- * @return
- */
- public Object getId(Object o) {
- return null;
- }
-
-
- public Object getRowData() {
-
- if (mapping != null && mapping.containsKey(rowKey)) {
- return mapping.get(rowKey);
- } else {
- return loadAndMap(rowKey);
- }
-
- }
-
- /**
- * Row indexes navigation is no longer supported
- */
- public int getRowIndex() {
- throw new UnsupportedOperationException("getRowIndex");
- }
-
- /**
- * Quite simple implementation - data will be cached, so the call will be cheap
- */
- public boolean isRowAvailable() {
- return getRowData() != null;
- }
-
- /**
- * Row indexes navigation is no longer supported
- */
- public void setRowIndex(int arg0) {
- throw new UnsupportedOperationException("setRowIndex");
- }
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public void setRowKey(Object key) {
- rowKey = key;
- }
-
- private Object loadAndMap(Object id) {
-
- if (log.isTraceEnabled()) {
- log.trace("loadAndMap " + id);
- }
-
- Object o = getObjectById(id);
- if (o != null) {
- if (mapping == null) {
- mapping = new HashMap();
- }
- mapping.put(id, o);
- }
- return o;
- }
-
-
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,93 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/ScrollableGridRange.java,v $
- * $Revision: 1.7 $
- */
-
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-import org.ajax4jsf.model.Range;
-
-
-
-/**
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- */
-public class ScrollableGridRange implements Range, Serializable{
-
- private static final long serialVersionUID = -6675002421400464892L;
-
- private int first = 0;
- private int last = 0;
- private SortOrder sortOrder;
-
- public ScrollableGridRange(int first, int last, SortOrder sortOrder) {
- super();
- this.first = first;
- this.last = last;
- this.sortOrder = sortOrder;
- }
-
- /**
- * @return the bufferSize
- */
- public int getLast() {
- return last;
- }
- /**
- * @param bufferSize the bufferSize to set
- */
- public void setLast(int lastRow) {
- this.last = lastRow;
- }
- /**
- * @return the first
- */
- public int getFirst() {
- return first;
- }
- /**
- * @param first the first to set
- */
- public void setFirst(int first) {
- this.first = first;
- }
-
- public SortOrder getSortOrder() {
- return sortOrder;
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- this.sortOrder = sortOrder;
- }
-
- public boolean equals(Object obj) {
-
- if(!(obj instanceof ScrollableGridRange)){
- return super.equals(obj);
- }
-
- ScrollableGridRange ref = (ScrollableGridRange)obj;
-
- boolean ret = (this.first == ref.first)&&(this.last == ref.last );
-
- if(this.sortOrder != null){
- ret = ret && this.sortOrder.equals(ref.sortOrder);
- } else {
- ret = (ret && (ref.sortOrder == null));
- }
-
- return ret;
- }
-
- public int hashCode() {
- return super.hashCode();
- }
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,89 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortField implements Serializable{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private String name = null;
- private int index = -1;
- private Boolean ascending = null;
-
-
-
- public SortField(String name, int index, Boolean ascending) {
- super();
- this.name = name;
- this.index = index;
- this.ascending = ascending;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getIndex() {
- return index;
- }
-
- public void setIndex(int index) {
- this.index = index;
- }
-
- public Boolean getAscending() {
- return ascending;
- }
-
- public void setAscending(Boolean ascending) {
- this.ascending = ascending;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((ascending == null) ? 0 : ascending.hashCode());
- result = prime * result + index;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final SortField other = (SortField) obj;
- if (ascending == null) {
- if (other.ascending != null)
- return false;
- } else if (!ascending.equals(other.ascending))
- return false;
- if (index != other.index)
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-
-
-
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,70 +0,0 @@
-package org.richfaces.model;
-
-import java.io.Serializable;
-import java.util.Arrays;
-/**
- *
- * @author Maksim Kaszynski
- *
- *
- */
-public class SortOrder implements Serializable {
-
- private static int hashCode(Object[] array) {
- final int prime = 31;
- if (array == null)
- return 0;
- int result = 1;
- for (int index = 0; index < array.length; index++) {
- result = prime * result
- + (array[index] == null ? 0 : array[index].hashCode());
- }
- return result;
- }
-
- private static final long serialVersionUID = 2423450561570551363L;
-
- private SortField [] fields;
-
- public SortOrder() {
-
- }
-
- public SortOrder(SortField[] fields) {
- super();
- this.fields = fields;
- }
-
-
-
- public SortField[] getFields() {
- return fields;
- }
-
- public void setFields(SortField[] fields) {
- this.fields = fields;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + SortOrder.hashCode(fields);
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final SortOrder other = (SortOrder) obj;
- if (!Arrays.equals(fields, other.fields))
- return false;
- return true;
- }
-
-
-
-}
\ No newline at end of file
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/samples/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -13,7 +13,6 @@
<name>RichFaces Sandbox Components Examples</name>
<modules>
- <module>scrollable-grid-demo</module>
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
</modules>
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/sandbox/ui/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -13,7 +13,6 @@
<name>Richfaces Sandbox UI</name>
<modules>
<module>panel2</module>
- <module>scrollable-grid</module>
<module>simpleTogglePanel2</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2007-08-06 13:07:23 UTC (rev 2073)
+++ trunk/ui/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -84,6 +84,7 @@
<module>calendar</module>
<module>treeModel</module>
<module>message</module>
+ <module>scrollable-grid</module>
</modules>
<dependencies>
<dependency>
Copied: trunk/ui/scrollable-grid (from rev 2069, trunk/sandbox/ui/scrollable-grid)
Modified: trunk/ui/scrollable-grid/pom.xml
===================================================================
--- trunk/sandbox/ui/scrollable-grid/pom.xml 2007-08-06 10:39:16 UTC (rev 2069)
+++ trunk/ui/scrollable-grid/pom.xml 2007-08-06 13:44:50 UTC (rev 2074)
@@ -1,11 +1,11 @@
<?xml version="1.0"?><project>
<parent>
<artifactId>ui</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>scrollable-grid</artifactId>
<version>3.1.0-SNAPSHOT</version>
<name>Scrollable Grid</name>
@@ -67,15 +67,5 @@
<artifactId>richfaces-impl</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.sandbox</groupId>
- <artifactId>richfaces-sandbox-impl</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r2073 - in trunk/docs/userguide/en/src/main/docbook: included and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-06 09:07:23 -0400 (Mon, 06 Aug 2007)
New Revision: 2073
Added:
trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/actionparam.xml
trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.xml
trunk/docs/userguide/en/src/main/docbook/included/commandButton.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/commandButton.xml
trunk/docs/userguide/en/src/main/docbook/included/commandLink.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/commandLink.xml
trunk/docs/userguide/en/src/main/docbook/included/form.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/form.xml
trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.xml
trunk/docs/userguide/en/src/main/docbook/included/include.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/include.xml
trunk/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml
trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/keepAlive.xml
trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/loadBundle.xml
trunk/docs/userguide/en/src/main/docbook/included/loadScript.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/loadScript.xml
trunk/docs/userguide/en/src/main/docbook/included/loadStyle.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/loadStyle.xml
trunk/docs/userguide/en/src/main/docbook/included/log.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/log.xml
trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
trunk/docs/userguide/en/src/main/docbook/included/outputPanel.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/page.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/page.xml
trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/poll.xml
trunk/docs/userguide/en/src/main/docbook/included/portlet.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/portlet.xml
trunk/docs/userguide/en/src/main/docbook/included/push.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/push.xml
trunk/docs/userguide/en/src/main/docbook/included/region.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/region.xml
trunk/docs/userguide/en/src/main/docbook/included/repeat.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/repeat.xml
trunk/docs/userguide/en/src/main/docbook/included/status.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/status.xml
trunk/docs/userguide/en/src/main/docbook/included/support.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/support.xml
Modified:
trunk/docs/userguide/en/src/main/docbook/master.xml
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-522
Guides chapters merging
Added: trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <para>The <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis> component combines the functionality of both JSF components: <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> and <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>.</para>
+ <para>More information about <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> and <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis> can be found <ulink
+ url="http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/index.html"
+ >here</ulink>.</para>
+</section>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/actionparam.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/actionparam.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/actionparam.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <para>
+ <table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.ActionParameter</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry> </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlActionParameter</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry> </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple component definition example:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:actionParam noEscape="true" name="param1" value="getMyValue()" assignTo="#{bean.prop1}" />]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlActionParameter;
+...
+HtmlActionParameter myActionParameter = new HtmlActionParameter();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis> is a combination of the functionality of two JSF tags: <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> and <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>.</para>
+ <para>At the render phase, it's decoded by parent component (<emphasis role="bold">
+ <property><h:commandLink></property>
+ </emphasis> or like) as usual. At the process request phase, if the parent component
+ performs an action event, update the value specified in the "assignTo"
+ attribute as its value. If a converter attribute is specified, use it to encode and
+ decode the value to a string stored in the html parameter.</para>
+ <para><emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>has a "noEscape" attribute. If it is set to
+ "true", the value will be evaluated as a JavaScript code. </para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[...
+ <script>
+ ...
+ var foo = "bar";
+ ...
+ </script>
+ ...
+ <a4j:actionParam noEscape="true" name="param1" value="foo" assignTo="#{bean.prop1}" />
+...]]></programlisting>
+ <para>
+ The <emphasis role="bold"><property><a4j:param></property></emphasis> extends
+ <emphasis role="bold"><property><f:param></property></emphasis>, so the "name" attribute is mandatory.
+ Otherwise, the value will be missing due missing the request parameter name for it.
+ </para>
+ </section>
+
+ <section>
+ <title>Relevant resources links</title>
+ <para>More information can be found on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063764"
+ >Ajax4JSF Users Forum</ulink>.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <para>The <emphasis role="bold"><property><a4j:ajaxListener></property></emphasis>
+component is the same one as "ActionListener" or "ValueChangeListener", but for an AJAX container.</para>
+</section>
Added: trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.Listener</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Listener</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.AjaxListener</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <!--
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple Component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="XML"><![CDATA[<a4j:ajaxListenet type=""/>
+]]></programlisting>
+ </section>
+ -->
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxListener;
+...
+AjaxListener myListener = new AjaxListener();
+...
+ ]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+Additional to the listeners provided by JSF specification, RichFaces add one more: Ajax Listener (
+ <emphasis role="bold"><property><a4j:ajaxListener></property>
+ </emphasis>).
+Ajax Listener is invoked before the Render Response phase. Instead of Action Listener of Value Change Listener which are not
+invoked when Validation of Update Model phases failed, Ajax Listener is guarantied to be invoked for each Ajax response. So, it is
+a good place for update the list of re-rendered components, for example.
+Ajax Listener is not invoked for non-Ajax request and when RichFaces works in "Ajax Request generates
+Non-Ajax Response" mode. Therefore, Ajax Listener invocation is a good indicator that Ajax response is going to be processed.
+Attribute 'type' defines the fully qualified Java class name for listener. This class should implement org.ajax4jsf.events.AjaxListener interface.
+You can access to the source of the event (Ajax component) using event.getSource() call.
+ </para>
+
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/commandButton.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/commandButton.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/commandButton.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>component is very similar to the<emphasis role="bold">
+ <property><h:commandButton></property>
+ </emphasis>component, the only difference is that an AJAX form submit is generated on a click and it allows dynamic rerendering after a response comes back. It's not necessary to plug any support into the component, as AJAX support is already built in.</para>
+</section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/commandButton.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/commandButton.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/commandButton.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,63 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.CommandButton</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Command </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlCommandButton</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxCommandButtonRenderer </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+ <section>
+ <title>Creating on a page</title>
+ <para><emphasis role="bold"><property><a4j:commandButton></property></emphasis> is used in the same way as <emphasis role="bold"><property><h:commandButton></property></emphasis>, but with definition of the area that is updated after the response comes back from the server.</para>
+ <programlisting role="XML"><![CDATA[<a4j:commandButton reRender="someData" action="#{bean.action1}" value="Link"/>]]></programlisting>
+ <para>This definition of the component provides a link, a click on the link causes an AJAX form submit on the server, "action1" method performance, and rendering of the component with "someData" id after the response comes back from the server.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxCommandButton;
+...
+HtmlAjaxCommandButton myButton = new HtmlAjaxCommandButton();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component <emphasis role="bold"><property><a4j:commandButton></property></emphasis> placed on a page generates the following HTML code:</para>
+ <programlisting role="XHTML"><![CDATA[<input type="submit" onclick="A4J.AJAX.Submit(...request parameters);return false;" value="sort"/>
+]]></programlisting>
+ <para>Hence, the utility method "A4J.AJAX.Submit" is called on a click, the method performs AJAX request as the <emphasis role="bold"><property><a4j:support></property></emphasis> component</para>
+ <note>
+ <title>Note:</title>
+ <para>AJAX support is built in and it's not necessary to add nested <emphasis role="bold"><property><a4j:support></property></emphasis> to the component.</para>
+ </note>
+ <para>Common JSF navigation could be performed after an AJAX submit and partial rendering, but Navigation Case must be defined as <emphasis role="bold"><property><redirect/></property></emphasis> in order to avoid problems with some browsers.</para>
+ <para>As any Ajax4jsf component sending AJAX requests and processing server responses <emphasis role="bold"><property><a4j:commandButton></property></emphasis> has all attributes described above (see <emphasis role="bold"><property><a4j:support></property></emphasis> chapter) that provide the required behavior of requests sending (delay, limitation of submit area and rendering, and etc.)</para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/commandLink.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/commandLink.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/commandLink.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+<section>
+<title>Description</title>
+ <para> The <emphasis role="bold">
+ <property><a4j:commandLink></property>
+ </emphasis>component is very similar to the <emphasis role="bold">
+ <property><h:commandLink></property>
+ </emphasis> component, the only difference is that an AJAX form submit is generated on a click and it allows dynamic rerendering after a response comes back. It's not necessary to plug any support into the component, as AJAX support is already built in.</para>
+</section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/commandLink.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/commandLink.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/commandLink.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,72 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.CommandLink</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Command </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlCommandLink</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxCommandLinkRenderer </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+
+ <section>
+ <title>Creating on a page</title>
+ <para><emphasis role="bold"><property><a4j:commandLink></property></emphasis> is used in the same way as <emphasis role="bold"><property><h:commandLink></property></emphasis>, but with definition of the area that is updated after the response comes back from the server.</para>
+ <programlisting role="XML"><![CDATA[<a4j:commandLink reRender="someData" action="#{bean.action1}" value="Link"/>]]></programlisting>
+ <para>This definition of the component provides a link, and a click on the link causes an AJAX form
+ submit on the server, "action1" method performance, and rendering of the component
+ with "someData" id after the response comes back from the server.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxCommandLink;
+...
+HtmlAjaxCommandLink myLink = new HtmlAjaxCommandLink();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component <emphasis role="bold"><property><a4j:commandLink></property></emphasis> placed on a page generates the following HTML code:</para>
+ <programlisting role="JSP"><![CDATA[<a href="#" onclick="A4J.AJAX.Submit(?"request parameters");
+ return
+ <a href="#" onclick="A4J.AJAX.Submit(?"request parameters");
+ return false;">
+ <span style="color: black;">Link Value</span>
+ </a>
+]]></programlisting>
+ <para>Hence, the utility method "A4J.AJAX.Submit" is called on a click, the method performs AJAX request as the <emphasis role="bold"><property><a4j:support></property></emphasis> component</para>
+ <note>
+ <title>Note:</title>
+ <para>AJAX support is built in and it's not necessary to add nested <emphasis role="bold"><property><a4j:support></property></emphasis> to the component.</para>
+ </note>
+ <para>Common JSF navigation could be performed after AJAX submit and partial rendering, but Navigation Case must be defined as <emphasis role="bold"><property><redirect/></property></emphasis> in order to avoid problems with some browsers.</para>
+ <para>As any Ajax4jsf component sending AJAX requests and processing server responses <emphasis role="bold"><property><a4j:commandLink></property></emphasis> has all attributes described above (see <emphasis role="bold"><property><a4j:support></property></emphasis> chapter) that provide the required behavior of requests sending (delay, limitation of submit area and rendering, etc.)</para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/form.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/form.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/form.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:form></property>
+ </emphasis> component is very similar to the same component from the JSF HTML library, the only slight difference is in generation of links inside and possibility of AJAX by-default submission.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/form.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/form.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/form.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,87 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Form</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Form</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.AjaxForm</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.FormRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Component definition on a page is similar to definition of the original component from JSF HTML library. </para>
+ <programlisting role="XML"><![CDATA[<a4j:form>
+ <!--...Some content to be submitted.-->
+</a4j:form>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.AjaxForm;
+...
+AjaxForm myForm = new AjaxForm();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The difference with the original component is that all hidden fields required for command links are always rendered and it doesn't depend on links rendering on the initial page. It solves the problem with invalid links that weren't rendered on a page immediately, but after some AJAX request.</para>
+ <para>Beginning with release 1.0.5 additional attributes that make this form variant universal have appeared. With a new attribute definition as ajax=<emphasis >
+ <property>"true"</property>
+ </emphasis>, it becomes possible to set AJAX submission way for any components inside, i.e. not a page URL is used as an <emphasis >
+ <property>"action"</property>
+ </emphasis> attribute, but the javascript:A4J.AJAX.Submit(...) call. In this case, rendering is defined as reRender=list of Ids for the form element itself.</para>
+ <para>Example</para>
+ <programlisting role="XML"><![CDATA[<a4j:form id="helloForm" ajaxSubmit="true" reRender="table">
+ ...
+ <t:dataTable id="table"... >
+ ...
+ </t:dataTable>
+ ...
+ <t:dataScroller for="table"... >
+ ...
+ </t:dataScroller>
+ ...
+</a4j:form
+]]></programlisting>
+<para>This example shows that in order to make <emphasis role="bold">
+ <property><t:dataScroller></property>
+ </emphasis> submissions to be AJAX ones it's required only to place this <emphasis role="bold">
+ <property><t:dataScroller></property>
+ </emphasis> into <emphasis role="bold">
+ <property><a4j:form></property>
+ </emphasis>. In the other case it is necessary to redefine renders for its child links elements that are defined as <emphasis role="bold">
+ <property><h:commandLink></property>
+ </emphasis> and can't be made AJAX ones with using e.g. <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis>.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:htmlCommandLink></property>
+ </emphasis> component is very similar to the same component from the JSF HTML library, the only slight difference is in links generation and problem solving that occurs when an original component is used.</para>
+</section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/htmlCommandLink.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,79 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>javax.faces.HtmlCommandLink</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Command</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>javax.faces.component.html.HtmlCommandLink</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.HtmlCommandLinkRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Component definition on a page is the same as for the original component from the JSF HTML library.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:htmlCommandLink value="value" action="action"/>
+]]></programlisting>
+</section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import javax.faces.component.html.HtmlCommandLink;
+...
+HtmlCommandLink myForm = new HtmlCommandLink();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The difference with the original component is that all hidden fields required for command links with the child <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> elements are always rendered and it doesn't depend on links rendering on the initial page. It solves the problem with invalid links that weren't rendered on a page immediately, but after some AJAX request.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:form>
+ ...
+ <a4j:htmlComandLink action="action" value="link" rendered="#{bean.rendered}">
+ <f:param ...>
+ <a4j:htmlComandLink>
+ ...
+</a4j:form>
+]]></programlisting>
+<para>In this example <emphasis role="bold">
+ <property><a4j:htmlCommandLink></property>
+ </emphasis>works as standard <emphasis role="bold">
+ <property><h:commandLink></property>
+ </emphasis>, but here hidden fields required for correct functionality are rendered before the first downloading of a page, though it doesn't happen if its attribute isn't set to "false".</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/include.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/include.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/include.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis> component is used for page areas update after an AJAX request according to the faces-config Navigation Rules and for implementation of wizard-like parts work in AJAX mode.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/include.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/include.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/include.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Include</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.ajax.Output</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.Include</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.AjaxIncludeRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>To use the component, it's necessary to place the following strings on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<h:panelGroup id="wizard">
+ <a4j:include viewId="/pages/include/first.xhtml" />
+</h:panelGroup>
+]]></programlisting>
+<para>For navigation inside a page defined in viewId any components responsible for AJAX requests to the server generation are used.</para>
+<para>For example, the following component on the page "/pages/include/first.xhtml"</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+<programlisting role="XML"><![CDATA[...
+<a4j:commandButton action="next" reRender="wizard"/>
+...
+]]></programlisting>
+<para>And in faces-config it's defined:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+<programlisting role="XML"><![CDATA[<navigation-rule>
+ <from-view-id>/pages/include/first.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>next</from-outcome>
+ <to-view-id>/pages/include/second.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+]]></programlisting>
+<para>In this case after a click on a button defined inside "first.xhtml" view, navigation is performed after an AJAX request (the same as standard JSF one) only inside this view.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+ <programlisting role="XML"><![CDATA[<a4j:outputPanel ajaxRendered="true">
+ <a4j:include viewId="/pages/include/first.xhtml"/>
+</a4j:outputPanel>
+]]></programlisting>
+<para>If <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis> is defined this way, any AJAX request returning outcome inside generates navigation with this <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis>.</para>
+<para>Ajax Action for navigation implementation inside view must be placed inside <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis> pages. Navigation defined by these pages is applied to the <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis> element current for them.</para>
+<para>As in the general case for Ajax Action component, if the <emphasis role="bold">
+ <property><a4j:action></property>
+ </emphasis>component inside <emphasis role="bold">
+ <property><a4j:include></property>
+ </emphasis>returns outcome defined as <emphasis role="bold">
+ <property><redirect/></property>,
+ </emphasis> AJAX submit is performed with navigation of the whole page and not only of the current view.
+</para>
+</section>
+
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ Some additional information can be found on the <ulink url="http://jboss.com/index.html?module=bb&op=viewtopic&t=104158">Ajax4Jsf Users Forum.</ulink>
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> component allows to invoke the server side data and return it in a JSON format to use in a client JavaScript calls.
+ </para>
+ </section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Function</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxFunction</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxFunction</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxFunctionRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple component definition example:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<head>
+ <script>
+ <!--There is some script named "myScript" that uses parameters which will be taken from server-->
+ </script>
+</head>
+<body>
+...
+<a4j:jsFunction data="#{bean.someProperty}" name="callScript" oncomplete="myScript(data.subProperty1, data.subProperty2)"/>
+...]]>
+ </programlisting>
+ <para> The script "myScript" will be called after
+ <property>bean.someProperty</property> data will be returned from server(e.g. It'll
+ be object with two subproperties). </para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxFunction;
+...
+HtmlAjaxFunction myFunction = new HtmlAjaxFunction();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para> As the component uses Ajax request to get data from server - it has all common Ajax
+ Action attributes. So, action and actionListener can be invoked, and reRendering some parts of
+ the page fired after calling function. </para>
+ <para> When using the <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> it's possible to initiate the AJAX request from the JavaScript and
+ perform partial update of a page and/or invoke the JavaScript function with data returned by
+ AJAX response. </para>
+ <programlisting role="XML"><![CDATA[...
+<body onload="callScript()">
+ ...
+ <h:form>
+ ...
+ <a4j:jsFunction name="callScript" data="#{bean.someProperty1 }
+ "reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">
+ <a4j:actionparam name="param_name" assignTo="#{bean.someProperty2}">
+ </a4j:actionparam>
+ </a4j:jsFunction>
+ ...
+ </h:form>
+ ...
+</body>
+...]]></programlisting>
+ <para> The <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> allows to use <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis> or pure <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> for passing any number of parameters of the JavaScript function into AJAX request.
+ <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> is similar to <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>, but it could be activated from the JavaScript code. It allows to invoke some
+ server side functionality and use the returned data in the JavaScript function invoked from
+ "oncomplete" attribute. So it's possible to use <emphasis
+ role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> instead of <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>. You can put it anywhere, just don't forget to use
+ <h:form> … </h:form> around it. </para>
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para> To see how <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> works on practice, look at a4j-jsFunction example from <ulink
+ url="http://labs.jboss.com/jbossajax4jsf/demo/index.html">here</ulink>.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <para>The <emphasis role="bold">
+ <property><a4j:keepAlive></property>
+ </emphasis> component allows to keep a state of each bean between requests.</para>
+
+</section>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/keepAlive.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/keepAlive.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/keepAlive.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.components.KeepAlive</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxKeepAlive</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.components.AjaxKeepAlive</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+
+ <para>Simple Component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[<a4j:keepAlive beanName = "#{myClass.testBean}"/>]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.AjaxKeepAlive;
+...
+AjaxKeepAlive myKeepAlive = new AjaxKeepAlive();
+...
+ ]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+ If a managed bean is declared with 'request' scope in the configuration file with the help of 'managed-bean-scope' tag then the life-time of
+ this bean instance is valid only for the current request.
+ Any attempts to make a reference to the bean instance after the request end will throw in Illegal Argument Exception by the server.
+ To avoid these kinds of Exception, component
+ <emphasis role="bold"><property><a4j:keepAlive></property>
+ </emphasis> is used to maintain the state of the whole bean object among subsequent request.
+ </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[<a4j:keepAlive beanName = "#{myClass.testBean}"/>]]></programlisting>
+</para>
+
+ <para>
+ Note that the attribute 'beanName' must point to a legal jsf EL expression which resolves to a managed mean instance. For example for
+ the above code the class definition may look like this:
+
+ <programlisting role="XML"><![CDATA[
+class MyClass{
+ ...
+ private TestBean testBean;
+ // Getters and Setters for testBean.
+ ...
+}
+ ]]></programlisting>
+</para>
+
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ Some additional information about usage of components can be found <ulink url="http://jboss.com/index.html?module=bb&op=viewtopic&t=104989">here.
+ </ulink>
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <para> The <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis> component is the same one as <emphasis role="bold">
+ <property><f:action></property>
+ </emphasis> or <emphasis role="bold">
+ <property><f:value></property>
+ </emphasis> components but it is used for an AJAX container.
+</para>
+</section>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <para>The <emphasis role="bold">
+ <property><a4j:loadBundle></property>
+ </emphasis> component is similar to the same component from the JSF Core library. The component loads a resource bundle
+ localized for the Locale of the current view and exposes it (as a Map) in the request attributes of the current request.</para>
+</section>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadBundle.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadBundle.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadBundle.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.Bundle</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Bundle</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.AjaxLoadBundle</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+
+ <para>Simple component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[<a4j:loadBundle baseName="demo.bundle.Messages" var="Message"/>]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxLoadBundle;
+...
+LoadBundle myBundle = new LoadBundle();
+...
+ ]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+
+ <emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis>allows to use reference to bundle messages during the Ajax re-rendering.
+<emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis> is a substitute for the
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> in JSF 1.1 which is not a JSF component originally.
+
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> is a jsp tag that load the bundle messages into the request scope when page is rendered. As soon as each Ajax request
+works in own request scope, the bundles loaded with
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> are unavailable.
+Instead of
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> that might be located anywhere on the page, the
+
+ <emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis> should be declared inside the
+
+ <emphasis role="bold"><property><f:view></property>
+ </emphasis> (this does not matter in case on using Facelets)
+JSF 1.2 introduces the bundle registered in the faces-config.xml. This fixed the problem with
+ <emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis>.
+Therefore, you can use this JSF 1.2 way to declare your bundles.
+
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadScript.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadScript.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadScript.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <section>
+
+ <title>Description</title>
+ <para>
+ Inserts script links to the head element. Render the value of the component as the value of
+ the "src" attribute, after passing it to the getResourceURL() method of the ViewHandler for this application, and passing the result through the encodeResourceURL() method of the ExternalContext.
+ </para>
+ </section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadScript.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadScript.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadScript.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.LoadScript</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.LoadScript</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlLoadScript</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.LoadScriptRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple Component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:loadScript src="scripts/someScript.js"/>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlLoadScript;
+...
+HtmlLoadScript myScript = new HtmlLoadScript();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+ As it was mentioned <link linkend="loadScript">before</link> this componment returns its value passing it to the
+ getResourceUR() method of the ViewHandler for this application, and passing
+ the result through the encodeResourceURL() method of the ExternalContext.
+ </para>
+ <para>
+ It means that the Context will be inserts automatically to the link. And calls
+ like <property>resource://</property> will be properly handled.
+ </para>
+ <para>
+ Except this - you may be free to put your script links right from the child
+ page while using <property>facelets templates</property> .
+ </para>
+</section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadStyle.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadStyle.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadStyle.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <section>
+ <title>Description</title>
+ <para>
+ Inserts stylesheet links to the head element. Render the value of the component as the value of
+ the "src" attribute, after passing it to the getResourceURL() method of the ViewHandler for this application, and passing the result through the encodeResourceURL() method of the ExternalContext.
+ </para>
+ </section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/loadStyle.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadStyle.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadStyle.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.LoadStyle</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.LoadStyle</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlLoadStyle</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.LoadStyleRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple Component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:loadStyle src="styles/style.css"/>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlLoadStyle;
+...
+HtmlLoadScript myStyle = new HtmlLoadStyle();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+ As it was mentioned <link linkend="loadStyle">before</link> this componment returns its value passing it to the
+ getResourceUR() method of the ViewHandler for this application, and passing
+ the result via the encodeResourceURL() method of the ExternalContext.
+ </para>
+ <para>
+ It means that the Context will be inserts automatically to the link. And calls
+ like <property>resource://</property> will be properly handled.
+ </para>
+ <para>
+ Except this - you may be free to put your stylesheet links right from the child
+ page while using <property>facelets templates</property> .
+ </para>
+</section>
+
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/log.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/log.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/log.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:log ></property>
+ </emphasis> component generates JavaScript for opening of the window with client-side debug information on an AJAX request.</para>
+ </section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/log.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/log.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/log.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,72 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <section>
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Log</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.ajax.Log</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.AjaxLog</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.LogRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+ </section>
+ <section>
+ <title>Creating on a page</title>
+ <para>To use the component, it's necessary to place the following string on a page:</para><programlisting role="XML"><![CDATA[<a4j:log/>]]></programlisting>
+ <para>Then, in order to open a log window, press "CTRL+SHIFT+L" on a page with the component.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.AjaxLog;
+...
+AjaxLog myLog = new AjaxLog();
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>Usage of the appropriate component attributes could change a representation level of debug information as well as the hot key for a window opening.</para>
+ <para>The hot key could be changed with the <emphasis >
+ <property>"hotkey"</property>
+ </emphasis>
+attribute, where it's necessary to define one letter that together with "CTRL+SHIFT" opens a window.</para>
+ <para>The <emphasis >
+ <property>"level"</property>
+ </emphasis>
+attribute with several possible values (FATAL, ERROR, WARN, INFO, ALL) could change a logging level.</para>
+ <para>The log could be generated not only in a new window, but also on the current page in a separate <emphasis role="bold"><property><div></property></emphasis>, this is also controlled with the <emphasis >
+ <property>"popup"</property>
+ </emphasis>
+attribute on the component. </para>
+ <para>Example:</para><programlisting role="XML"><![CDATA[<a4j:log level="ALL" popup="false" width="400" height="200"/>]]></programlisting>
+ <para>The component defined this way is decoded on a page as <emphasis role="bold"><property><div></property></emphasis> inside a page, where all the information beginning with informational message is generated.</para>
+ <note>
+ <title>Note:</title>
+ <para><emphasis role="bold"><a4j:log></emphasis> is getting renewed automatically after execution of ajax requests. Don't renew <emphasis role="bold"><a4j:log></emphasis> by using reRender!</para>
+ </note>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:mediaOutput></property>
+ </emphasis> component implements one of the basic features specified in the framework. The component is a facility for generating images, video, sounds and other binary resources defined by a user on-the-fly.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,99 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.MediaOutput</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Resource</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.MediaOutput</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.MediaOutputRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>To use the component it's necessary to define it on a page and set Java methods for data keeping and data transmission to output stream. </para>
+ <para>Component definition on a page for graphical data output</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<a4j:mediaOutput element="img" cacheable="false" session="true"
+ createContent="#{paintBean.paint}" value="#{paintData}"
+ mimeType="image/jpeg"/>
+...
+]]></programlisting>
+<para>Here is the content of paintData that is a bean containing output data</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+<programlisting role="JAVA"><![CDATA[package demo;
+
+public class PaintData implements Serializable{
+ private static final long serialVersionUID = 1L;
+ Integer width=100;
+ Integer weight=50;
+...
+]]></programlisting>
+<para>The Paint method of the paintBean class is a method transmitting graphical data into output stream.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+<programlisting role="JAVA"><![CDATA[public void paint(OutputStream out, Object data) throws IOException{
+ <!--...Some code that puts binary data to "out" Stream-->
+ }
+]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.MediaOutput;
+...
+MediaOutput myMedia = new MediaOutput ();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>As it was shown in the example above there are two main components:</para>
+ <itemizedlist>
+ <listitem>
+ createContent specifies a method accepting 2 parameters. The first (of java.io.OutputStream type) defines a stream, where any binary data is output. The second (of java.lang.Object type) contains deserialized object with data specified in the <emphasis >
+ <property>"value"</property>
+ </emphasis> attribute.
+ </listitem>
+ <listitem>
+ Value specifies a bean class keeping data for transmitting into a method that transmits it into a stream.
+ </listitem>
+ </itemizedlist>
+ <note><title>Note:</title>A bean class transmitted into value should implement Serializable interface.
+ </note>
+ <para>Hence, when using the component it's possible to output user data of any type on a page with AJAX requests.</para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/outputPanel.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/outputPanel.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/outputPanel.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The component is used for components grouping in the AJAX output area, which offers several additional output opportunities such as inserting of non-present in tree components, saving of transient elements after AJAX request and some others.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,136 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.OutputPanel</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Panel</entry>
+ </row>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.OutputPanel</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxOutputPanel</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxOutputPanelRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Here is the simplest way for a component creation on a page.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:outputPanel>
+<!--...Some Content Inside-->
+</a4j:outputPanel>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxOutputPanel;
+...
+HtmlAjaxOutputPanel myPanel = new HtmlAjaxOutputPanel();
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para><emphasis role="bold"><property><a4j:outPanel></property></emphasis> allows marking of a page area, which is updated on Ajax response. Anyway, <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> usage is optional, as in Ajax4jsf it's possible to indicate any existing component id on a component view in order to define updating areas.
+
+To speed up the performance, Ajax4jsf updates only a component tree. <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> usage is recommended for wrapping components that aren't rendered during the primary non-ajax response, as the components don't present in a component tree.
+</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:support ... reRender="mypanel"/>
+...
+<a4j:outputPanel id="mypanel">
+ <h:panelGrid rendered="#{not empty foo.bar}">
+ ...
+ </h:panelGrid>
+</a4j:outputPanel>
+]]></programlisting>
+ <para>In addition to the areas directly indicated in reRender attribute of Ajax components, <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> allows to update a part of a page basing on its own flag. The flag is defined by the ajaxRendered attribute. The flag is commonly used when a part of a page must be updated or can be updated on any response.</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:outputPanel ajaxRendered="true">
+ <h:messages/>
+</a4j:outputPanel>
+]]></programlisting>
+ <para>On default <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> is output as a pair of opening and closing html <emphasis role="bold"><property><span></property></emphasis> tag, but with the help of the layout attribute this output way could be changed. There are three variants for this component value:</para>
+ <itemizedlist>
+ <listitem>
+ inline (default)
+ </listitem>
+ <listitem>
+ block
+ </listitem>
+ <listitem>
+ none
+ </listitem>
+ </itemizedlist>
+ <para>If layout="block" is chosen, the component is rendered as a pair of opening and closing <emphasis role="bold"><property><div></property></emphasis> tag, to which it’s possible to apply any available style attributes available for block tags. </para>
+ <para>Layout="none" helps to avoid an unnecessary tag round a context that could or couldn't be rendered according to the defined "rendered" attribute conditions. If an inner context isn’t rendered, <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> is rendered as a <emphasis role="bold"><property><span></property></emphasis> tag with the id equal to an id of a child component and "display:none" style. If a child component is rendered, <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> doesn't present at all in a final code.</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:support .... reRender="mypanel"/>
+...
+<a4j:outputPanel layout="none">
+ <h:panelGrid id="mypanel" rendered="#{not empty foo.bar}">
+ ...
+ </h:panelGrid>
+</a4j:outputPanel>
+]]></programlisting>
+ <para>As you see, the code is very similar to the one shown above, but <emphasis ><property>"reRender "</property></emphasis> attribute refers directly to the updating panelGrid and not to the framing outputPanel, and it's more semantically correct.</para>
+ <para><emphasis role="bold"><property><a4j:outPanel></property></emphasis> should be used for non-JSF component part framing, which is to be updated on Ajax response, as Ajax4jsf specifies the list of updating areas as a list of an existing JSF component. </para>
+ <para>On default non-JSF context isn't saved in a component tree, but is rendered anew every time. To accelerate the processing speed and Ajax response input speed, Ajax4jsf saves non-JSF context in a component tree on default. This option could be canceled by keepTransient attribute that cancels transient flag forced setting for child components. This flag setting keeps the current value set by child components.</para>
+ <para>Note: In JSF 1.1 implementation and lower, where non-JSF context should be framed with the "f:verbatim" attribute, <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> doesn't improve this JSF implementation option in any way, so you still have to use this tag where it's necessary without Ajax4jsf usage. </para>
+ <para>Ajax4jsf allows setting Ajax responses rendering directly basing on component tree nodes without referring to the JSP (XHTML) page code. It could be defined by selfRendered attribute setting to <emphasis >
+ <property>"true"</property>
+ </emphasis>
+ on <emphasis role="bold">
+ <property><a4j:region></property>
+ </emphasis> and could help considerably speed up a response output. However, if a transient flag is kept as it is, this rapid processing could cause missing of transient components that present on view and don’t come into a component tree. Hence, for any particular case you could choose a way for you application optimization: speed up processing or redundant memory for keeping tree part earlier defined a transient. </para>
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ Some additional information about usage of component can be found <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052203#...">here</ulink>.
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/page.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/page.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/page.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+ <section>
+<title>Description</title>
+ <para><emphasis role="bold"><property><a4j:page></property></emphasis> is a deprecated component used for solving of incompatibility problems in early Ajax4jsf and MyFaces versions. The component encodes the full html page structure. </para>
+ </section>
+</root>
Added: trunk/docs/userguide/en/src/main/docbook/included/page.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/page.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/page.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,99 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.components.Page</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxRegion.</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.components.Page</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.PageRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>This component should be defined as a child component for <emphasis role="bold">
+ <property><f:view></property>
+ </emphasis></para>
+ <programlisting role="XML"><![CDATA[<f:view>
+ <a4j:page>
+ <f:facet name="head">
+ <!--...Head Content here-->
+ </f:facet>
+ <!--...Page Content here-->
+ </a4j:page>
+</f:view>
+]]></programlisting>
+ <para>This structure is rendered as:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<HTML>
+ <HEAD>
+ <!--...Head Content here-->
+ </HEAD>
+<body >
+ <!--...Page Content Here-->
+</body>
+</HTML>]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.components.Page;
+...
+Page myPage = new Page();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component is mostly used to solve the following problem with MyFaces for erlier Ajax4gsf versions: in MyFaces <emphasis role="bold">
+ <property><f:view></property>
+ </emphasis> doesn't get control over the "<emphasis >
+ <property>RENDER_RESPONSE</property>
+ </emphasis>" phase, thus AJAX can't get control and make a response also. To avoid this problem it was necessary to use <emphasis role="bold">
+ <property><a4j:page></property>
+ </emphasis> on the page round the AJAX updatable area. In the last versions of both frameworks the problem is successfully fixed and no <emphasis role="bold"><property><a4j:page></property></emphasis> usage is required.</para>
+ <para>The component is rendered as a full HTML page template (it was shown in the example). The "<emphasis >
+ <property>head</property>
+ </emphasis>" section is defined with the help of the corresponding facet with the name="head" and also there is an attribute with the same name for contentType definition.</para>
+ </section>
+
+ <section>
+ <title>Relevant resources links</title>
+ <para>All other component functionality is the same as of <emphasis role="bold">
+ <a4j:region>.
+ </emphasis> Its desctriprion could be found
+ <member>
+ <ulink url="http://webdownload.exadel.com/downloads/ajax4jsf/documentation/tldDoc/">here</ulink>.
+ </member>
+ </para>
+ </section>
+
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> component allows periodical sending of AJAX requests to the server and is used for a page update according to a specified in milliseconds time interval.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/poll.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/poll.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/poll.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,90 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.components.Poll</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxPoll</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.components.AjaxPoll</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxPollRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>To use this component it's necessary only to set an update interval.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:poll interval="1000" reRender="someDataTable" action="#{bean.action1}"/>
+]]></programlisting>
+ <para>The <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> component defined this way every second submits AJAX form onto the server, performs the corresponding action and renders a components with the <emphasis >
+ <property>"someDataTable"</property>
+ </emphasis> id after a response comes back.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.AjaxPoll;
+...
+AjaxPoll myPoll = new AjaxPoll();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component decodes all necessary JavaScript for time count and on the expiry of some interval for calling of a Ajax4jsf utility method for Ajax request sending (A4J.AJAX.Submit (Some request parameters)).
+ </para>
+ <para>
+ The timer could be stopped or started in any time. The current state is controlled on the component with the <emphasis >
+ <property>"enabled"</property>
+ </emphasis> attribute:
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:poll interval="1000" enabled="#{bean.boolProperty}"/>
+]]></programlisting>
+<para>As any Ajax4jsf Action component, <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> has all described in the <emphasis role="bold">
+ <property><ulink url="index.html#support"><a4j:support></ulink></property>
+ </emphasis> chapter attributes to provide the necessary behavior of request sending (delay, limitation of a submit and render area, requests frequency, and etc.). For detailed information on these attributes see again the <emphasis role="bold">
+ <property><ulink url="index.html#support"><a4j:support></ulink></property></emphasis> component description.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ The aditional information about component usage you can find here:<ulink url="http://jboss.com/index.html?module=bb&op=viewtopic&t=103909">Ajax4Jsf Users Forum.
+ </ulink>
+ </para>
+ </section>
+
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/portlet.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/portlet.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/portlet.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:portlet></property>
+ </emphasis>can be used in portals. The main component purpose is realization of possibility to create several instances the same portlet on
+ one page.
+ </para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/portlet.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/portlet.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/portlet.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,73 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.component.Portlet</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.component.Portlet</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.UIPortlet</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <programlisting role="XML"><![CDATA[
+<f:view>
+ <a4j:portlet>
+ ...
+ </a4j:portlet>
+</f:view>
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+ <programlisting role="JAVA"><![CDATA[
+import org.ajax4jsf.ajax.component.UIPortlet;
+...
+UIPortlet myPortlet = new UIPortlet();
+...]]></programlisting>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+ Portal page can include some instances of the same portlet but clientId of elements should be different for each window.
+ In that case 'namespace' is used for each portlet. The <emphasis role="bold"><property><a4j:portlet></property></emphasis>
+ implemets NaimingContainer interface and adds namespace to all componets on a page.
+ All portlet content should be wrapped by <emphasis role="bold"><property><a4j:portlet></property></emphasis> for resolving problems mentioned
+ before.
+ </para>
+
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ The aditional information about component usage you can find here:
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=107325">Ajax4Jsf Users Forum.
+ </ulink>
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/push.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/push.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/push.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:push></property>
+ </emphasis>periodically perform AJAX request to server, to simulate 'push' data.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/push.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/push.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/push.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,85 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.components.Push</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxPush</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.components.AjaxPush</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxPushRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <programlisting role="XML"><![CDATA[
+<a4j:push reRender="msg" eventProducer="#{messageBean.addListener}" interval="3000"/>]]></programlisting>
+ </section>
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+ <programlisting role="JAVA"><![CDATA[
+import org.ajax4jsf.ajax.html.AjaxPush;
+...
+AjaxPush myPush = new AjaxPush();
+...]]></programlisting>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The main difference between <emphasis role="bold"><property><a4j:push></property></emphasis>and
+ <emphasis role="bold"><property><a4j:poll></property></emphasis> components
+ is that <emphasis role="bold"><property><a4j:push></property></emphasis> makes request to minimal code only (not to JSF tree) in order to check the presence of messages in the queue.
+ If the message exists the complete request will be performed.
+ The component doesn't poll registered beans but registers EventListener which receives messages about events.
+ </para>
+<para>
+ There are some attributes which allows to customize of the component behaviour:
+</para>
+<para>
+'interval' - Interval (in ms) for call push requests. Default value 1000 (1 sec).
+<!-- If "0" a connection is permanent. Also user can set different value for parameter 'timeout'. -->
+</para>
+Code for registration of listener:
+ <programlisting role="JAVA"><![CDATA[
+public void addListener(EventListener listener) {
+synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+}
+]]></programlisting>
+
+
+Component can get message using current code:
+ <programlisting role="JAVA"><![CDATA[
+System.out.println("event occurs");
+synchronized (listener) {
+ listener.onEvent(new EventObject(this));
+}
+]]></programlisting>
+
+Thus, component 'push' uses asynchronous model instead of polls.
+
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/region.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/region.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/region.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>
+The <emphasis role="bold">
+<property><a4j:region></property>
+</emphasis> component defines an area that is decoded on the server after AJAX submission.
+</para>
+</section>
+</root>
Added: trunk/docs/userguide/en/src/main/docbook/included/region.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/region.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/region.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,120 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.AjaxRegion</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxRegion.</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxRegion</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxRegionRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Here is an example of the region decoding on a page. </para>
+ <programlisting role="XML"><![CDATA[<a4j:region>
+ <!--..Some content that will be decoded on server after Ajax request.-->
+</a4j:region>]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxRegion;
+...
+HtmlAjaxRegion newRegion = new HtmlAjaxRegion();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The region is a component used for manipulation with components sent to the server. It sets particular processing parameters for an area on the server, i.e. the region deals with data input on the server and has no direct impact on output. To read more on the components responsible for out, see "reference"
+</para>
+ <para>The region marks an area page that is decoded on the server. In most cases it is not necessary to use the region, as ViewRoot is a default region. This component helps to reduce data quantity processed by the server, but the region doesn't influence on the standard submission rules. It means that:<itemizedlist>
+ <listitem>
+ The area that is to be submitted onto the server should be embedded in <emphasis role="bold">
+<property><h:form/a4j:form></property>
+</emphasis> component.
+ </listitem>
+ <listitem>
+ The whole form is submitted on Ajax response and not a region that request is performed from.
+ </listitem>
+ </itemizedlist></para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:form id="form1">
+ <a4j:region>
+ <a4j:commandLink reRender="someID" value="Link" id="link1"/>
+ <!--..Some content that will be decoded on server after Ajax request.-->
+ </a4j:region>
+<h:form>]]></programlisting>
+ <para>Hence, the <emphasis role="bold">
+ <property><a4j:commandLink></property>
+ </emphasis> request generation causes full "form1" form submission onto the server, the only difference is that a component tree part decoded on the serve is the part included into the region.</para>
+ <para>The regions could be nested in any order, the server picks out and decodes only the region, which contains a particular component that sends a request.</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:region>
+ <a4j:commandLink reRender="someID" value="Link" id="link1"/>
+ <a4j:region>
+ <a4j:commandLink reRender="someID" value="Link" id="link2"/>
+ <!--..Some content that will be decoded on server after Ajax request.-->
+ </a4j:region >
+ <!--..Some content that will be decoded on server after Ajax request.-->
+</a4j:region >]]></programlisting>
+ <para>Therefore, the external region is decoded for the "link1" and the internal one is decoded for the "link2".</para>
+ <para>Ajax4jsf allows setting Ajax responses rendering directly basing on component tree nodes without referring to the JSP (XHTML) page code. It could be defined by selfRendered attribute setting to "true" on <emphasis role="bold">
+ <property><a4j:region></property>
+ </emphasis> and could help considerably speed up a response output. However, this rapid processing could cause missing of transient components that present on view and don't come into a component tree as well as omitting of <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> usage described below.
+</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:region selfRendered ="true">
+ <a4j:commandLink reRender="someID" value="Link" id="link1"/>
+ <!--..Some content with HTML used ("br" ,"h1" and other tags used)-->
+</a4j:region >]]></programlisting>
+ <para>In this case, the processing is quicker and going on without referring to a page code, but the HTML code that isn't saved in a component tree could be lost. Thus, this optimization should be very carefully performed and a usage of the additional components ajax4jsf (<emphasis role="bold"><property><a4j:outputPanel></property></emphasis>) is required. </para>
+ <para>The processing could be also accelerated if a region decoded for the processing passes straight away into Encode. But to update some data out of the region or on another region, use the <emphasis >
+ <property>"renderRegionOnly"</property>
+ </emphasis>
+attribute set to "false" ("true on default") to change this behaviour.</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<a4j:region renderRegionOnly="true">
+ <a4j:commandLink reRender="someID2" value="Link1" id="link1"/>
+ <h:panelGroup id="someId1">
+ </h:panelGroup>
+</a4j:region>
+<a4j:region renderRegionOnly="false">
+ <a4j:commandLink reRender="someID1" value="Link2" id="link2"/>
+ <h:panelGroup id="someId1">
+ </h:panelGroup>
+</a4j:region>]]></programlisting>
+ <para>This example shows that one of the regions is decoded when a link is used inside. Nevertheless,
+ if after processing the "link1" is clicked, the first region passes into Encode as a root
+ region and encode performance time is reduced. This optimization doesn't allow data update out of the
+ region and should be implemented very carefully. The data out of the region described with "renderRegionOnly"="false" is updated successfully.</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/repeat.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/repeat.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/repeat.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:repeat></property>
+ </emphasis> component implements a basic iteration component allowing to update a set of its children with AJAX.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/repeat.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/repeat.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/repeat.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,118 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Repeat </entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Data </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxRepeat </entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.RepeatRenderer </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>The component definition on a page is the same as for the <emphasis >
+ <property>"facelets"</property>
+ </emphasis> component:</para>
+ <programlisting role="XML"><![CDATA[<a4j:repeat id="detail" value="#{bean.props}" var="detail">
+ <h:outputText value="#{detail.someProperty}"/>
+</a4j:repeat>]]></programlisting>
+ <para>The output is generated according to a collection contained in <emphasis >
+ <property>"bean.props"</property>
+ </emphasis> with the "detail" key passed to child components.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxRepeat;
+...
+HtmlAjaxRepeat repeater = new HtmlAjaxRepeat ();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The main difference of this component from iterative components of other libraries is a special <emphasis >
+ <property>"ajaxKeys"</property>
+ </emphasis> attribute. This attribute defines strings that are updated after an AJAX request. As a result it becomes easier to update several child components separately without updating the whole page.</para>
+ <programlisting role="JSP"><![CDATA[<a4j:poll intervall="1000" action="#{repeater.action}" reRender="list">
+...
+<table>
+ <tbody>
+ <a4j:repeat value="#{bean.props}" var="detail" binding="#{repeater.myRepeat}"
+ id="list" ajaxKeys="#{repeater.ajaxedRowsSet}">
+ </tr>
+ <td>
+ <h:outputText value="detail.someProperty">
+ </td>
+ </tr>
+ </a4j:repeat>
+ <tbody>
+<table>
+]]></programlisting>
+ <para>Thus, a list with a table structure from <emphasis >
+ <property>"bean.props"</property>
+ </emphasis> is output.</para>
+ <para>In the above-mentioned example the component <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> sends AJAX requests every second, calling the <emphasis >
+ <property>"action"</property>
+ </emphasis> method of the <emphasis >
+ <property>"repeater"</property>
+ </emphasis> bean.
+ </para>
+ <note>
+ <title>Note:</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:repeater></property>
+ </emphasis> component is defined as fully updated, but really updated there are only the strings which rowKeys are included into the set <emphasis >
+ <property>"ajaxRowSet"</property>
+ </emphasis> defined in the <emphasis >
+ <property>"ajaxKeys"</property>
+ </emphasis> attribute </para>
+ <para>The set could be defined during the action method processing using data on a model from the property <emphasis >
+ <property>"repeater.myRepeat"</property>
+ </emphasis></para>
+ </note>
+<para>One more benefit of this component is absence of strictly defined markup as JSF HTML DataTable and Tomahawk DataTable has, hence the components could be used more flexibly anywhere where it's necessary to output the results of selection from some collection.</para>
+<para>The next example shows collection output as a plain HTML list</para>
+ <programlisting role="JSP"><![CDATA[<ul>
+ <a4j:repeat ...>
+ <li>...<li/>
+ ...
+ <li>...<li/>
+ </a4j:repeat>
+</ul>
+]]></programlisting>
+ <para>All other general attributes are defined according to the similar attributes of iterative components (<emphasis role="bold">
+ <property><h:dataTable></property>
+ </emphasis> or <emphasis role="bold">
+ <property><ui:repeat></property>
+ </emphasis>) and are used in the same way.</para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/status.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/status.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/status.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+ <section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:status></property>
+ </emphasis> component generates elements for displaying of the current AJAX requests status. There are two status modes: AJAX request is in process or finished.</para>
+ </section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/status.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/status.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/status.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <para><table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Status </entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>javax.faces.Panel </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxStatus </entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxStatusRenderer </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>There are two ways to define elements indicating a request status :</para>
+ <itemizedlist>
+ <listitem>
+ With <emphasis >
+ <property>"StartText"/"StopText"</property>
+ </emphasis> atributes:
+ <programlisting role="XML"><![CDATA[<a4j:status startText="Progress" stopText="Done" for="stat1">]]></programlisting>
+ <para>In this case, text elements for the corresponding status are generated.</para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ With "Start"/"Stop" facets definition:
+ <programlisting role="XML"><![CDATA[<a4j:status for="stat2">
+ <f:facet name="start">
+ <h:graphicImage value="ajax_process.gif" />
+ </f:facet>
+ <f:facet name="stop">
+ <h:graphicImage value="ajax_stoped.gif" />
+ </f:facet>
+</a4j:status>]]></programlisting>
+ <para>In this case, the elements are generated for each status and correspond the facets content.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxStatus;
+...
+HtmlAjaxStatus myStatus = new HtmlAjaxStatus();
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>There are two ways for components or containers definition, which AJAX requests status is tracked by a component.<itemizedlist>
+ <listitem>
+ Definition with the <emphasis >
+ <property>"for"</property>
+ </emphasis>
+attribute on the <emphasis role="bold">
+ <property><a4j:status></property>
+ </emphasis> component. Here <emphasis >
+ <property>"for"</property>
+ </emphasis>
+attribute should point at an AJAX container (<emphasis role="bold"><property><a4j:region></property></emphasis>) "id", which requests are tracked by a component.
+ </listitem>
+ </itemizedlist><itemizedlist>
+ <listitem>
+ Definition with the <emphasis >
+ <property>"status"</property>
+ </emphasis>
+attribute obtained by any Ajax4jsf library action component. The attribute should point at the <emphasis role="bold">
+ <property><a4j:status></property>
+ </emphasis> component "id". Then this <emphasis role="bold">
+ <property><a4j:status></property>
+ </emphasis> component shows the status for the request fired from this action component.
+ </listitem>
+ </itemizedlist></para>
+ <para>The component creates two <emphasis role="bold"><property><span></property></emphasis> elements with content defined for each status, one of the elements (start) is initially hidden. At the beginning of an AJAX request, elements state is inversed, hence the second element is shown and the first is hidden. At the end of a response processing, elements display states return to its initial values.</para>
+ <para>Example:</para>
+ <programlisting role="XML"><![CDATA[<a4j:status startText="Started" stopText="stopped" layout="block"/>]]></programlisting>
+ <para>is decoded on a page as:</para><programlisting role="XML"><![CDATA[<span id="j_id20:status.start" style="display: none">
+ Started
+</span>
+<span id="j_id20:status.stop">
+ Stopped
+</span>]]></programlisting>
+ <para>And after the generation of an AJAX response is changed to:</para>
+ <programlisting role="XML"><![CDATA[<span id="j_id20:status.start">
+ Started
+</span>
+<span id="j_id20:status.stop" style="display: none">
+ Stopped
+</span>]]></programlisting>
+ <para>There is a possibility to group a <emphasis role="bold"><property><a4j:status></property></emphasis> elements content into <emphasis role="bold"><property><div></property></emphasis> elements, instead of <emphasis role="bold"><property><span></property></emphasis>. To use it, just redefine the <emphasis >
+ <property>"layout"</property>
+ </emphasis>
+attribute from "incline"(default) to "block".</para>
+ </section>
+</chapter>
Added: trunk/docs/userguide/en/src/main/docbook/included/support.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/support.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/support.desc.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<root>
+<section>
+<title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> component adds an AJAX support to any existing JSF component. It allows a component to generate asynchronous requests on the necessary event demand and with partial update of page content after a response incoming from the server.</para>
+</section>
+</root>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/support.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/support.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/support.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -0,0 +1,154 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+
+ <table>
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Support</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxSupport</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxSupport</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxSupportRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>To use a component, place <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> as nested to the component requesting AJAX functionality and specify an event of a
+ parent component that generates AJAX request and the components to be rerendered after a response
+ from the server.</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:inputText value="#{bean.text}">
+ <a4j:support event="onkeyup" reRender="repeater"/>
+</h:inputText>
+<h:outputText id="repeater" value="#{bean.text}"/>]]></programlisting>
+ <para>On every keyup event generated by an input field, a form is submitted on the server with the help of Ajax and
+ on a response coming from the server, element with "repeater" id, founded in a DOM tree is
+ redrawn according to a new data from the response.</para>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlAjaxSupport;
+...
+HtmlAjaxSupport mySupport = new HtmlAjaxSupport();>]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>A4j support addition is very similar to correspondent event redefinition of a component, i.e.
+</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:inputText value="#{bean.text}">
+ <a4j:support event="onkeyup" reRender="repeater"/>
+</h:inputText>
+]]></programlisting>
+<para>Is decoded on the page as:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+<programlisting role="XML"><![CDATA[
+<input onkeyup="A4J.AJAX.Submit( Some request parameters )"/>
+]]></programlisting>
+ <para>As you see from the code, the "onkeyup"
+event calls a utility ajax4jsf method that submit a form creating a special marks for a filter informing that it is an Ajax request. Thus, any supports quantity could be added to every component, the supports define component behavior on these events. </para>
+ <note>
+ <para>The components: <emphasis role="bold"><property><a4j:commandLink></property></emphasis>, <emphasis role="bold"><property><a4j:commandButton></property></emphasis>, <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> and others from Ajax4jsf library are already supplied with <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> functionality and there is no necessity to add the support to them. </para>
+ </note>
+ <para>With the help of <emphasis >
+ <property>"onsubmit"</property></emphasis> and <emphasis >
+ <property>"oncomplete"</property></emphasis> attributes the component allows using JavaScript before (for request sending conditions checking) and after an AJAX response processing termination (for performance of user-defined activities on the client) </para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:selectOneMenu value="#{bean.text}">
+ <f:selectItem itemValue="First Item " itemLabel="First Item"/>
+ <f:selectItem itemValue=" Second Item " itemLabel="Second Item"/>
+ <f:selectItem itemValue=" Third Item " itemLabel="Third Item"/>
+ <a4j:support event="onblur" reRender="panel" onsubmit="if(!confirm('Are you sure to change the option ?'))
+ {form.reset(); return false;}" oncomplete="alert('Value succesfully stored')"/>
+</h:selectOneMenu>]]></programlisting>
+ <para>In example there is the condition checking (confirm) is used before request sending and message printing after the request processing is over. </para>
+ <para>The components allows different AJAX request managing ways for its various optimization in particular conditions such as:
+<itemizedlist>
+ <listitem>
+ <emphasis role="bold">Limitation of the submit area and updating area for the request.</emphasis>
+ <para><emphasis ><property>"ajaxSingle"</property></emphasis> is an attribute that allows submission on the server only component sending a request, as if the component presented on a separate form.
+
+</para>
+ <para><emphasis ><property>"limitToList"</property></emphasis> is an attribute that allows to limit areas, which are updated after the responses. Only these components defined in the reRender attribute are updated. </para>
+ </listitem>
+ </itemizedlist></para>
+ <para><emphasis role="bold">Example 1:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:form>
+ <h:inputText value="#{person.name}">
+ <a4j:support event="onkeyup" reRender="test" ajaxSingle="true"/>
+ </h:inputText>
+ <h:inputText value="#{person.middleName}"/>
+</form>]]></programlisting>
+ <para>In this example the request contains only the input component causes the request generation, not all the components contained on a form, because of "ajaxSingle=true" usage. </para>
+ <para><emphasis role="bold">Example 2:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages/>
+ </a4j:outputPanel>
+ <h:inputText value="#{person.name}">
+ <a4j:support event="onkeyup" reRender="test" limitToList="true"/>
+ </h:inputText>
+ <h:outputText value="#{person.name}" id="test"/>
+</form>]]></programlisting>
+ <para>In this example the component "h:messages" is always updated (as it capturing all AJAX requests, located in ajaxRendered <emphasis role="bold"><property><a4j:outputPanel></property></emphasis>), except the case when a response is sent from the input component from the example. On sending this component marks that updating area is limited to the defined in it components, it means that on its usage with "limitToList"="true" the only component updated is the one with "d"="test".</para>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">Limitation of requests frequency and updates quantity after the responses. </emphasis>
+ <para><emphasis ><property>"requestDelay"</property></emphasis> is an attribute that defines a time interval in seconds minimally permissible between responses.
+
+</para>
+ <para><emphasis ><property>"eventQueue"</property></emphasis> is an attribute for naming of the queue where the next response is kept in till its processing, but if the next event comes in till this time is over, the waiting event is taken away, replacing with a new one.
+
+</para>
+ <para><emphasis ><property>"ignoreDupResponces"</property></emphasis> is an attribute that allows to disable any updates on the client after an AJAX request if another AJAX request is already sent.
+</para>
+ <para><emphasis ><property>"timeout"</property></emphasis> is an attribute that allows to set a time interval in millisecond to define a maximum time period of response wait time. In case of the interval interaction, a new request is sent and the previous one is canceled. Postprocessing of a response isn't performed.
+</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="XML"><![CDATA[<h:form>
+ <h:inputText value="#{person.name}">
+ <a4j:support event="onkeyup" reRender="test"
+ requestDelay="1000" ignoreDupResponces="true" eventsQueue="myQueue"/>
+ </h:inputText>
+ <h:outputText value="#{person.name}" id="test"/>
+</form>]]></programlisting>
+ <para>This example clearly shows mentioned <ulink url="index.html#support">above</ulink> attributes. If quick typing in a text field happens, every next requests sending is delayed for a second and requests quantity is reduced. The requests are kept in the queue "myQueue" till its the sending.
+Moreover, if the next request is already sent, the rerendering after the previous request is banned, and
+ it helps to avoid unnecessary processing on the client.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2007-08-06 13:05:44 UTC (rev 2072)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -2,7 +2,9 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
"../../../../../resources/support/docbook-dtd/docbookx.dtd"
[ <!ENTITY rfcintro SYSTEM "modules/RFCintro.xml">
-<!ENTITY rfcdocumentroadmap SYSTEM "modules/RFCdocumentroadmap.xml">
+
+<!--<!ENTITY rfcdocumentroadmap SYSTEM "modules/RFCdocumentroadmap.xml"> -->
+
<!ENTITY rfctechreqs SYSTEM "modules/RFCtechreqs.xml">
<!ENTITY rfcsetwebappl SYSTEM "modules/RFCsetwebappl.xml">
<!ENTITY wadParams SYSTEM "modules/AUGWADParams.xml">
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-08-06 13:05:44 UTC (rev 2072)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-08-06 13:07:23 UTC (rev 2073)
@@ -13,7 +13,316 @@
<keyword>skin</keyword>
</keywordset>
</chapterinfo>
+<title>Basic concepts of the Ajax4jsf Framework</title>
+ <section id="introToBasics">
+ <?dbhtml filename="introToBasics.html"?>
+ <title>Introduction</title>
+ <para>The framework is implemented as a component library which adds AJAX capability into existing
+ pages, so you don't need to write any JavaScript code or to replace existing
+ components with new AJAX widgets. <property>Ajax4jsf</property> enables page-wide AJAX support instead of the
+ traditional component-wide support. So, you can define the event on the page that
+ invokes an AJAX request and the areas of the page that should be synchronized with the JSF
+ Component Tree after the AJAX request changes the data on the server according to the
+ events fired on the client.</para>
+ <para>Next Figure shows how it works:</para>
+ <figure>
+ <title>Request Processing flow</title>
+ </figure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newpic1.jpg"/>
+ </imageobject>
+ </mediaobject>
+ <para><property>Ajax4jsf</property> allows to define (by means of JSF tags) different parts of a JSF page you
+ wish to update with an AJAX request and provide a few options to send AJAX requests to
+ the server. Also JSF page doesn't change from a "regular" JSF
+ page and you don't need to write any JavaScript or XMLHttpRequest objects by hands, everything is done automatically.</para>
+ </section>
+ <section id="Ajax4jsfArchitectureOverview">
+ <?dbhtml filename="Ajax4jsfArchitectureOverview.html"?>
+ <title>Ajax4jsf Architecture Overview</title>
+ <para>Next figure lists several important elements of the <property>Ajax4jsf</property> framework</para>
+ <figure>
+ <title>Ajax4jsf component structure</title>
+ </figure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newpic2.jpg"/>
+ </imageobject>
+ </mediaobject>
+ <formalpara>
+ <title>Ajax Filter.</title>
+ <para>To get all benefits of <property>Ajax4jsf</property>, you should register an AJAX Filter in web.xml
+ file of your application.The AJAX Filter recognizes multiple request types. The sequence diagram on Figure 3
+ shows the difference in processing of a "regular" JSF request and an AJAX request.</para>
+ </formalpara>
+ <para>In the first case the whole JSF tree will be encoded,
+ in the second one option it depends on the "size" of the AJAX region (you can define AJAX region
+ by using the <emphasis role="bold"><property><a4j:region></property></emphasis>). As you can see, in the second case the filter parses
+ the content of an AJAX response before sending it to the client side.</para>
+ <para>Have a look at the next picture to understand these two ways:</para>
+ <figure>
+ <title>Request Processing sequence diagram</title>
+ </figure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newpic3.jpg"/>
+ </imageobject>
+ </mediaobject>
+ <para>In both cases, the information about required static or dynamic resources that your application
+ requests is registered in the ResourseBuilder class.</para>
+ <para>When a request for a resource comes (Figure 4), the AJAX filter checks the Resource Cache
+ for this resource and if it is there, the resource is sent to the client. Otherwise,
+ the filter searches for the resource among those that are registered by the
+ ResourceBuilder. If the resource is registered, the AJAX filter will send a request to the
+ ResourceBuilder to create (deliver) the resource.</para>
+ <para>Next Figure shows the ways of resource request processing.</para>
+ <figure>
+ <title>Resource request sequence diagram</title>
+ </figure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newpic4.jpg"/>
+ </imageobject>
+ </mediaobject>
+ <formalpara>
+ <title>AJAX Action Components</title>
+ <para>
+ There are four AJAX Action Components: AjaxCommandButton, AjaxCommandLink, AjaxPoll and AjaxSupport.
+ You can use them to send AJAX requests from the client side.
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>AJAX Containers</title>
+ <para>
+ AjaxContainer is an interface that describes an area on your JSF page that should be decoded
+ during an AJAX request. AjaxViewRoot and AjaxRegion are implementations of this interface.
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>JavaScript Engine</title>
+ <para><property> Ajax4jsf</property> JavaScript Engine runs on the client-side. It knows how to update different areas
+ on your JSF page based on the information from the Ajax response. Do
+ not use this JavaScript code directly, as it is available automatically.
+ </para>
+ </formalpara>
+ </section>
+ <section id="LimitationsAndRules">
+ <?dbhtml filename="LimitationAndRules.html"?>
+ <title>Limitations and Rules</title>
+ <para>In order to create AJAX4JSF applications properly, keep the following points in mind:</para>
+ <itemizedlist>
+ <listitem>
+ The AJAX framework should not append or delete, but only replace elements on the page. For successful updates, an element with the same ID as in the response must exist on the page. If you'd like to append any code to a page, put in a placeholder for it (any empty element). For the same reason, it's recommended to place messages in the<emphasis >
+ <property>"AjaxOutput"</property>
+ </emphasis> component (as no messages is also a message).
+ </listitem>
+ <listitem>
+ Don't use <emphasis role="bold">
+ <property><f:verbatim></property>
+ </emphasis> for self-rendered containers, since this component is transient and not saved in the tree.
+ </listitem>
+ <listitem>
+ AJAX requests are made by XMLHttpRequest functions in XML format, but this XML bypasses most validations and the corrections that might be made in a browser. So, create only a strict standards-compliant code for HTML and XHTML, without skipping any required elements or attributes. Any necessary XML corrections are automatically made by the XML filter on the server, but lot's of unexpected effects can be produced by an incorrect HTML code.
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="HowTo...">
+ <?dbhtml filename="HowTo.html"?>
+ <title>How To...</title>
+ <section id="SendAnAJAXRequest">
+ <?dbhtml filename="SendAnAJAXRequest.html"?>
+ <title>Send an AJAX request</title>
+ <para>There are different ways to send AJAX requests from your JSF page. You may use
+ <emphasis role="bold"><property><a4j:commandButton></property></emphasis>, <emphasis role="bold">
+ <property><a4j:commandLink></property>, <emphasis role="bold"><property><a4j:poll></property></emphasis>
+ </emphasis> or <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> tags.
+ </para>
+ <para>All these tags hide the usual JavaScript activities that are required for an XMHttpRequest
+ object building and an AJAX request sending. Also, they allow you to decide which components of
+ your JSF page are to be re-rendered as a result of the AJAX response (you can list the
+ IDs of these components in the "reRender" attribute).
+ </para>
+ <para>
+ <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis> and <emphasis role="bold">
+ <property><a4j:commandLink></property>
+ </emphasis> tags are used to send an AJAX
+ request on "onclick" JavaScript event.
+ </para>
+ <para>
+ <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> tag is used to send an AJAX
+ request periodically using a timer.
+ </para>
+ <para>The <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> tag allows you to add AJAX functionality to standard JSF components
+ and send AJAX request onto a chosen JavaScript event: "onkeyup", "onmouseover",
+ etc.
+ </para>
+ <para>Most important attributes of components that provide AJAX request calling features are:</para>
+ <itemizedlist>
+ <listitem>
+ <emphasis >
+ <property>"reRender"</property>
+ </emphasis>attribute as it was mentioned <link linkend="SendAnAJAXRequest">before</link> specifies components to be reRendered
+ after AJAX response. The attribute can be specified using EL expression and formed dynamicaly on the
+ server side (see <ulink url="index.html#FAQ">FAQ chapter</ulink>).
+ </listitem>
+ <listitem>
+ <emphasis >
+ <property>"RequestDelay"</property>
+ </emphasis> attribute is used for a requests frequency regulation.
+ </listitem>
+ </itemizedlist>
+ <programlisting role="XML"><![CDATA[<h:inputText size="50" value="#{bean.text}">
+ <a4j:support event="onkeyup" RequestDelay="3"/>
+</h:inputText>]]></programlisting>
+ <para>So every next request from the frequent keyboard events will be delayed
+ on 3 ms to reduce the number of requests.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <emphasis >
+ <property>"EventsQueue"</property>
+ </emphasis> is a queue that stores the next request.
+ </listitem>
+ <listitem>
+ <emphasis >
+ <property>"LimitToList"</property>
+ </emphasis> attribute is used to regulate updatable regions. Setting
+ it to true limits the updatable areas only to ones specified in a
+ reRender list, in other case all Output Panels of the region are updated.
+ </listitem>
+ <listitem> <emphasis >
+ <property>"ajaxSingle"</property>
+ </emphasis> attributes specify regions to be sent with a request,
+ if "false" it is a full region, in other case it's is only a control caused
+ event.
+</listitem>
+ </itemizedlist>
+ </section>
+ <section id="DecideWhatToSend">
+ <?dbhtml filename="DecideWhatToSend.html"?>
+ <title>Decide What to Send</title>
+ <para>You may describe a region on the page you wish to send to the server, in this way you can
+ control what part of the JSF View is decoded on the server side when you send an
+ AJAX request.
+ </para>
+ <para>The easiest way to describe an AJAX region on your JSF page is to do nothing,
+ because the content between the <emphasis role="bold">
+ <property><f:view></property>
+ </emphasis> and <emphasis role="bold">
+ <property></f:view></property>
+ </emphasis> tags is considered
+ the default AJAX region.
+ </para>
+ <para>You may define multiple AJAX regions on the JSF page (they can even be nested) by using
+ the <emphasis role="bold">
+ <property><a4j:region></property>
+ </emphasis> tag.
+ </para>
+ <para>If you wish to render the content of an AJAX response outside of the active region then
+ the value of the "renderRegionOnly" attribute should be set to "false". Otherwise, your
+ AJAX updates are limited to elements of the active region.
+ </para>
+ </section>
+ <section id="DecideWhatToChange">
+ <?dbhtml filename="DecideWhatToChange.html"?>
+ <title>Decide What to Change</title>
+ <para>Using IDs in the "reRender" attribute to define "AJAX zones" for update works fine in
+ many cases.
+ </para>
+ <para>But you can not use this approach if your page contains, e.g. a <emphasis role="bold"><property><f:verbatim></property></emphasis>
+ tag and you wish to update its content on an AJAX response.
+ </para>
+ <para>The problem with the <emphasis role="bold">
+ <property><f:verbatim/></property>
+ </emphasis> tag as described above is related to the
+ value of the transientFlag of JSF components. If the value of this flag is true, the
+ component must not participate in state saving or restoring of process.
+ </para>
+ <para>In order to provide a solution to this kind of problems, Ajax4jsf uses the concept of
+ an output panel that is defined by the <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> tag. If you put a <emphasis role="bold"><property><f:verbatim></property></emphasis>
+ tag inside of the output panel, then the content of the <emphasis role="bold">
+ <property><f:verbatim/></property>
+ </emphasis> tag and content of
+ other panel's child tags could be updated on AJAX response. There are two ways to
+ control this:
+ <itemizedlist>
+ <listitem>
+ By setting the "ajaxRendered" attribute value to "true".
+</listitem>
+ <listitem>
+ By setting the "reRender" attribute value of an Action Component to the output panel ID.
+</listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section id="RequestErrorsAndSessionExpirationHandling">
+ <?dbhtml filename="RequestErrorsAndSessionExpirationHandling.html"?>
+ <title>Request Errors and Session Expiration Handling</title>
+ <para>Ajax4jsf allows to redefine standard handlers responsible for processing of different exceptional situations. It helps to define own JavaScript, which is executed when this situations occur.</para>
+ <section id="RequestErrorsHandling">
+ <?dbhtml filename="RequestErrorsHandling.html"?>
+ <title>Request Errors Handling</title>
+ <para>To execute your own code on the client in case of an error during AJAX request, it's necessary to redefine the standard "A4J.AJAX.onError " method:</para>
+ <programlisting role="JAVA"><![CDATA[A4J.AJAX.onError = function(req,status,message) {
+ // Custom Developer Code
+};]]></programlisting>
+ <para>The function defined this way accepts as parameters:</para>
+ <itemizedlist>
+ <listitem>req - a params string of a request that calls an error</listitem>
+ <listitem>status - the number of an error returned by the server</listitem>
+ <listitem>message - a default message for the given error</listitem>
+ </itemizedlist>
+ <para>Thus, it's possible to create your own handler that is called on timeouts, inner server errors, and etc.</para>
+ </section>
+ <section id="SessionExpiredHandling">
+ <?dbhtml filename="SessionExpiredHandling.html"?>
+ <title>Session Expired Handling</title>
+ <para>Beginning with Ajax4jsf version 1.0.5 it's possible to redefine also the <emphasis >
+ <property>"onExpired"</property>
+ </emphasis> framework method that is called on the <emphasis >
+ <property>"Session Expiration"</property>
+ </emphasis> event.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[A4J.AJAX.onExpired = function(loc,expiredMsg){
+ // Custom Developer Code
+};
+]]></programlisting>
+
+<para>Here the function receives in params:</para>
+ <itemizedlist>
+ <listitem>loc - URL of the current page (on demand can be updated) </listitem>
+ <listitem>expiredMsg - a default message on <emphasis >
+ <property>"Session Expiration"</property>
+ </emphasis>event.</listitem>
+ </itemizedlist>
+<note>
+<title>Note:</title>
+Until the version 1.0.5 the method can't be redefined on <emphasis >
+ <property>"Session Expiration"</property>,
+ </emphasis> a confirmation dialog with a request for view reloading was always called.
+</note>
+ </section>
+</section>
+&FAQ;
+
+
+ <section>
+
<title>Skinnability</title>
<section id="WhySkinnability">
@@ -521,9 +830,8 @@
</listitem>
</itemizedlist>
</section>
- </section>
-
-<section><title>Built-in skinnability in Ajax4jsf</title>
+<section>
+<title>Built-in skinnability in Ajax4jsf</title>
<para>Ajax4jsf gives an opportunity to incorporate <property>skinnability</property> into UI
design. With this framework you can easily use named skin parameters in
properties files to control the appearance of the skins that are applied
@@ -586,5 +894,15 @@
<member>
<ulink url="http://java.sun.com/javaee/javaserverfaces/reference/docs/index.html">http://java.sun.com/javaee/javaserverfaces/reference/docs/index.html</ulink>
</member>
- </simplelist></section>
+ </simplelist>
+ </section>
+
+ </section>
+
+<section id="OtherRelevantResources">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/">Introduction to Ajax4Jsf</ulink> by Shunmuga Raja</para>
+
+</section>
+
</chapter>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r2072 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-06 09:05:44 -0400 (Mon, 06 Aug 2007)
New Revision: 2072
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
Log:
Minor StackingTreeModel optimizations
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-06 12:33:05 UTC (rev 2071)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-06 13:05:44 UTC (rev 2072)
@@ -82,13 +82,20 @@
LinkedList stack = new LinkedList();
+ StackingTreeModel lastModel = null;
if (currentEntry != null) {
iterator.remove();
stack.addFirst(currentEntry);
+ lastModel = currentEntry.model;
}
-
+
while (iterator.hasNext()) {
- stack.addFirst(iterator.next());
+ StackEntry entry = (StackEntry) iterator.next();
+ if (entry.model != lastModel) {
+ lastModel = entry.model;
+ stack.addFirst(entry);
+ }
+
iterator.remove();
}
17 years, 5 months
JBoss Rich Faces SVN: r2071 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-08-06 08:33:05 -0400 (Mon, 06 Aug 2007)
New Revision: 2071
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
fixes
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-06 11:03:43 UTC (rev 2070)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-06 12:33:05 UTC (rev 2071)
@@ -1031,7 +1031,8 @@
{
if (!this.selectedDate) return;
this.selectedDate=null;
- this.render();
+ $(this.INPUT_DATE_ID).value="";
+ if (this.params.popup && this.isVisible) this.render();
}
});
17 years, 5 months
JBoss Rich Faces SVN: r2070 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-06 07:03:43 -0400 (Mon, 06 Aug 2007)
New Revision: 2070
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml
Log:
http://jira.jboss.com/jira/browse/RF-522
Guides chapters merging
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-08-06 10:39:16 UTC (rev 2069)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-08-06 11:03:43 UTC (rev 2070)
@@ -14,337 +14,8 @@
</keywordset>
</chapterinfo>
- <title>Architecture Overview</title>
+ <title>Skinnability</title>
- <section id="AjaxProcessing">
- <?dbhtml filename="AjaxProcessing.html"?>
- <title>Ajax Processing</title>
-
- <para>RichFaces is based on the Ajax4jsf framework, so
- <property>AJAX</property> request support is performed with this
- framework.</para>
-
-<section>
- <title>Basic concepts of the Ajax4jsf Framework</title>
- <section id="introToBasics">
- <?dbhtml filename="introToBasics.html"?>
- <title>Introduction</title>
- <para>The framework is implemented as a component library which adds AJAX capability into existing
- pages, so you don't need to write any JavaScript code or to replace existing
- components with new AJAX widgets. <property>Ajax4jsf</property> enables page-wide AJAX support instead of the
- traditional component-wide support. So, you can define the event on the page that
- invokes an AJAX request and the areas of the page that should be synchronized with the JSF
- Component Tree after the AJAX request changes the data on the server according to the
- events fired on the client.</para>
- <para>Next Figure shows how it works:</para>
- <figure>
- <title>Request Processing flow</title>
- </figure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/newpic1.jpg"/>
- </imageobject>
- </mediaobject>
- <para><property>Ajax4jsf</property> allows to define (by means of JSF tags) different parts of a JSF page you
- wish to update with an AJAX request and provide a few options to send AJAX requests to
- the server. Also JSF page doesn't change from a "regular" JSF
- page and you don't need to write any JavaScript or XMLHttpRequest objects by hands, everything is done automatically.</para>
- </section>
- <section id="ArchitectureOverview1">
- <?dbhtml filename="ArchitectureOverview.html"?>
- <title>Architecture Overview</title>
- <para>Next figure lists several important elements of the <property>Ajax4jsf</property> framework</para>
- <figure>
- <title>Ajax4jsf component structure</title>
- </figure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/newpic2.jpg"/>
- </imageobject>
- </mediaobject>
- <formalpara>
- <title>Ajax Filter.</title>
- <para>To get all benefits of <property>Ajax4jsf</property>, you should register an AJAX Filter in web.xml
- file of your application.The AJAX Filter recognizes multiple request types. The sequence diagram on Figure 3
- shows the difference in processing of a "regular" JSF request and an AJAX request.</para>
- </formalpara>
- <para>In the first case the whole JSF tree will be encoded,
- in the second one option it depends on the "size" of the AJAX region (you can define AJAX region
- by using the <emphasis role="bold"><property><a4j:region></property></emphasis>). As you can see, in the second case the filter parses
- the content of an AJAX response before sending it to the client side.</para>
- <para>Have a look at the next picture to understand these two ways:</para>
- <figure>
- <title>Request Processing sequence diagram</title>
- </figure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/newpic3.jpg"/>
- </imageobject>
- </mediaobject>
- <para>In both cases, the information about required static or dynamic resources that your application
- requests is registered in the ResourseBuilder class.</para>
- <para>When a request for a resource comes (Figure 4), the AJAX filter checks the Resource Cache
- for this resource and if it is there, the resource is sent to the client. Otherwise,
- the filter searches for the resource among those that are registered by the
- ResourceBuilder. If the resource is registered, the AJAX filter will send a request to the
- ResourceBuilder to create (deliver) the resource.</para>
- <para>Next Figure shows the ways of resource request processing.</para>
- <figure>
- <title>Resource request sequence diagram</title>
- </figure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/newpic4.jpg"/>
- </imageobject>
- </mediaobject>
- <formalpara>
- <title>AJAX Action Components</title>
- <para>
- There are four AJAX Action Components: AjaxCommandButton, AjaxCommandLink, AjaxPoll and AjaxSupport.
- You can use them to send AJAX requests from the client side.
- </para>
- </formalpara>
- <formalpara>
- <title>AJAX Containers</title>
- <para>
- AjaxContainer is an interface that describes an area on your JSF page that should be decoded
- during an AJAX request. AjaxViewRoot and AjaxRegion are implementations of this interface.
- </para>
- </formalpara>
- <formalpara>
- <title>JavaScript Engine</title>
- <para><property> Ajax4jsf</property> JavaScript Engine runs on the client-side. It knows how to update different areas
- on your JSF page based on the information from the Ajax response. Do
- not use this JavaScript code directly, as it is available automatically.
- </para>
- </formalpara>
- </section>
- <section id="LimitationsAndRules">
- <?dbhtml filename="LimitationAndRules.html"?>
- <title>Limitations and Rules</title>
- <para>In order to create AJAX4JSF applications properly, keep the following points in mind:</para>
- <itemizedlist>
- <listitem>
- The AJAX framework should not append or delete, but only replace elements on the page. For successful updates, an element with the same ID as in the response must exist on the page. If you'd like to append any code to a page, put in a placeholder for it (any empty element). For the same reason, it's recommended to place messages in the<emphasis >
- <property>"AjaxOutput"</property>
- </emphasis> component (as no messages is also a message).
- </listitem>
- <listitem>
- Don't use <emphasis role="bold">
- <property><f:verbatim></property>
- </emphasis> for self-rendered containers, since this component is transient and not saved in the tree.
- </listitem>
- <listitem>
- AJAX requests are made by XMLHttpRequest functions in XML format, but this XML bypasses most validations and the corrections that might be made in a browser. So, create only a strict standards-compliant code for HTML and XHTML, without skipping any required elements or attributes. Any necessary XML corrections are automatically made by the XML filter on the server, but lot's of unexpected effects can be produced by an incorrect HTML code.
- </listitem>
- </itemizedlist>
- </section>
- <section id="HowTo...">
- <?dbhtml filename="HowTo.html"?>
- <title>How To...</title>
- <section id="SendAnAJAXRequest">
- <?dbhtml filename="SendAnAJAXRequest.html"?>
- <title>Send an AJAX request</title>
- <para>There are different ways to send AJAX requests from your JSF page. You may use
- <emphasis role="bold"><property><a4j:commandButton></property></emphasis>, <emphasis role="bold">
- <property><a4j:commandLink></property>, <emphasis role="bold"><property><a4j:poll></property></emphasis>
- </emphasis> or <emphasis role="bold">
- <property><a4j:support></property>
- </emphasis> tags.
- </para>
- <para>All these tags hide the usual JavaScript activities that are required for an XMHttpRequest
- object building and an AJAX request sending. Also, they allow you to decide which components of
- your JSF page are to be re-rendered as a result of the AJAX response (you can list the
- IDs of these components in the "reRender" attribute).
- </para>
- <para>
- <emphasis role="bold">
- <property><a4j:commandButton></property>
- </emphasis> and <emphasis role="bold">
- <property><a4j:commandLink></property>
- </emphasis> tags are used to send an AJAX
- request on "onclick" JavaScript event.
- </para>
- <para>
- <emphasis role="bold">
- <property><a4j:poll></property>
- </emphasis> tag is used to send an AJAX
- request periodically using a timer.
- </para>
- <para>The <emphasis role="bold">
- <property><a4j:support></property>
- </emphasis> tag allows you to add AJAX functionality to standard JSF components
- and send AJAX request onto a chosen JavaScript event: "onkeyup", "onmouseover",
- etc.
- </para>
- <para>Most important attributes of components that provide AJAX request calling features are:</para>
- <itemizedlist>
- <listitem>
- <emphasis >
- <property>"reRender"</property>
- </emphasis>attribute as it was mentioned <link linkend="SendAnAJAXRequest">before</link> specifies components to be reRendered
- after AJAX response. The attribute can be specified using EL expression and formed dynamicaly on the
- server side (see <ulink url="index.html#FAQ">FAQ chapter</ulink>).
- </listitem>
- <listitem>
- <emphasis >
- <property>"RequestDelay"</property>
- </emphasis> attribute is used for a requests frequency regulation.
- </listitem>
- </itemizedlist>
- <programlisting role="XML"><![CDATA[<h:inputText size="50" value="#{bean.text}">
- <a4j:support event="onkeyup" RequestDelay="3"/>
-</h:inputText>]]></programlisting>
- <para>So every next request from the frequent keyboard events will be delayed
- on 3 ms to reduce the number of requests.
- </para>
- <itemizedlist>
- <listitem>
- <emphasis >
- <property>"EventsQueue"</property>
- </emphasis> is a queue that stores the next request.
- </listitem>
- <listitem>
- <emphasis >
- <property>"LimitToList"</property>
- </emphasis> attribute is used to regulate updatable regions. Setting
- it to true limits the updatable areas only to ones specified in a
- reRender list, in other case all Output Panels of the region are updated.
- </listitem>
- <listitem> <emphasis >
- <property>"ajaxSingle"</property>
- </emphasis> attributes specify regions to be sent with a request,
- if "false" it is a full region, in other case it's is only a control caused
- event.
-</listitem>
- </itemizedlist>
- </section>
- <section id="DecideWhatToSend">
- <?dbhtml filename="DecideWhatToSend.html"?>
- <title>Decide What to Send</title>
- <para>You may describe a region on the page you wish to send to the server, in this way you can
- control what part of the JSF View is decoded on the server side when you send an
- AJAX request.
- </para>
- <para>The easiest way to describe an AJAX region on your JSF page is to do nothing,
- because the content between the <emphasis role="bold">
- <property><f:view></property>
- </emphasis> and <emphasis role="bold">
- <property></f:view></property>
- </emphasis> tags is considered
- the default AJAX region.
- </para>
- <para>You may define multiple AJAX regions on the JSF page (they can even be nested) by using
- the <emphasis role="bold">
- <property><a4j:region></property>
- </emphasis> tag.
- </para>
- <para>If you wish to render the content of an AJAX response outside of the active region then
- the value of the "renderRegionOnly" attribute should be set to "false". Otherwise, your
- AJAX updates are limited to elements of the active region.
- </para>
- </section>
- <section id="DecideWhatToChange">
- <?dbhtml filename="DecideWhatToChange.html"?>
- <title>Decide What to Change</title>
- <para>Using IDs in the "reRender" attribute to define "AJAX zones" for update works fine in
- many cases.
- </para>
- <para>But you can not use this approach if your page contains, e.g. a <emphasis role="bold"><property><f:verbatim></property></emphasis>
- tag and you wish to update its content on an AJAX response.
- </para>
- <para>The problem with the <emphasis role="bold">
- <property><f:verbatim/></property>
- </emphasis> tag as described above is related to the
- value of the transientFlag of JSF components. If the value of this flag is true, the
- component must not participate in state saving or restoring of process.
- </para>
- <para>In order to provide a solution to this kind of problems, Ajax4jsf uses the concept of
- an output panel that is defined by the <emphasis role="bold">
- <property><a4j:outputPanel></property>
- </emphasis> tag. If you put a <emphasis role="bold"><property><f:verbatim></property></emphasis>
- tag inside of the output panel, then the content of the <emphasis role="bold">
- <property><f:verbatim/></property>
- </emphasis> tag and content of
- other panel's child tags could be updated on AJAX response. There are two ways to
- control this:
- <itemizedlist>
- <listitem>
- By setting the "ajaxRendered" attribute value to "true".
-</listitem>
- <listitem>
- By setting the "reRender" attribute value of an Action Component to the output panel ID.
-</listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section id="RequestErrorsAndSessionExpirationHandling">
- <?dbhtml filename="RequestErrorsAndSessionExpirationHandling.html"?>
- <title>Request Errors and Session Expiration Handling</title>
- <para>Ajax4jsf allows to redefine standard handlers responsible for processing of different exceptional situations. It helps to define own JavaScript, which is executed when this situations occur.</para>
- <section id="RequestErrorsHandling">
- <?dbhtml filename="RequestErrorsHandling.html"?>
- <title>Request Errors Handling</title>
- <para>To execute your own code on the client in case of an error during AJAX request, it's necessary to redefine the standard "A4J.AJAX.onError " method:</para>
- <programlisting role="JAVA"><![CDATA[A4J.AJAX.onError = function(req,status,message) {
- // Custom Developer Code
-};]]></programlisting>
- <para>The function defined this way accepts as parameters:</para>
- <itemizedlist>
- <listitem>req - a params string of a request that calls an error</listitem>
- <listitem>status - the number of an error returned by the server</listitem>
- <listitem>message - a default message for the given error</listitem>
- </itemizedlist>
- <para>Thus, it's possible to create your own handler that is called on timeouts, inner server errors, and etc.</para>
- </section>
- <section id="SessionExpiredHandling">
- <?dbhtml filename="SessionExpiredHandling.html"?>
- <title>Session Expired Handling</title>
- <para>Beginning with Ajax4jsf version 1.0.5 it's possible to redefine also the <emphasis >
- <property>"onExpired"</property>
- </emphasis> framework method that is called on the <emphasis >
- <property>"Session Expiration"</property>
- </emphasis> event.</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[A4J.AJAX.onExpired = function(loc,expiredMsg){
- // Custom Developer Code
-};
-]]></programlisting>
-
-<para>Here the function receives in params:</para>
- <itemizedlist>
- <listitem>loc - URL of the current page (on demand can be updated) </listitem>
- <listitem>expiredMsg - a default message on <emphasis >
- <property>"Session Expiration"</property>
- </emphasis>event.</listitem>
- </itemizedlist>
-<note>
-<title>Note:</title>
-Until the version 1.0.5 the method can't be redefined on <emphasis >
- <property>"Session Expiration"</property>,
- </emphasis> a confirmation dialog with a request for view reloading was always called.
-</note>
- </section>
-</section>
-<section id="OtherRelevantResources">
- <title>Other Relevant Resources</title>
- <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/">Introduction to Ajax4Jsf</ulink> by Shunmuga Raja</para>
-
-</section>
-
-</section>
-
- </section>
-
- <section id="Skinnability">
- <?dbhtml filename="Skinnability.html"?>
-
- <title>Skinnability</title>
-
<section id="WhySkinnability">
<?dbhtml filename="WhySkinnability.html"?>
<title>Why Skinnability</title>
@@ -851,4 +522,69 @@
</itemizedlist>
</section>
</section>
+
+<section><title>Built-in skinnability in Ajax4jsf</title>
+ <para>Ajax4jsf gives an opportunity to incorporate <property>skinnability</property> into UI
+ design. With this framework you can easily use named skin parameters in
+ properties files to control the appearance of the skins that are applied
+ consistently to a whole set of components. You can look at examples of
+ predefined skins at:</para>
+ <simplelist>
+ <member>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/">http://livedemo.exadel.com/richfaces-demo/</ulink>
+ </member>
+ </simplelist>
+ <para>
+ You may simply control the look-and-feel of your application by using the <property>skinnability</property> service
+ of the Ajax4jsf framework. With the means of this service you can define the same style for rendering
+ standard JSF components and custom JSF components built with the help of Ajax4jsf.
+ </para>
+ <para>To find out more on <property>skinnability</property> possibilities, follow these
+ steps:</para>
+ <itemizedlist>
+ <listitem>
+ Create a custom render kit and register it in the faces-config.xml
+ like this:
+ <programlisting role="XML"><![CDATA[<render-kit>
+ <render-kit-id>NEW_SKIN</render-kit-id>
+ <render-kit-class>
+ org.ajax4jsf.framework.renderer.ChameleonRenderKitImpl
+ </render-kit-class>
+</render-kit>]]></programlisting>
+ </listitem>
+ <listitem>
+ Then you need to create and register custom renderers for the
+ component based on the look-and-feel predefined variables:
+ <programlisting role="XML"><![CDATA[<renderer>
+ <component-family>javax.faces.Command</component-family>
+ <renderer-type>javax.faces.Link</renderer-type>
+ <renderer-class>
+ newskin.HtmlCommandLinkRenderer
+ </renderer-class>
+</renderer>]]></programlisting>
+ </listitem>
+ <listitem>
+ Finally, you need to place a properties file with skin parameters
+ into the class path root. There are two requirements for the properties
+ file:
+ <itemizedlist>
+ <listitem>
+ The file must be named <emphasis role="bold"><property><skinName></property></emphasis>.skin.properties, in this case, it would be called
+ <filename>newskin.skin.properties</filename>.
+ </listitem>
+ <listitem>
+ The first line in this file should be render.kit=
+ <emphasis role="bold"><property><render-kit-id></property>,</emphasis> in this case, it would be called
+ render.kit=NEW_SKIN.
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>Extra information on custom renderers creation can be found
+ at:</para>
+ <simplelist>
+ <member>
+ <ulink url="http://java.sun.com/javaee/javaserverfaces/reference/docs/index.html">http://java.sun.com/javaee/javaserverfaces/reference/docs/index.html</ulink>
+ </member>
+ </simplelist></section>
</chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml 2007-08-06 10:39:16 UTC (rev 2069)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml 2007-08-06 11:03:43 UTC (rev 2070)
@@ -1,110 +1,460 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="SettingAWebApplication" xreflabel="SettingAWebApplication">
-<?dbhtml filename="SettingAWebApplication.html" ?>
-
- <chapterinfo>
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="SettingsForDifferentEnvironments" xreflabel="SettingsForDifferentEnvironments">
+ <?dbhtml filename="SettingsForDifferentEnvironments.html"?>
+<chapterinfo>
<keywordset>
- <keyword>Web Application</keyword>
+ <keyword>MyFaces</keyword>
- <keyword>Rich Faces</keyword>
+ <keyword>JSF</keyword>
<keyword>Ajax4jsf</keyword>
+ <keyword>AjaxViewHandler</keyword>
</keywordset>
</chapterinfo>
- <title>Setting Up a Web Application to Use Rich Faces</title>
+ <title>Settings for different environments</title>
+ <para>Ajax4jsf comes with support for all tags (components) included in the
+ JavaServer Faces specification. To add Ajax4jsf capabilities to an existing
+ JSF project you should just put the Ajax4jsf libraries into the lib folder of
+ the project and add filter mapping. The behavior of the existing project
+ doesn't change just because of Ajax4jsf.</para>
+&wadParams;
+<section id="SunJSFRI">
+<?dbhtml filename="SunJSFRI.html"?>
+ <title>Sun JSF RI</title>
+ <para>Ajax4jsf works with any implementation of <property>JSF</property> (both JSF 1.1 and
+ JSF 1.2) and with most <property>JSF</property> component libraries without any additional settings.
+ For more information look at:</para>
+
+<simplelist>
+<member>
+ <ulink url="http://java.sun.com/javaee/javaserverfaces/">java.sun.com</ulink>
+</member>
+</simplelist>
+
+ </section>
+ <section id="ApacheMyFaces">
+ <?dbhtml filename="ApacheMyFaces.html"?>
+ <title>Apache MyFaces</title>
+ <para>Ajax4jsf works with all <property>Apache MyFaces</property> versions (1.1.1 - 1.1.5)
+ including specific libraries like Tomahawk Sandbox and
+ Trinidad (the previous ADF Faces). However, there are some considerations
+ to take into account for configuring applications to work with <property>MyFaces</property> and
+ Ajax4jsf.</para>
+ <para>There are some problems with different filters defined in
+ the web.xml file clashing. To avoid these problems, the Ajax4jsf filter
+ must be the first one among other filters in the web.xml configuration
+ file.</para>
+ <para>For more information look at:<ulink url="http://myfaces.apache.org">http://myfaces.apache.org</ulink></para>
+ <para>
+ There's one more problem while using <property>MyFaces + Seam</property>. If you use this combination you should use
+ <emphasis role="bold">
+ <property><a4j:page></property>
+ </emphasis> inside<emphasis role="bold">
+ <property><f:view></property>
+ </emphasis>(right after it in your code) wrapping another content
+ inside your pages because of some problems in realization of <emphasis role="bold">
+ <property><f:view></property>
+ </emphasis> in myFaces.
+ </para>
+ <para>The problem is to be overcome in the nearest future.</para>
+ </section>
+ <section id="FaceletsSupport">
+ <?dbhtml filename="FaceletsSupport.html"?>
+ <title>Facelets Support</title>
+ <para>A high-level support for <property>Facelets</property> is one of our main support
+ features. When working with Ajax4jsf, there is no difference what release
+ of <property>Facelets</property> is used. </para>
+ <para>You should also take into account that some JSF frameworks such as <property>Facelets</property> use their own
+ ViewHandler and need to have it first in the chain of ViewHandlers and the
+ Ajax4jsf AjaxViewHandler is not an exception. At first Ajax4jsf installs its ViewHandler in any case, so in case of two frameworks, for example Ajax4jsf + Facelets, no changes in settings are required. Although, when more then one framework (except Ajax4jsf) is used, it's possible to use the VIEW_HANDLERS parameter defining these frameworks view handlers according to its usage order in it.
+ For example, the
+ declaration:</para>
- <para>Using the Rich Faces library doesn't require a major change of
- approach in how you set up a Web application, but a few steps are necessary,
- mostly for setting up the Ajax4jsf framework. When you just add RichFaces
- capability to an existing project, the behavior of the application doesn't
- change.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"> <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param></programlisting>
+ <para>says that <property>Facelets</property> will officially be the first, however AjaxViewHandler
+ will be a little ahead temporarily to do some small, but very
+ important job. </para>
+ <note>
+ <title>Note:</title>
+ <para>In this case you don't have to define <property>FaceletViewHandler</property> in the
+ WEB-INF/faces-config.xml.</para>
+ </note>
+ </section>
+ <section id="JBossSeamSupport">
+ <?dbhtml filename="JBossSeamSupport.html"?>
+ <title>JBoss Seam Support</title>
+ <para>Ajax4jsf 1.1 now works out-of-the-box with <property>JBoss Seam </property>and Facelets running inside JBoss AS 4.0.4 and higher.
+ There is no more shared JAR files needed. You just have to package the Ajax4jsf library with your application.
+ </para>
+ <para>
+ Your web.xml still must be like this:
+ </para>
+ <programlisting role="XML"><![CDATA[web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <section id="Installation">
-<?dbhtml filename="Installation.html" ?>
+ <!-- Seam -->
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
- <title>Installation</title>
+ <!-- ajax4jsf -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <url-pattern>*.seam</url-pattern>
+ </filter-mapping>
- <itemizedlist>
- <listitem>
- Copy the
+ <!-- Propagate conversations across redirects -->
+ <filter>
+ <filter-name>Seam Redirect Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Seam Redirect Filter</filter-name>
+ <url-pattern>*.seam</url-pattern>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>Seam Exception Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
+ </filter>
- <emphasis
- ><property>"richfaces-3.0.x.jar"</property></emphasis>
+ <filter-mapping>
+ <filter-name>Seam Exception Filter</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ </filter-mapping>
+
+ <!-- JSF -->
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>DEFAULT</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
- file into the
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
- <emphasis >
- <property>"WEB-INF/lib"</property>
- </emphasis>
+ <!-- MyFaces -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+</web-app>]]> </programlisting>
+ <para>Only one issue still persists while using <property>Seam</property> with MyFaces. Look at myFaces part of this section.</para>
+ </section>
+ <section id="Portlet Support">
+ <title>Portlet Support</title>
+ <para><property>Portlets</property> have support since version Ajax4jsf 1.1.1. Provide your feedback on compatible with Ajax4jsf if you face some problems.</para>
+ </section>
+ <section id="Sybase EAServer">
+ <title>Sybase EAServer</title>
+ <para>The load-on-startup for the Faces Servlet had to be set to 0 in web.xml.</para>
- folder of your application.
- </listitem>
- </itemizedlist>
-
- <para>Ajax4jsf is then set up as usual:</para>
-
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+...
+]]></programlisting>
+ <para> This is because, EAServer calls servlet init() before the ServletContextInitializer. Not an EAServer bug, this is in Servlet 2.3 spec.</para>
+ </section>
+ <!-- <title>Getting Started with Ajax4jsf</title>
+ -->
+ <section id="Environment">
+ <?dbhtml filename="Environment.html" ?>
+ <title>Environment</title>
+ <para>
+ To use Ajax4jsf framework you need JDK 1.4 or higher, any JSF implementation
+ and your favorite Servlet Container. To read more on the <property>Environments</property>, see further chapters.</para>
+ <para>
+ Ajax4jsf is designed in an easy-to-use way, so that you should do only a few simple steps to get AJAX functionality in your JSF application.
+ </para>
+ </section>
+ <section id="DownloadingAjax4jsf">
+ <?dbhtml filename="DownloadingAjax4jsf.html" ?>
+ <title>Downloading Ajax4jsf</title>
+ <para>The latest release of <property>Ajax4jsf</property> is available for download at:<simplelist><member><ulink url="http://labs.jboss.com/portal/jbossajax4jsf/downloads">http://labs.jboss.com/portal/jbossajax4jsf/downloads</ulink></member></simplelist>
+ in the <property>Ajax4jsf</property> project area under JBoss.</para>
+ </section>
+ <section id="Installation">
+ <?dbhtml filename="Installation.html" ?>
+ <title>Installation</title>
<itemizedlist>
<listitem>
- Copy the
-
- <emphasis ><property>"ajax4jsf.jar"</property></emphasis>
-
- and
-
- <emphasis
- ><property>"oscache2.3.2.jar"</property></emphasis>
-
- files into the
-
- <emphasis >
- <property>"WEB-INF/lib"</property>
- </emphasis>
-
- folder of your application.
+
+ Unzip <emphasis >
+ <property>"ajax4jsf.zip"</property>
+ </emphasis> file to the chosen folder.
+
</listitem>
-
<listitem>
- Insert this filter setting into the web.xml file for the application:
+
+ Copy <emphasis ><property>"ajax4jsf.jar"</property></emphasis> and <emphasis ><property>"oscache-2.3.2.jar"</property></emphasis> files into the <emphasis >
+ <property>"WEB-INF/lib"</property>
+ </emphasis> folder of your application.
+
</listitem>
- </itemizedlist>
-
- <programlisting role="XML"><context-param>
- <param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>blueSky</param-value>
- </context-param>
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- </filter-mapping></programlisting>
-
- <para>Then, for each page where you need to use a RichFaces component, add
- the appropriate line to the top of the page.</para>
-
- <itemizedlist>
+ <note>
+ <title>Note:</title>
+ <para>Starting from Ajax4jsf 1.1.1, the oscache library is not required to be in the classpath anymore.
+ </para>
+ </note>
<listitem>
- For JSP pages:
+ Add the following content into the <emphasis >
+ <property>"WEB-INF/web.xml"</property>
+ </emphasis> file of your application:
+
+ <programlisting role="XML"><![CDATA[<filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>]]></programlisting>
+ <note>
+ <title>Note:</title>
+ <para>You can copy and paste the above text from the <emphasis >
+ <property>"README.txt"</property>
+ </emphasis> file.</para>
+ </note>
</listitem>
- </itemizedlist>
-
- <programlisting role="XML"><%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%></programlisting>
-
- <itemizedlist>
<listitem>
- For XHTML pages:
+
+ <para>Add the following line for each JSP page of your application where you are going to bring in AJAX functionality.</para>
+ <programlisting role="XML"> <![CDATA[<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>]]></programlisting>
+ <para>For XHTML pages:</para>
+ <programlisting role="XML"><xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"></programlisting>
</listitem>
</itemizedlist>
-
- <programlisting role="XML"><xmlns:rich="http://richfaces.ajax4jsf.org/rich"></programlisting>
</section>
-
- &wadParams;
-</chapter>
\ No newline at end of file
+ <section id="SimpleAJAXEchoProject">
+ <?dbhtml filename="SimpleAJAXEchoProject.html" ?>
+ <title>Simple AJAX Echo Project </title>
+ <para>
+ In our JSF project you need only one JSP page that has a form with a couple of child tags:
+ <emphasis role="bold">
+ <property><h:inputText></property>
+ </emphasis> and <emphasis role="bold">
+ <property><h:outputText></property>
+ </emphasis>.
+ </para>
+ <para>This simple application let you input some text into the <emphasis role="bold">
+ <property><h:inputText></property>
+ </emphasis>,
+ send data to the server, and see the server response as a value of <emphasis role="bold">
+ <property><h:outputText></property>
+ </emphasis>.
+ </para>
+ <section id="JSPPage">
+ <?dbhtml filename="JSPPage.html"?>
+ <title>JSP Page</title>
+ <para>Here is the necessary page (echo.jsp):</para>
+ <programlisting role="JSP"> <![CDATA[<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
+ <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+ <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+ <html>
+ <head>
+ <title>repeater </title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h:inputText size="50" value="#{bean.text}" >
+ <a4j:support event="onkeyup" reRender="rep"/>
+ </h:inputText>
+ <h:outputText value="#{bean.text}" id="rep"/>
+ </h:form>
+ </f:view>
+ </body>
+ </html>]]></programlisting>
+ <para>The only line that distinguishes this page from a "regular" JSF one is</para>
+ <programlisting role="XML"><![CDATA[<a4j:support event="onkeyup" reRender="rep"/>]]></programlisting>
+ <para>The line adds an AJAX support to the parent <emphasis role="bold">
+ <property><h:inputText></property>
+ </emphasis> tag. This support is
+ bound to "onkeyup" JavaScript event, so that each time when this event is fired on the
+ parent tag, our application sends an AJAX request to the server. It means that the
+ text field pointed to our managed bean property contains up-to-date value of our input.
+ </para>
+ <para>
+ The value of <emphasis ><property>"reRender"</property></emphasis> attribute of the <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> tag defines which part(s) of our
+ page is (are) to be updated. In this case, the only part of the page to
+ update is the <emphasis role="bold">
+ <property><h:outputText></property>
+ </emphasis> tag because its ID value matches to the value of <emphasis ><property>"reRender"</property></emphasis>
+ attribute. As you see, it's not difficult to update multiple elements on the page, only list their IDs
+ as the value of <emphasis ><property>"reRender"</property></emphasis>.
+ </para>
+ </section>
+ <section id="DataBean">
+ <?dbhtml filename="DataBean.html"?>
+ <title>Data Bean</title>
+ <para>In order to build this application, you should create a managed bean:</para>
+ <programlisting role="JAVA">package demo;
+
+public class Bean {
+ private String text;
+ public Bean() {
+ }
+ public String getText() {
+ return text;
+ }
+ public void setText(String text) {
+ this.text = text;
+ }
+}</programlisting>
+ </section>
+ <section id="faces-config.xml">
+ <?dbhtml filename="faces-config.xml.html"?>
+ <title>faces-config.xml</title>
+ <para>Next, it's necessary to register your bean inside of the faces-config.xml file:</para>
+ <programlisting role="XML"> <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+ <faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>demo.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>text</property-name>
+ <value/>
+ </managed-property>
+ </managed-bean>
+ </faces-config>]]></programlisting>
+ <para> <note>
+ <title>Note:</title>
+ <para>Nothing that relates directly to Ajax4jsf is required
+ in the configuration file.</para>
+ </note></para>
+ </section>
+ <section id="Web.xml">
+ <?dbhtml filename="Web.xml.html"?>
+ <title>Web.xml</title>
+ <para>It is also necessary to add jar files (see <ulink url="GettingStartedWithAjax4jsf.html#Installation">installation chapter</ulink>) and modify the "web.xml" file:
+ </para>
+ <programlisting role="XML"> <![CDATA[<?xml version="1.0"?>
+ <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>a4jEchoText</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-map>
+ <listener>
+ <listener-class>
+ com.sun.faces.config.ConfigureListener
+ </listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>
+ javax.faces.webapp.FacesServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+ </web-app>]]></programlisting>
+ <para>Now your application should work.</para>
+ </section>
+ <section id="Deployment">
+ <?dbhtml filename="Deployment.html"?>
+ <title>Deployment</title>
+ <para>Finally, you should be able to place this application on your Web
+ server.To start your project, point
+ your browser at
+<ulink url="http://localhost:8080/a4jEchoText/echo.jsf">http://localhost:8080/a4jEchoText/echo.jsf</ulink>
+</para>
+ </section>
+ </section>
+ <section id="Relevant_src">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/3">Introduction to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
+ </section>
+</chapter>
17 years, 5 months
JBoss Rich Faces SVN: r2069 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: commandButton/source and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-08-06 06:39:16 -0400 (Mon, 06 Aug 2007)
New Revision: 2069
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandLink/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/script/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/support/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/source/usage.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,23 @@
-x
\ No newline at end of file
+<div class="sample-container" >
+ <rich:separator lineType="solid" height="1" />
+ <table width="400">
+ <tbody>
+ <tr>
+ <td onmouseover="updateName('Alex')" onmouseout="updateName('')" > Alex</td>
+ <td onmouseover="updateName('Jonh')" onmouseout="updateName('')" > Jonh</td>
+ <td onmouseover="updateName('Roger')" onmouseout="updateName('')" > Roger</td>
+ </tr>
+ <tr>
+ <td colspan="3"><h:outputText id="showname" value="Name: #{userBean.name}" /></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <a4j:form>
+ <a4j:jsFunction name="updateName" reRender="showname">
+ <a4j:actionparam name="param1" assignTo="#{userBean.name}" />
+ </a4j:jsFunction>
+ </a4j:form>
+
+ <rich:separator height="1" style="padding-top:10px" />
+</div>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,12 @@
-x
\ No newline at end of file
+<a4j:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" />
+ <a4j:commandButton value="Say Hello" reRender="out" />
+ </h:panelGrid>
+</a4j:form>
+<h:panelGroup id="out">
+ <h:outputText value="Hello " rendered="#{not empty userBean.name}" />
+ <h:outputText value="#{userBean.name}" />
+ <h:outputText value="!" rendered="#{not empty userBean.name}" />
+</h:panelGroup>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandLink/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandLink/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandLink/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,14 @@
-x
\ No newline at end of file
+<a4j:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" />
+ <a4j:commandLink reRender="out">
+ <h:outputText value="Say Hello" />
+ </a4j:commandLink>
+ </h:panelGrid>
+</a4j:form>
+<h:panelGroup id="out">
+ <h:outputText value="Hello " rendered="#{not empty userBean.name}" />
+ <h:outputText value="#{userBean.name}" />
+ <h:outputText value="!" rendered="#{not empty userBean.name}" />
+</h:panelGroup>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,6 @@
-x
\ No newline at end of file
+<a4j:form ajaxSubmit="true" reRender="name">
+ <h:panelGrid>
+ <h:commandButton value="Set Local Name to John (Ajax)" action="#{userBean.nameItJohn}" />
+ <h:outputText id="name" value="Name:#{userBean.name}" />
+ </h:panelGrid>
+</a4j:form>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,18 @@
-x
\ No newline at end of file
+<table width="400">
+ <tbody>
+ <tr>
+ <td onmouseover="updateName('Alex')" onmouseout="updateName('')" > Alex</td>
+ <td onmouseover="updateName('Jonh')" onmouseout="updateName('')" > Jonh</td>
+ <td onmouseover="updateName('Roger')" onmouseout="updateName('')" > Roger</td>
+ </tr>
+ <tr>
+ <td colspan="3"><h:outputText id="showname" value="Name: #{userBean.name}" /></td>
+ </tr>
+ </tbody>
+</table>
+
+<a4j:form>
+ <a4j:jsFunction name="updateName" reRender="showname">
+ <a4j:actionparam name="param1" assignTo="#{userBean.name}" />
+ </a4j:jsFunction>
+</a4j:form>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,36 @@
-x
\ No newline at end of file
+<h:panelGroup>
+ <a4j:keepAlive beanName="rsBean2" />
+ <h:form>
+ <h:inputText size="4" label="First Addent" value="#{rsBean2.addent1}">
+ <a4j:support event="onkeyup" reRender="btn2" />
+ </h:inputText>
+ <h:outputText value="+"/>
+ <h:inputText size="4" label="Second Addent" value="#{rsBean2.addent2}">
+ <a4j:support event="onkeyup" reRender="btn2" />
+ </h:inputText>
+ <a4j:commandButton style="margin:0 5px" id="btn2" action="#{rsBean2.doSum}"
+ value="=" reRender="sum2"
+ disabled="#{rsBean2.addent1 == null or rsBean2.addent2==null}"/>
+ <h:outputText id="sum2" value="#{rsBean2.sum}" />
+ </h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+</h:panelGroup>
+
+...
+
+package org.richfaces.demo.ajaxSamples;
+
+public class rsBean {
+ private Integer addent1;
+ private Integer addent2;
+ private Integer sum;
+
+ public String doSum() {
+ sum = new Integer((addent1 != null ? addent1.intValue() : 0) + (addent2 != null ? addent2.intValue() : 0));
+ return null;
+ }
+
+ //getters and setters skipped
+}
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,16 @@
-x
\ No newline at end of file
+<a4j:region>
+ <h:form>
+ <a4j:poll id="poll" interval="500" enabled="#{userBean.pollEnabled}" reRender="serverDate"/>
+ </h:form>
+</a4j:region>
+<h:form>
+ <h:panelGrid columns="2" width="80%">
+ <a4j:commandButton style="width:120px" id="control"
+ value="#{userBean.pollEnabled?'Stop':'Start'} Polling"
+ reRender="poll, control">
+ <a4j:actionparam name="polling" value="#{!userBean.pollEnabled}"
+ assignTo="#{userBean.pollEnabled}"/>
+ </a4j:commandButton>
+ <h:outputText id="serverDate" style="font-size:16px" value="Server Date: #{userBean.date}"/>
+ </h:panelGrid>
+</h:form>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,88 @@
-x
\ No newline at end of file
+<div class="sample-container" >
+ <rich:separator height="1" />
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages style="color:red" />
+ </a4j:outputPanel>
+ <h:panelGrid columns="2" width="100%">
+
+ <h:form id="form1">
+ <h:panelGrid columns="2">
+ <h:outputText value="Name" />
+ <h:inputText value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outname" />
+ </h:inputText>
+ <h:outputText value="Job:" />
+ <h:inputText required="true" id="job2" value="#{userBean.job}" />
+ </h:panelGrid>
+ </h:form>
+
+ <h:form id="form2">
+ <h:panelGrid columns="2">
+ <h:outputText value="Name" />
+ <a4j:region>
+ <h:inputText value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outname" />
+ </h:inputText>
+ </a4j:region>
+ <h:outputText value="Job" />
+ <h:inputText required="true" id="job1" value="#{userBean.job}" />
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGrid>
+ <h:outputText id="outname" style="font-weight:bold" value="Typed Name: #{userBean.name}" />
+ <rich:separator style="padding-top:10px" height="1" />
+
+</div>
+
+...
+
+<div class="sample-container" >
+ <rich:separator height="1" />
+
+ <h:panelGrid columns="2" width="100%">
+
+ <a4j:region selfRendered="true">
+ <h:panelGroup>
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputText value="Name" />
+ <h:inputText value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="out3,outname2" />
+ </h:inputText>
+ </h:panelGrid>
+ </h:form>
+ <h:panelGroup id="out3">
+ This text will disappear during the partual update of this panel.
+ The text appears back only after the whole page refresh or a partial
+ update from the region with selfRendered="false" (default value).
+ </h:panelGroup>
+ </h:panelGroup>
+ </a4j:region>
+
+ <a4j:region selfRendered="true">
+ <h:panelGroup>
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputText value="Name" />
+ <h:inputText value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="out4,outname2" />
+ </h:inputText>
+ </h:panelGrid>
+ </h:form>
+ <h:panelGroup id="out4">
+ <h:outputText value="The text of the similar panel will
+ not disappear because it is printed with h:outputText" />
+ </h:panelGroup>
+ </h:panelGroup>
+ </a4j:region>
+
+ </h:panelGrid>
+ <h:outputText id="outname2" style="font-weight:bold"
+ value="Typed Name: #{userBean.name}" />
+
+ <rich:separator style="padding-top:10px" height="1" />
+
+</div>
+
+
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/script/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/script/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/script/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,49 @@
-x
\ No newline at end of file
+<a4j:loadScript src="resource://org/richfaces/renderkit/html/scripts/scriptaculous-js-1.6.5/src/scriptaculous.js"/>
+<a4j:loadScript src="resource:///org/richfaces/renderkit/html/scripts/scriptaculous-js-1.6.5/src/effects.js"/>
+
+<div id="itme" class="sample-container">
+ <h:commandButton onclick="new Effect.BlindUp($('mypanel_body'), {duration:.3});return false" value="Hide"></h:commandButton>
+ <h:commandButton onclick="new Effect.Appear($('mypanel_body'));return false" value="Show"></h:commandButton>
+
+ <rich:separator height="1" style="padding:10px 0" />
+
+ <div id="mdiv">
+ <rich:panel id="mypanel">
+ <f:facet name="header">
+ <h:outputText value="Applying Skin on non-RichFaces Components"/>
+ </f:facet>
+
+
+
+
+ <h:panelGrid styleClass="rsPanel" width="250" columns="2">
+ <h:outputText styleClass="rsLabel" value="Name:" />
+ <h:inputText styleClass="rsInput" value="#{userBean.name}" />
+
+ <h:outputText styleClass="rsLabel" value="Job:" />
+ <h:inputText styleClass="rsInput" value="#{userBean.job}" />
+
+ <h:panelGroup />
+ <h:commandButton styleClass="rsButton" value="Submit">
+ <a4j:support disableDefault="true" event="onclick" reRender="out" />
+ </h:commandButton>
+
+ <f:facet name="footer">
+ </f:facet>
+
+ </h:panelGrid>
+ <h:panelGrid id="out" columns="1">
+
+ <h:outputText value=""/>
+ <h:outputText value="You have just entered:"/>
+ <h:outputText value="Name: #{userBean.name}" />
+ <h:outputText value="Job: #{userBean.job}" />
+ </h:panelGrid>
+
+ </rich:panel>
+
+ <rich:spacer height="20" />
+ </div>
+
+
+</div>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,52 @@
-x
\ No newline at end of file
+<a4j:region id="rb">
+ <h:panelGrid columns="2">
+
+ <h:form>
+ <a4j:commandButton eventsQueue="foo2" value="Ajax Request 2"/>
+ </h:form>
+
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ajax/ajax_process.gif"/>
+ </f:facet>
+ </a4j:status>
+
+ </h:panelGrid>
+</a4j:region>
+
+...
+
+<a4j:region id="extr">
+ <h:form>
+ <h:outputText value="Status:" />
+ <a4j:status id="commonstatus" startText="In Progress...." stopText=""/>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Name"/>
+ <h:inputText id="name" value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="out" />
+ </h:inputText>
+
+ <h:outputText value="Job"/>
+ <a4j:region id="intr">
+ <h:inputText id="job" value="#{userBean.job}">
+ <a4j:support event="onkeyup" reRender="out" status="commonstatus"/>
+ </h:inputText>
+ </a4j:region>
+
+ <h:panelGroup />
+
+
+
+ </h:panelGrid>
+ <a4j:region>
+ <h:outputText id="out" value="Name: #{userBean.name}, Job: #{userBean.job}" />
+ <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>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/support/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/support/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/support/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1 +1,8 @@
-x
\ No newline at end of file
+<h:form>
+ <h:panelGrid columns="2">
+ <h:inputText value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outtext" />
+ </h:inputText>
+ <h:outputText id="outtext" value="#{userBean.name}" />
+ </h:panelGrid>
+</h:form>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/source/usage.xhtml 2007-08-06 07:50:50 UTC (rev 2068)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/source/usage.xhtml 2007-08-06 10:39:16 UTC (rev 2069)
@@ -1,122 +1,77 @@
-<div class="sample-container" >
+<style>
+ .tooltip {
+ background-color:#{a4jSkin.generalBackgroundColor};
+ border-width:3px;
+ padding:10px;
+ }
+ .tooltip-text {
+ width:350px;
+ height:75px;
+ cursor:arrow;
+ border-width:2px;
+ text-align:center;
+ }
+ .tooltipData {
+ font-weight: bold;
+ }
+</style>
- <rich:toolBar height="26" itemSeparator="grid">
- <rich:toolBarGroup>
- <h:graphicImage value="/richfaces/toolBar/images/new.gif"></h:graphicImage>
- <h:graphicImage value="/richfaces/toolBar/images/webapp_welcome.gif"></h:graphicImage>
- <h:graphicImage value="/richfaces/toolBar/images/palette_edit.gif"></h:graphicImage>
- </rich:toolBarGroup>
- <rich:toolBarGroup>
- <h:graphicImage value="/richfaces/toolBar/images/print_edit.gif"></h:graphicImage>
- <h:graphicImage value="/richfaces/toolBar/images/print.gif"></h:graphicImage>
- <h:graphicImage value="/richfaces/toolBar/images/print_preview.gif"></h:graphicImage>
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right">
- <h:graphicImage value="/richfaces/toolBar/images/yellow_lamp.gif"></h:graphicImage>
- <h:graphicImage value="/richfaces/toolBar/images/timer_task.gif"></h:graphicImage>
- </rich:toolBarGroup>
- </rich:toolBar>
+<rich:panel id="sample1" styleClass="tooltip-text">
+ <rich:toolTip>
+ <span>
+ This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </rich:toolTip>
+ <p>
+ Here you can see <b>default client-side</b> tool-tip
+ </p>
+</rich:panel>
-</div>
+<rich:panel id="sample2" styleClass="tooltip-text">
+ <rich:toolTip followMouse="true" direction="top-right" delay="500" styleClass="tooltip" style="width:250px">
+ <span>
+ This tool-tip content also <strong>pre-rendered</strong> to the page.
+ However, the look of this tool-tip is customized by styleClass attribute.
+ </span>
+ </rich:toolTip>
+ <p>
+ This tool-tip will <b>follow mouse</b>. Also this tool-tip has a <b>delay 0.5 sec</b>, so be patient!
+ </p>
+</rich:panel>
-<div class="sample-container" >
- <h:form>
- <rich:toolBar height="34" itemSeparator="line">
- <rich:toolBarGroup>
- <h:graphicImage id="edit" value="/richfaces/toolBar/images/print_edit.gif"></h:graphicImage>
- <h:outputLabel value="Edit" for="edit"></h:outputLabel>
- </rich:toolBarGroup>
- <rich:toolBarGroup>
- <h:graphicImage id="print" value="/richfaces/toolBar/images/print.gif"></h:graphicImage>
- <h:outputLabel value="Print" for="edit"></h:outputLabel>
- </rich:toolBarGroup>
- <rich:toolBarGroup>
- <h:graphicImage id="preview" value="/richfaces/toolBar/images/print_preview.gif"></h:graphicImage>
- <h:outputLabel value="Preview" for="preview"></h:outputLabel>
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right">
- <h:inputText styleClass="barsearch" />
- <h:commandButton styleClass="barsearchbutton" onclick="return false;" value="Search" />
- </rich:toolBarGroup>
- </rich:toolBar>
- </h:form>
- </div>
+<h:form>
+<rich:panel id="sample3" styleClass="tooltip-text">
+ <rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span >This tool-tip content was <strong>rendered on server</strong> </span>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ <p>
+ This tool-tip rendered on server <b>in separate request</b>.
+ </p>
+</rich:panel>
+</h:form>
-
-<p>
- The items on the toolBar can be grouped with ability to define the separator
- between the different group and between the member of the same group. The
- "location" attribute set to "right" put the group to the right side of the panel.
-
-</p>
-<div class="sample-container" >
- <h:form>
- <h:panelGrid columns="2" width="100%">
- <rich:panel>
- <h:panelGrid columns="8">
- <h:outputText value="Group Separator:" />
- <a4j:commandLink value="Line" reRender="bar">
- <a4j:actionparam name="gs" value="line" assignTo="#{tbBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Grid" reRender="bar">
- <a4j:actionparam name="gs" value="grid" assignTo="#{tbBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Disc" reRender="bar">
- <a4j:actionparam name="gs" value="disc" assignTo="#{tbBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Square" reRender="bar">
- <a4j:actionparam name="gs" value="square" assignTo="#{tbBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="None" reRender="bar">
- <a4j:actionparam name="gs" value="none" assignTo="#{tbBean.groupSeparator}" />
- </a4j:commandLink>
- </h:panelGrid>
- </rich:panel>
- <rich:panel>
- <h:panelGrid columns="8">
- <h:outputText value="Group Item Separator:" />
- <a4j:commandLink value="Line" reRender="bar">
- <a4j:actionparam name="gs" value="line" assignTo="#{tbBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Grid" reRender="bar">
- <a4j:actionparam name="gs" value="grid" assignTo="#{tbBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Disc" reRender="bar">
- <a4j:actionparam name="gs" value="disc" assignTo="#{tbBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Square" reRender="bar">
- <a4j:actionparam name="gs" value="square" assignTo="#{tbBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="None" reRender="bar">
- <a4j:actionparam name="gs" value="none" assignTo="#{tbBean.groupItemSeparator}" />
- </a4j:commandLink>
- </h:panelGrid>
- </rich:panel>
- </h:panelGrid>
- </h:form>
-
- <rich:toolBar id="bar" height="30" itemSeparator="#{tbBean.groupSeparator}">
- <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
- <h:outputText value="Group1.1"></h:outputText>
- <h:outputText value="Group1.2"></h:outputText>
- <h:outputText value="Group1.3"></h:outputText>
- </rich:toolBarGroup>
- <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
- <h:outputText value="Group2.1"></h:outputText>
- <h:outputText value="Group2.2"></h:outputText>
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right" itemSeparator="#{tbBean.groupItemSeparator}">
- <h:outputText value="Group3.1"></h:outputText>
- <h:outputText value="Group3.2"></h:outputText>
- </rich:toolBarGroup>
- </rich:toolBar>
-
-</div>
+<h:form>
+<rich:panel id="sample4" styleClass="tooltip-text">
+ <rich:toolTip event="onclick" direction="bottom-left" mode="ajax" styleClass="tooltip">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span >This tool-tip content was <strong>rendered on server</strong> </span>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ <p>
+ This tool-tip will be <b>activated on mouse click</b>. It also has a <b>bottom-left</b> position.
+ </p>
+</rich:panel>
+</h:form>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r2068 - trunk/ui/message/design/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-08-06 03:50:50 -0400 (Mon, 06 Aug 2007)
New Revision: 2068
Modified:
trunk/ui/message/design/funcspec/FuncSpec - RF Messages Component.doc
Log:
Modified: trunk/ui/message/design/funcspec/FuncSpec - RF Messages Component.doc
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r2067 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-05 19:48:19 -0400 (Sun, 05 Aug 2007)
New Revision: 2067
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
Log:
- isActiveData() method added to StackingTreeModel
- unit test for StackingTreeModel updated
- active, activeRoot, activeNodes attributes introduced for UITreeNodes & UIRecursiveTreeNodes
- new attributes are used in sample application
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-05 23:48:15 UTC (rev 2066)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-05 23:48:19 UTC (rev 2067)
@@ -234,25 +234,45 @@
getRoot().setRowKey(argumentKey);
}
- ShiftingDataVisitor shiftingDataVisitor = new ShiftingDataVisitor(
+ final ShiftingDataVisitor shiftingDataVisitor = new ShiftingDataVisitor(
new Visitor1(dataVisitor));
if (treeRange == null || treeRange.processChildren(argumentKey)) {
Iterator iterator = this.getInternalModelsIterator();
while (iterator.hasNext()) {
- StackingTreeModel model = (StackingTreeModel) iterator.next();
-
+ final StackingTreeModel model = (StackingTreeModel) iterator.next();
+ final ExtendedDataModel scalarModel = model.getDataModel();
+
Argument argument2 = new Argument();
argument2.listRowKey = argumentKey;
argument2.argument = argument;
// setup current model
argument2.model = model;
argument2.range = range;
- model.getDataModel().walk(context, shiftingDataVisitor, null,
- argument2);
+
+ scalarModel.walk(context, new DataVisitor() {
+ public void process(FacesContext context,
+ Object rowKey, Object argument)
+ throws IOException {
+
+ Object key = scalarModel.getRowKey();
+ scalarModel.setRowKey(rowKey);
+ Object data = scalarModel.getRowData();
+
+ Object variable = model.setupVariable(data, context);
+ boolean activeData = model.isActiveData();
+ model.setupVariable(variable, context);
+ scalarModel.setRowKey(key);
+
+ if (activeData) {
+ shiftingDataVisitor.process(context, rowKey, argument);
+ }
+ }
+
+ }, null, argument2);
+
}
-
}
shiftingDataVisitor.end(context);
@@ -406,6 +426,11 @@
model.setParent(this);
}
+ public void removeStackingModel(StackingTreeModel model) {
+ this.models.remove(model.id);
+ model.setParent(null);
+ }
+
/*
* (non-Javadoc)
*
@@ -506,6 +531,10 @@
}
}
+ protected boolean isActiveData() {
+ return true;
+ }
+
protected boolean isActive() {
return true;
}
17 years, 5 months