JBoss Rich Faces SVN: r6978 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-19 14:20:07 -0400 (Wed, 19 Mar 2008)
New Revision: 6978
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
Log:
Fixed generic
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -30,9 +30,9 @@
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 17.11.2006
*/
-public class ListRowKey extends TreeRowKey {
+public class ListRowKey<T> extends TreeRowKey<T> {
- private ArrayList<Object> path;
+ private ArrayList<T> path;
/**
*
@@ -48,19 +48,21 @@
*/
public ListRowKey() {
super();
- this.path = new ArrayList<Object>();
+ this.path = new ArrayList<T>();
}
/**
* Copy constructor
* @param parentRowKey row key to clone
*/
- public ListRowKey(ListRowKey parentRowKey) {
+
+ @SuppressWarnings("unchecked")
+ public ListRowKey(ListRowKey<T> parentRowKey) {
super();
if (parentRowKey != null) {
- this.path = (ArrayList<Object>) parentRowKey.path.clone();
+ this.path = (ArrayList<T>) parentRowKey.path.clone();
} else {
- this.path = new ArrayList<Object>();
+ this.path = new ArrayList<T>();
}
}
@@ -69,86 +71,37 @@
* @param parentRowKey base row key
* @param pathElement path segment to append to base row key
*/
- public ListRowKey(ListRowKey parentRowKey, Object pathElement) {
+ public ListRowKey(ListRowKey<T> parentRowKey, T pathElement) {
this(parentRowKey);
this.path.add(pathElement);
}
- private static ArrayList<Object> parsePath(String path) {
- ArrayList<Object> result = new ArrayList<Object>();
- String trimmedPath = path.trim();
-
- StringBuffer sb = new StringBuffer();
- boolean escapedState = false;
- int pathLength = trimmedPath.length();
-
- //unescape
- for (int i = 0; i < pathLength; i++) {
- char c = trimmedPath.charAt(i);
-
- if (SEPARATOR_ESCAPE_CHAR == c) {
- if (escapedState) {
- sb.append(c);
- }
- escapedState = !escapedState;
- } else {
- if (c == AbstractTreeDataModel.SEPARATOR) {
- if (escapedState) {
- sb.append(c);
- } else {
- result.add(sb.toString());
- sb = new StringBuffer();
- }
- } else {
- sb.append(c);
- }
-
- escapedState = false;
- }
- }
-
- if (sb.length() != 0) {
- result.add(sb.toString());
- }
-
- return result;
- }
-
/**
* List constructor
* @param list List of strings to create corresponding row key from
*/
- public ListRowKey(List<Object> list) {
+ public ListRowKey(List<T> list) {
super();
- this.path = new ArrayList<Object>(list);
+ this.path = new ArrayList<T>(list);
}
/**
* Path object constructor
* @param path first path segment
*/
- public ListRowKey(Object path) {
+ public ListRowKey(T path) {
super();
- this.path = new ArrayList<Object>(1);
+ this.path = new ArrayList<T>(1);
this.path.add(path);
}
- /**
- * Path string constructor
- * @param path path string to create corresponding row key from
- */
- public ListRowKey(String path) {
- super();
- this.path = parsePath(path);
- }
-
public int depth() {
return path.size();
}
- public Iterator<Object> iterator() {
+ public Iterator<T> iterator() {
return path.iterator();
}
@@ -166,7 +119,7 @@
return false;
if (getClass() != obj.getClass())
return false;
- final ListRowKey other = (ListRowKey) obj;
+ final ListRowKey<?> other = (ListRowKey<?>) obj;
if (path == null) {
if (other.path != null)
return false;
@@ -175,17 +128,19 @@
return true;
}
- public Iterator<Object> getSubPathIterator(int fromIndex) {
+ public Iterator<T> getSubPathIterator(int fromIndex) {
return path.listIterator(fromIndex);
}
- public ListRowKey getSubKey(int fromIndex) {
- return new ListRowKey(path.subList(fromIndex, path.size()));
+ public ListRowKey<T> getSubKey(int fromIndex) {
+ return new ListRowKey<T>(path.subList(fromIndex, path.size()));
}
- public boolean isSubKey(TreeRowKey rowKey) {
+
+ @SuppressWarnings("unchecked")
+ public boolean isSubKey(TreeRowKey<T> rowKey) {
if (rowKey instanceof ListRowKey) {
- ListRowKey listRowKey = (ListRowKey) rowKey;
+ ListRowKey<T> listRowKey = (ListRowKey<T>) rowKey;
return depth() == getCommonPathLength(listRowKey);
} else {
@@ -195,7 +150,7 @@
public String getPath() {
StringBuffer result = new StringBuffer();
- Iterator<Object> iterator = path.iterator();
+ Iterator<T> iterator = path.iterator();
boolean hasNext = iterator.hasNext();
while (hasNext) {
@@ -225,11 +180,11 @@
return result.toString();
}
- public int getCommonPathLength(TreeRowKey otherRowKey) {
+ public int getCommonPathLength(TreeRowKey<T> otherRowKey) {
if (otherRowKey == null)
return 0;
- Iterator<Object> iterator = this.iterator();
- Iterator<?> otherIterator = otherRowKey.iterator();
+ Iterator<T> iterator = this.iterator();
+ Iterator<T> otherIterator = otherRowKey.iterator();
int length = 0;
while (iterator.hasNext() && otherIterator.hasNext()
&& iterator.next().equals(otherIterator.next()))
@@ -237,7 +192,7 @@
return length;
}
- public Object get(int i) {
+ public T get(int i) {
return path.get(i);
}
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -34,7 +34,7 @@
//structural elements
private StackingTreeModel parent;
- private Map models = new LinkedHashMap();
+ private Map<String, StackingTreeModel> models = new LinkedHashMap<String, StackingTreeModel>();
private Object rowKey;
@@ -52,7 +52,7 @@
private Object rowData;
// private StackingTreeModel stackingTreeModel;
- private LinkedList stackEntries = new LinkedList();
+ private LinkedList<StackEntry> stackEntries = new LinkedList<StackEntry>();
public ExtendedDataModel getDataModel() {
Object data = dataProvider.getData();
@@ -85,12 +85,12 @@
return getDataModel().getRowCount() == 0;
}
- private void leaveModel(Iterator iterator, StackEntry currentEntry, FacesContext context) {
+ private void leaveModel(Iterator<StackEntry> iterator, StackEntry currentEntry, FacesContext context) {
if (iterator == null) {
return ;
}
- LinkedList stack = new LinkedList();
+ LinkedList<StackEntry> stack = new LinkedList<StackEntry>();
StackingTreeModel lastModel = null;
if (currentEntry != null) {
@@ -110,13 +110,13 @@
iterator.remove();
}
- for (Iterator iterator2 = stack.iterator(); iterator2.hasNext();) {
+ for (Iterator<StackEntry> iterator2 = stack.iterator(); iterator2.hasNext();) {
StackEntry stackEntry = (StackEntry) iterator2.next();
stackEntry.model.setupVariable(stackEntry.varObject, context);
}
}
- protected StackingTreeModel doSetupKey(Iterator keyIterator, Iterator entriesIterator, FacesContext context, Object modelKey) {
+ protected StackingTreeModel doSetupKey(Iterator<Key> keyIterator, Iterator<StackEntry> entriesIterator, FacesContext context, Object modelKey) {
if (modelKey != null) {
if (!setupModel(modelKey, context)) {
//no key is available
@@ -126,13 +126,13 @@
}
if (keyIterator != null && keyIterator.hasNext()) {
- Key key = (Key) keyIterator.next();
+ Key key = keyIterator.next();
StackingTreeModel stackingTreeModel = this.getInternalModelById(key.modelId);
- Iterator nextEntriesIterator = null;
+ Iterator<StackEntry> nextEntriesIterator = null;
Object nextModelKey = key.modelKey;
if (entriesIterator != null && entriesIterator.hasNext()) {
- StackEntry entry = (StackEntry) entriesIterator.next();
+ StackEntry entry = entriesIterator.next();
if (!entry.model.equals(stackingTreeModel) || !entry.modelKey.equals(nextModelKey)) {
leaveModel(entriesIterator, entry, context);
} else {
@@ -156,12 +156,12 @@
if (stackEntries.isEmpty()) {
return this;
} else {
- return ((StackEntry) stackEntries.getLast()).model;
+ return (stackEntries.getLast()).model;
}
} else {
- Iterator keyIterator = null;
+ Iterator<Key> keyIterator = null;
if (key != null) {
- keyIterator = ((ListRowKey) key).iterator();
+ keyIterator = ((ListRowKey<Key>) key).iterator();
}
StackingTreeModel model = doSetupKey(keyIterator, stackEntries.iterator(), context, null);
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -308,7 +308,7 @@
return clazz.cast(wrappedData);
}
- public TreeNode getTreeNode() {
+ public TreeNode<T> getTreeNode() {
return null;
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -52,6 +52,7 @@
/**
* Instance of {@link TreeDataModelNodeAdaptor} for {@link org.richfaces.model.TreeNode} nodes handling
*/
+ @SuppressWarnings("unchecked")
public static final TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode> classicTreeNodeAdaptor =
new TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode>() {
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -31,18 +31,18 @@
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 16.11.2006
*/
-public interface TreeNode extends Serializable{
+public interface TreeNode<T> extends Serializable{
/**
* getter for node attached data
* @return node attached data
*/
- public Object getData();
+ public T getData();
/**
* setter for node attached data
* @param data data to set as attached node data
*/
- public void setData(Object data);
+ public void setData(T data);
/**
* Returns whether this node is leaf
@@ -55,20 +55,20 @@
* @return {@link Iterator} of {@link Map.Entry} instances containing {@link TreeNode} as values
* and their identifiers as keys
*/
- public Iterator<Map.Entry<Object, TreeNode>> getChildren();
+ public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren();
/**
* find child by id
* @param id identifier of the child to find
* @return designated {@link TreeNode} instance or <code>null</code>
*/
- public TreeNode getChild(Object id);
+ public TreeNode<T> getChild(Object id);
/**
* adds child to children collection
* @param identifier child identifier
* @param child child
*/
- public void addChild(Object identifier, TreeNode child);
+ public void addChild(Object identifier, TreeNode<T> child);
/**
* removes child from children collection by child id
@@ -80,10 +80,10 @@
* getter for parent {@link TreeNode}
* @return parent {@link TreeNode} instance or <code>null</code> if this node is root
*/
- public TreeNode getParent();
+ public TreeNode<T> getParent();
/**
* setter for parent {@link TreeNode}
* @param parent {@link TreeNode} to set as parent
*/
- public void setParent(TreeNode parent);
+ public void setParent(TreeNode<T> parent);
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -32,47 +32,48 @@
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 16.11.2006
*/
-public class TreeNodeImpl implements TreeNode {
+public class TreeNodeImpl<T> implements TreeNode<T> {
private static final long serialVersionUID = -5498990493803705085L;
- private Object data;
- private TreeNode parent;
+ private T data;
+ private TreeNode<T> parent;
- private Map childrenMap = new LinkedHashMap();
+ private Map<Object, TreeNode<T>> childrenMap =
+ new LinkedHashMap<Object, TreeNode<T>>();
- public Object getData() {
+ public T getData() {
return data;
}
- public TreeNode getChild(Object identifier) {
- return (TreeNode) childrenMap.get(identifier);
+ public TreeNode<T> getChild(Object identifier) {
+ return (TreeNode<T>) childrenMap.get(identifier);
}
- public void addChild(Object identifier, TreeNode child) {
+ public void addChild(Object identifier, TreeNode<T> child) {
child.setParent(this);
childrenMap.put(identifier, child);
}
public void removeChild(Object identifier) {
- TreeNode treeNode = (TreeNode) childrenMap.remove(identifier);
+ TreeNode<T> treeNode = childrenMap.remove(identifier);
if (treeNode != null) {
treeNode.setParent(null);
}
}
- public void setData(Object data) {
+ public void setData(T data) {
this.data = data;
}
- public TreeNode getParent() {
+ public TreeNode<T> getParent() {
return parent;
}
- public void setParent(TreeNode parent) {
+ public void setParent(TreeNode<T> parent) {
this.parent = parent;
}
- public Iterator getChildren() {
+ public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren() {
return childrenMap.entrySet().iterator();
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2008-03-19 18:20:02 UTC (rev 6977)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2008-03-19 18:20:07 UTC (rev 6978)
@@ -29,7 +29,7 @@
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 06.12.2006
*/
-public abstract class TreeRowKey implements Serializable {
+public abstract class TreeRowKey<T> implements Serializable {
/**
*
@@ -49,7 +49,7 @@
* @param fromIndex
* @return subpath segments iterator
*/
- public abstract Iterator<?> getSubPathIterator(int fromIndex);
+ public abstract Iterator<T> getSubPathIterator(int fromIndex);
/**
* getter for path string representation
@@ -66,7 +66,7 @@
* @param rowKey
* @return
*/
- public boolean isSubKey(TreeRowKey rowKey) {
+ public boolean isSubKey(TreeRowKey<T> rowKey) {
if (rowKey == null) {
return false;
}
@@ -78,13 +78,13 @@
* getter for path iterator
* @return path segments iterator
*/
- public abstract Iterator<?> iterator();
+ public abstract Iterator<T> iterator();
/**
* returns this row key and otherRowKey argument row key common path segments count
* @param otherRowKey {@link TreeRowKey} to count common path segments for
* @return common path segmments count
*/
- public abstract int getCommonPathLength(TreeRowKey otherRowKey);
+ public abstract int getCommonPathLength(TreeRowKey<T> otherRowKey);
}
16 years, 10 months
JBoss Rich Faces SVN: r6977 - in trunk/ui: inputnumber-slider/src/main/templates and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-19 14:20:02 -0400 (Wed, 19 Mar 2008)
New Revision: 6977
Modified:
trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2296
Modified: trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-03-19 18:16:30 UTC (rev 6976)
+++ trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-03-19 18:20:02 UTC (rev 6977)
@@ -238,7 +238,72 @@
&html_input_attributes;
&html_input_events;
&ui_input_attributes;
- &html_events;
+ &html_events;
+
+ <property>
+ <name>oninputclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is clicked</description>
+ </property>
+ <property>
+ <name>oninputdblclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is double-clicked</description>
+ </property>
+ <property>
+ <name>oninputkeydown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed down</description>
+ </property>
+ <property>
+ <name>oninputkeypress</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed and released</description>
+ </property>
+ <property>
+ <name>oninputkeyup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is released</description>
+ </property>
+ <property>
+ <name>oninputmousedown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is pressed down</description>
+ </property>
+ <property>
+ <name>oninputmousemove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved within</description>
+ </property>
+ <property>
+ <name>oninputmouseout</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved away</description>
+ </property>
+ <property>
+ <name>oninputmouseover</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved onto</description>
+ </property>
+ <property>
+ <name>oninputmouseup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is released</description>
+ </property>
+
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeydown</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeypress</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeyup</name>
+ <classname>java.lang.String</classname>
+ </property>
+
<property hidden="true" >
<name>size</name>
<classname>int</classname>
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-03-19 18:16:30 UTC (rev 6976)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-03-19 18:20:02 UTC (rev 6977)
@@ -43,7 +43,18 @@
onblur="#{component.attributes['onblur']}"
accesskey="#{component.attributes['accesskey']}"
size="#{inputSize}"
- maxlength="#{component.attributes['maxlength']}"
+ maxlength="#{component.attributes['maxlength']}"
+
+ onclick='#{component.attributes["oninputclick"]}'
+ ondblclick='#{component.attributes["oninputdblclick"]}'
+ onkeydown='#{component.attributes["oninputkeydown"]}'
+ onkeypress='#{component.attributes["oninputkeypress"]}'
+ onkeyup='#{component.attributes["oninputkeyup"]}'
+ onmousedown='#{component.attributes["oninputmousedown"]}'
+ onmousemove='#{component.attributes["oninputmousemove"]}'
+ onmouseout='#{component.attributes["oninputmouseout"]}'
+ onmouseover='#{component.attributes["oninputmouseover"]}'
+ onmouseup='#{component.attributes["oninputmouseup"]}'
/>
<jsp:scriptlet><![CDATA[
} else {
@@ -100,7 +111,18 @@
onblur="#{component.attributes['onblur']}"
accesskey="#{component.attributes['accesskey']}"
size="#{inputSize}"
- maxlength="#{component.attributes['maxlength']}"
+ maxlength="#{component.attributes['maxlength']}"
+
+ onclick='#{component.attributes["oninputclick"]}'
+ ondblclick='#{component.attributes["oninputdblclick"]}'
+ onkeydown='#{component.attributes["oninputkeydown"]}'
+ onkeypress='#{component.attributes["oninputkeypress"]}'
+ onkeyup='#{component.attributes["oninputkeyup"]}'
+ onmousedown='#{component.attributes["oninputmousedown"]}'
+ onmousemove='#{component.attributes["oninputmousemove"]}'
+ onmouseout='#{component.attributes["oninputmouseout"]}'
+ onmouseover='#{component.attributes["oninputmouseover"]}'
+ onmouseup='#{component.attributes["oninputmouseup"]}'
/>
<jsp:scriptlet><![CDATA[
} else {
Modified: trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-03-19 18:16:30 UTC (rev 6976)
+++ trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-03-19 18:20:02 UTC (rev 6977)
@@ -187,7 +187,72 @@
&ui_input_attributes;
&html_events;
&ui_component_attributes;
- &html_style_attributes;
+ &html_style_attributes;
+
+ <property>
+ <name>oninputclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is clicked</description>
+ </property>
+ <property>
+ <name>oninputdblclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is double-clicked</description>
+ </property>
+ <property>
+ <name>oninputkeydown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed down</description>
+ </property>
+ <property>
+ <name>oninputkeypress</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed and released</description>
+ </property>
+ <property>
+ <name>oninputkeyup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is released</description>
+ </property>
+ <property>
+ <name>oninputmousedown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is pressed down</description>
+ </property>
+ <property>
+ <name>oninputmousemove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved within</description>
+ </property>
+ <property>
+ <name>oninputmouseout</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved away</description>
+ </property>
+ <property>
+ <name>oninputmouseover</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved onto</description>
+ </property>
+ <property>
+ <name>oninputmouseup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is released</description>
+ </property>
+
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeydown</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeypress</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>onkeyup</name>
+ <classname>java.lang.String</classname>
+ </property>
+
<property hidden="true" >
<name>maxlength</name>
<classname>int</classname>
Modified: trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2008-03-19 18:16:30 UTC (rev 6976)
+++ trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2008-03-19 18:20:02 UTC (rev 6977)
@@ -36,16 +36,24 @@
onselect="#{component.attributes['onselect']}"
onfocus="#{component.attributes['onfocus']}"
onblur="#{component.attributes['onblur']}"
- onkeypress="#{component.attributes['onkeypress']}"
- onkeyup="#{component.attributes['onkeyup']}"
- onkeydown="#{component.attributes['onkeydown']}"
type="text"
size="#{component.attributes['inputSize']}"
name="#{clientId}"
value="#{this:getInputValue(context, component)}"
style="#{component.inputStyle}"
accesskey="#{component.attributes['accesskey']}"
- tabindex="#{component.attributes['tabindex']}"
+ tabindex="#{component.attributes['tabindex']}"
+
+ onclick='#{component.attributes["oninputclick"]}'
+ ondblclick='#{component.attributes["oninputdblclick"]}'
+ onkeydown='#{component.attributes["oninputkeydown"]}'
+ onkeypress='#{component.attributes["oninputkeypress"]}'
+ onkeyup='#{component.attributes["oninputkeyup"]}'
+ onmousedown='#{component.attributes["oninputmousedown"]}'
+ onmousemove='#{component.attributes["oninputmousemove"]}'
+ onmouseout='#{component.attributes["oninputmouseout"]}'
+ onmouseover='#{component.attributes["oninputmouseover"]}'
+ onmouseup='#{component.attributes["oninputmouseup"]}'
/>
</td>
<td id="#{clientId}For" class="dr-spnr-b" width="1%">
16 years, 10 months
JBoss Rich Faces SVN: r6975 - in trunk: framework and 24 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-03-19 14:16:27 -0400 (Wed, 19 Mar 2008)
New Revision: 6975
Added:
trunk/developmentBuild.sh
trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml
Removed:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java
trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
trunk/framework/impl/pom.xml
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
trunk/framework/pom.xml
trunk/framework/test/pom.xml
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
trunk/samples/pom.xml
trunk/samples/seamEAR/ejbs/pom.xml
trunk/samples/seamEAR/pom.xml
trunk/samples/seamEAR/wars/seamWebapp/pom.xml
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
trunk/samples/skins/pom.xml
trunk/sandbox/api/pom.xml
trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java
trunk/ui/pickList/pom.xml
trunk/ui/pom.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
Continue to refactor JSF 1.2 compatibility.
Fix common logging dependency
Added: trunk/developmentBuild.sh
===================================================================
--- trunk/developmentBuild.sh (rev 0)
+++ trunk/developmentBuild.sh 2008-03-19 18:16:27 UTC (rev 6975)
@@ -0,0 +1,19 @@
+PROJECT_DIR=`pwd`
+
+mvn clean install -N -Dmaven.test.skip=true
+cd $PROJECT_DIR/cdk
+mvn clean install -Dmaven.test.skip=true
+cd $PROJECT_DIR/framework
+mvn clean install -Dmaven.test.skip=true
+cd $PROJECT_DIR/ui
+mvn clean install -N -Dmaven.test.skip=true
+#cd $PROJECT_DIR/docs
+#mvn clean install
+cd $PROJECT_DIR/ui/assembly
+mvn clean install -Dmaven.test.skip=true
+#cd $PROJECT_DIR/extensions
+#mvn clean install
+#cd $PROJECT_DIR/samples
+#mvn clean install -N
+#cd $PROJECT_DIR/samples/richfaces-demo
+#mvn clean install
Property changes on: trunk/developmentBuild.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -16,6 +16,14 @@
public abstract class AjaxContext {
+ public static final String SCRIPTS_PARAMETER = "org.ajax4jsf.framework.HEADER_SCRIPTS";
+ public static final String STYLES_PARAMETER = "org.ajax4jsf.framework.HEADER_STYLES";
+ public static final String USER_STYLES_PARAMETER = "org.ajax4jsf.framework.HEADER_USER_STYLES";
+ public static final String RESPONSE_DATA_KEY = "_ajax:data";
+ static final String SERVICE_RESOURCE = "META-INF/services/"
+ + AjaxContext.class.getName();
+ private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
+
/**
* Key for keep request state information in request-scope attributes.
*/
@@ -56,29 +64,34 @@
public abstract void processHeadResources(FacesContext context)
throws FacesException;
- public abstract void encodeAjaxEnd(FacesContext context,
- UIComponent component) throws IOException;
+ public abstract void encodeAjaxEnd(FacesContext context) throws IOException;
- public abstract void encodeAjaxBegin(FacesContext context,
- UIComponent component) throws IOException;
+ public abstract void encodeAjaxBegin(FacesContext context) throws IOException;
- public abstract void renderAjaxRegion(FacesContext context,
- UIComponent component, boolean useFilterWriter)
- throws FacesException;
- public abstract void renderSubmittedAjaxRegion(FacesContext context,
- final boolean useFilterWriter);
- public abstract void renderSubmittedAjaxRegion(FacesContext context);
+ public abstract void renderAjax(FacesContext context);
- public static final String SCRIPTS_PARAMETER = "org.ajax4jsf.framework.HEADER_SCRIPTS";
- public static final String STYLES_PARAMETER = "org.ajax4jsf.framework.HEADER_STYLES";
- public static final String USER_STYLES_PARAMETER = "org.ajax4jsf.framework.HEADER_USER_STYLES";
- public static final String RESPONSE_DATA_KEY = "_ajax:data";
- static final String SERVICE_RESOURCE = "META-INF/services/"
- + AjaxContext.class.getName();
- private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
+ public abstract void decode(FacesContext context);
+ public abstract void release();
+
+ public abstract Map<String, Object> getResponseDataMap();
+
+ public abstract void setAjaxRequest(boolean b);
+
+ public abstract boolean isSelfRender();
+
+ public abstract void setSelfRender(boolean b);
+
+ public abstract String getSubmittedRegionClientId();
+
+ public abstract void saveViewState(FacesContext context) throws IOException;
+
+ public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
+
+ public abstract String getAjaxSingleClientId();
+
/**
* Get instance of current AJAX Context. Instance get by
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
@@ -169,23 +182,4 @@
public AjaxContext() {
}
- public abstract void decode(FacesContext context);
-
- public abstract void release();
-
- public abstract Map<String, Object> getResponseDataMap();
-
- public abstract void setAjaxRequest(boolean b);
-
- public abstract boolean isSelfRender();
-
- public abstract void setSelfRender(boolean b);
-
- public abstract String getSubmittedRegionClientId();
-
- public abstract void saveViewState(FacesContext context) throws IOException;
-
- public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
-
- public abstract String getAjaxSingleClientId();
}
\ No newline at end of file
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -45,7 +45,6 @@
}
public boolean isAppropriateListener(FacesListener listener) {
- // TODO Auto-generated method stub
return listener instanceof AjaxRenderListener;
}
@@ -57,14 +56,4 @@
}
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#getPhaseId()
- */
-// public PhaseId getPhaseId() {
-// // TODO Auto-generated method stub
-// return PhaseId.INVOKE_APPLICATION;
-// }
-
-
-
}
Modified: trunk/framework/impl/pom.xml
===================================================================
--- trunk/framework/impl/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -1,179 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <!--
- <parent>
- <artifactId>impl-parent</artifactId>
- <groupId>org.richfaces.framework</groupId>
- <version>3.2.0-SNAPSHOT</version>
- <relativePath>../impl-parent/pom.xml</relativePath>
- </parent>
- -->
- <parent>
- <artifactId>framework</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.2.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <name>Java Server Faces AJAX framework implementation</name>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>javascript</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${basedir}/generatescript.xml" inheritRefs="true">
- <target name="assembly" />
- <property name="target-dir" value="${project.build.directory}/javascript">
- </property>
- </ant>
- </tasks>
- <resourceRoot>
- ${project.build.directory}/javascript
- </resourceRoot>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
+ <parent>
+ <artifactId>framework</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <name>Java Server Faces AJAX framework implementation</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>javascript</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/generatescript.xml" inheritRefs="true">
+ <target name="assembly" />
+ <property name="target-dir" value="${project.build.directory}/javascript"></property>
+ </ant>
+ </tasks>
+ <resourceRoot>${project.build.directory}/javascript</resourceRoot>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-javascript-plugin</artifactId>
<version>${project.version}</version>
- <executions>
+ <executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
- <configuration>
- <nosuffix>false</nosuffix>
- <outputDirectory>${project.build.directory}/compressed/</outputDirectory>
- <aggregations>
- <aggregation>
- <!-- remove files after aggregation (default: false)
- <removeIncluded>true</removeIncluded>
- -->
- <!-- insert new line after each concatenation (default: false) -->
- <insertNewLine>true</insertNewLine>
- <output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
- <!-- files to include, path relative to output's directory or absolute path-->
- <includes>
- <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
- <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
- <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
- <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
- <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
- <include>**/*-min.js</include>
- </includes>
- <!-- files to exclude, path relative to output's directory -->
- <excludes>
- <exclude>**/*.pack.js</exclude>
- <!-- exclude parts of the scriptaculous, so big file already included -->
- <exclude>**/scriptaculous/*.js</exclude>
- <exclude>**/extend-min.js</exclude>
- <exclude>**/jquery.jcarousel-min.js</exclude>
- <exclude>**/compressed.css</exclude>
- </excludes>
- </aggregation>
- </aggregations>
- <resources>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- </configuration>
-
+ <configuration>
+ <nosuffix>false</nosuffix>
+ <outputDirectory>${project.build.directory}/compressed/</outputDirectory>
+ <aggregations>
+ <aggregation>
+ <insertNewLine>true</insertNewLine>
+ <output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
+ <includes>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
+ <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
+ <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
+ <include>**/*-min.js</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.pack.js</exclude>
+ <exclude>**/scriptaculous/*.js</exclude>
+ <exclude>**/extend-min.js</exclude>
+ <exclude>**/jquery.jcarousel-min.js</exclude>
+ <exclude>**/compressed.css</exclude>
+ </excludes>
+ </aggregation>
+ </aggregations>
+ <resources>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </configuration>
</execution>
<execution>
<id>jslint</id>
+ <phase>test</phase>
<goals>
<goal>jslint</goal>
</goals>
- <phase>test</phase>
- <configuration>
- <includes><include>**/framework.pack.js</include></includes>
- <resources>
- <resource>
- <directory>${project.build.outputDirectory}</directory>
- </resource>
- </resources>
- </configuration>
-
+ <configuration>
+ <includes>
+ <include>**/framework.pack.js</include>
+ </includes>
+ <resources>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
</execution>
- </executions>
+ </executions>
</plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>clover</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- <configuration>
- <includesAllSourceRoots>
- false
- </includesAllSourceRoots>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <dependencies>
- <dependency>
- <groupId>opensymphony</groupId>
- <artifactId>oscache</artifactId>
- <version>2.3</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>0.9.5</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>1.8</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-api</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>clover</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+ <includesAllSourceRoots>false</includesAllSourceRoots>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>opensymphony</groupId>
+ <artifactId>oscache</artifactId>
+ <version>2.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>0.9.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -180,6 +180,10 @@
// broadcast ajax events before render response.
if (ajaxContext.isAjaxRequest()) {
processAjaxEvents(context, ajaxRoot);
+ if(ajaxContext.isSelfRender()){
+ // Render view directly.
+ ajaxContext.renderAjax(context);
+ }
}
if (!context.getResponseComplete()) {
super.renderView(context, root);
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -33,10 +33,8 @@
import javax.faces.event.FacesEvent;
import org.ajax4jsf.Messages;
-import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.event.AjaxListener;
-import org.ajax4jsf.event.AjaxRenderEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -177,7 +175,6 @@
*/
public boolean isSubmitted()
{
- // TODO - more correct check for submitted state
return this.submitted;
}
@@ -194,63 +191,47 @@
}
/**
- * <p>
- * In addition to to the default {@link UIComponent#broadcast}processing,
- * pass the {@link AjaxEvent}being broadcast to the method referenced by
- * <code>AjaxListener</code> (if any), and to the default
- * {@link AjaxListener}registered on the {@link Application}.
- * </p>
- *
- * @param event
- * {@link FacesEvent}to be broadcast
- *
- * @exception AbortProcessingException
- * Signal the JavaServer Faces implementation that no further
- * processing on the current event should be performed
- * @exception IllegalArgumentException
- * if the implementation class of this {@link FacesEvent}is
- * not supported by this component
- * @exception NullPointerException
- * if <code>event</code> is <code>null</code>
- */
- public void broadcast(FacesEvent event) throws AbortProcessingException {
-
- // Perform standard superclass processing
-// component.broadcast(event);
-
- if (event instanceof AjaxEvent) {
- if (log.isDebugEnabled())
- {
- log.debug(Messages.getMessage(Messages.SEND_EVENT_TO_AJAX_LISTENER, component.getId()));
- }
-
- // Notify the specified action listener method (if any)
- MethodExpression mb = getAjaxListener();
- if (mb != null) {
- FacesContext context = FacesContext.getCurrentInstance();
- ELContext elContext = context.getELContext();
- mb.invoke(elContext, new Object[] { event });
- }
- // TODO - perform special rendering, withowt RENDER_VIEW phase.
- if(isSelfRendered()) {
- // queue new event to end of queue to perform child elements
- // events.
- if (log.isDebugEnabled())
- {
- log.debug("Queue AjaxRenderEvent for self-render of AjaxContainer with Id "
- + component.getId());
- }
- FacesEvent renderEvent = new AjaxRenderEvent(component);
- renderEvent.setPhaseId(event.getPhaseId());
- component.queueEvent(renderEvent);
- }
- }
- if (event instanceof AjaxRenderEvent) {
- FacesContext context = FacesContext.getCurrentInstance();
- AjaxContext.getCurrentInstance(context).renderAjaxRegion(context, component, false);
- }
- }
+ * <p>
+ * In addition to to the default {@link UIComponent#broadcast}processing,
+ * pass the {@link AjaxEvent}being broadcast to the method referenced by
+ * <code>AjaxListener</code> (if any), and to the default
+ * {@link AjaxListener}registered on the {@link Application}.
+ * </p>
+ *
+ * @param event
+ * {@link FacesEvent}to be broadcast
+ *
+ * @exception AbortProcessingException
+ * Signal the JavaServer Faces implementation that no further
+ * processing on the current event should be performed
+ * @exception IllegalArgumentException
+ * if the implementation class of this {@link FacesEvent}is
+ * not supported by this component
+ * @exception NullPointerException
+ * if <code>event</code> is <code>null</code>
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ // Perform standard superclass processing
+ // component.broadcast(event);
+
+ if (event instanceof AjaxEvent) {
+ if (log.isDebugEnabled()) {
+ log.debug(Messages
+ .getMessage(Messages.SEND_EVENT_TO_AJAX_LISTENER,
+ component.getId()));
+ }
+
+ // Notify the specified action listener method (if any)
+ MethodExpression mb = getAjaxListener();
+ if (mb != null) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ELContext elContext = context.getELContext();
+ mb.invoke(elContext, new Object[] { event });
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -290,65 +271,8 @@
return values;
}
-/* public void processDecodes(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- // due SUN ri design, clear current sattus.
- if(! component.isRendered()) return;
- if(log.isDebugEnabled()){
- log.debug("Process decodes of AjaxContainer with Id "+component.getId());
- }
- component.decode(context);
- // If it is AJAX request for different area - skip decoding childs.
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip Decoders for childrens of AjaxContainer with Id "+component.getId());
- }
- return;
- }
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processDecodes(context);
- }
- }
- public void processValidators(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- if(! component.isRendered()) return;
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip Validators for childrens of AjaxContainer with Id "+component.getId());
- }
- return;
- }
-
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processValidators(context);
- }
- }
-
- public void processUpdates(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- if(! component.isRendered()) return;
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip updates for childrens of AjaxContainer with Id "+component.getId());
- }
- return;
- }
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processUpdates(context);
- }
- }
-*/
- public boolean isTransient() {
+ public boolean isTransient() {
return transientFlag;
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -509,6 +509,7 @@
}
}
+ @SuppressWarnings("unchecked")
public void restoreState(FacesContext context, Object state) {
Object[] mystate = (Object[]) state;
super.restoreState(context, mystate[0]);
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -35,6 +35,7 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
+import javax.faces.component.ContextCallback;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
import javax.faces.component.StateHolder;
@@ -42,6 +43,8 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -202,6 +205,9 @@
* Key for current value in model.
*/
private Object _rowKey = null;
+
+
+ private Converter _rowKeyConverter = null;
/**
* Values of row keys, encoded on ajax response rendering.
@@ -338,7 +344,7 @@
}
/**
- * Setup current roy by key. Perform same functionality as
+ * Setup current row by key. Perform same functionality as
* {@link UIData#setRowIndex(int)}, but for key object - it may be not only
* row number in sequence data, but, for example - path to current node in
* tree.
@@ -375,6 +381,27 @@
}
}
+ /**
+ * @return the rowKeyConverter
+ */
+ public Converter getRowKeyConverter() {
+ Converter converter = _rowKeyConverter;
+ if (null == converter) {
+ ValueExpression ve = getValueExpression("rowKeyConverter");
+ if (null != ve) {
+ converter = (Converter) ve.getValue(getFacesContext().getELContext());
+ }
+ }
+ return converter;
+ }
+
+ /**
+ * @param rowKeyConverter the rowKeyConverter to set
+ */
+ public void setRowKeyConverter(Converter rowKeyConverter) {
+ _rowKeyConverter = rowKeyConverter;
+ }
+
/*
* (non-Javadoc)
*
@@ -494,8 +521,14 @@
/**
* Instance of default renderer in ajax responses.
*/
- private AjaxChildrenRenderer _childrenRenderer = null;
+ private static final AjaxChildrenRenderer _childrenRenderer = new AjaxChildrenRenderer() {
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIDataAdaptor.class;
+ }
+
+ };
+
/**
* getter for simple {@link AjaxChildrenRenderer} instance in case of ajax
* responses. If default renderer not support search of children for encode
@@ -504,17 +537,6 @@
* @return
*/
protected AjaxChildrenRenderer getChildrenRenderer() {
- if (_childrenRenderer == null) {
- _childrenRenderer = new AjaxChildrenRenderer() {
-
- protected Class<? extends UIComponent> getComponentClass() {
- return UIDataAdaptor.class;
- }
-
- };
-
- }
-
return _childrenRenderer;
}
@@ -692,11 +714,22 @@
public String getClientId(FacesContext faces) {
if (null == _clientId) {
- StringBuffer id = new StringBuffer(getBaseClientId(faces));
+ StringBuilder id = new StringBuilder(getBaseClientId(faces));
Object rowKey = getRowKey();
if (rowKey != null) {
+ // Use converter to get String representation ot the row key.
+ Converter rowKeyConverter = getRowKeyConverter();
+ if(null == rowKeyConverter){
+ // Create default converter for a row key.
+ rowKeyConverter = faces.getApplication().createConverter(rowKey.getClass());
+ // Store converter for a invokeOnComponents call.
+ if(null != rowKeyConverter){
+ setRowKeyConverter(rowKeyConverter);
+ }
+ }
+ String rowKeyString = null !=rowKeyConverter?rowKeyConverter.getAsString(faces, this, rowKey):rowKey.toString();
id.append(NamingContainer.SEPARATOR_CHAR).append(
- rowKey.toString());
+ rowKeyString);
}
Renderer renderer;
if (null != (renderer = getRenderer(faces))) {
@@ -723,10 +756,10 @@
// Search for an ancestor that is a naming container
UIComponent ancestorContainer = this;
- StringBuffer parentIds = new StringBuffer();
+ StringBuilder parentIds = new StringBuilder();
while (null != (ancestorContainer = ancestorContainer.getParent())) {
if (ancestorContainer instanceof NamingContainer) {
- parentIds.append(ancestorContainer.getClientId(faces))
+ parentIds.append(ancestorContainer.getContainerClientId(faces))
.append(NamingContainer.SEPARATOR_CHAR);
break;
}
@@ -735,8 +768,10 @@
if (null != id) {
_baseClientId = parentIds.append(id).toString();
} else {
+ id = faces.getViewRoot().createUniqueId();
+ super.setId(id);
_baseClientId = parentIds.append(
- faces.getViewRoot().createUniqueId()).toString();
+ getId()).toString();
}
}
return (_baseClientId);
@@ -1012,6 +1047,72 @@
this.restoreOrigValue(faces);
}
}
+
+ @Override
+ public boolean invokeOnComponent(FacesContext context, String clientId,
+ ContextCallback callback) throws FacesException {
+ if( null == context || null == clientId || null == callback){
+ throw new NullPointerException();
+ }
+ boolean found = false;
+ Object oldRowKey = getRowKey();
+ String baseClientId = getBaseClientId(context);
+ if (clientId.equals(baseClientId)) {
+ // This is call for a same data component.
+ try {
+ if (null != oldRowKey) {
+ captureOrigValue(context);
+ setRowKey(context,null);
+ }
+ callback.invokeContextCallback(context, this);
+ found = true;
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (null != oldRowKey) {
+ setRowKey(context,oldRowKey);
+ restoreOrigValue(context);
+ }
+ }
+ } else {
+ String baseId = baseClientId+NamingContainer.SEPARATOR_CHAR;
+ if (clientId.startsWith(baseId)) {
+ Object newRowKey = null;
+ // Call for a child component - try to detect row key
+ int indexOfSecondColon = clientId.indexOf(
+ NamingContainer.SEPARATOR_CHAR, baseId.length());
+ String rowKeyString = null;
+ if (indexOfSecondColon > 0) {
+ rowKeyString = clientId.substring(baseId.length(),
+ indexOfSecondColon);
+ Converter keyConverter = getRowKeyConverter();
+ if (null != keyConverter) {
+ try {
+ newRowKey = keyConverter.getAsObject(context, this,
+ rowKeyString);
+ } catch (ConverterException e) {
+ // TODO: log error
+ }
+ }
+ }
+ if( null != oldRowKey || null != newRowKey){
+ captureOrigValue(context);
+ setRowKey(newRowKey);
+ }
+ Iterator<UIComponent> itr = this.getFacetsAndChildren();
+ while (itr.hasNext() && !found) {
+ found = itr.next().invokeOnComponent(context, clientId,
+ callback);
+ }
+ if( null != oldRowKey || null != newRowKey){
+ setRowKey(oldRowKey);
+ restoreOrigValue(context);
+ }
+ }
+ }
+ //
+ return found;
+ }
/**
* Walk ( visit ) this component on all data-avare children for each row.
@@ -1329,6 +1430,8 @@
private Map<String, Map<String, SavedState>> childStates;
+ public Object rowKeyConverter;
+
}
/**
@@ -1364,6 +1467,10 @@
this._rowKeyVar = state.rowKeyVar;
this._stateVar = state.stateVar;
this.childState = state.childStates;
+ if (null != state.rowKeyConverter) {
+ this._rowKeyConverter = (Converter) restoreAttachedState(faces,
+ state.rowKeyConverter);
+ }
// Restore serializable models and component states for all rows of
// parent UIData ( single if this
// component not child of iterable )
@@ -1394,6 +1501,9 @@
state.rowKeyVar = this._rowKeyVar;
state.stateVar = this._stateVar;
state.childStates = this.childState;
+ if (null != this._rowKeyConverter) {
+ state.rowKeyConverter = saveAttachedState(faces,this._rowKeyConverter);
+ }
Set<String> encodedIds = getEncodedIds();
// Save all states of component and data model for all valies of
// clientId, encoded in this request.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -34,6 +34,8 @@
import java.util.Set;
import java.util.regex.Pattern;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.FacesException;
@@ -51,11 +53,8 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
-import javax.servlet.Servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
import org.ajax4jsf.Messages;
import org.ajax4jsf.application.AjaxViewHandler;
@@ -83,7 +82,6 @@
* @version $Revision: 1.1.2.7 $ $Date: 2007/02/08 19:07:16 $
*
*/
-@SuppressWarnings("deprecation")
public class AjaxContextImpl extends AjaxContext {
public static final String SERVLET_ERROR_EXCEPTION_ATTRIBUTE = "javax.servlet.error.exception";
@@ -101,9 +99,7 @@
private static final Log log = LogFactory.getLog(AjaxContext.class);
- private static ComponentInvoker invoker;
-
Set<String> ajaxAreasToRender = new HashSet<String>();
Set<String> ajaxRenderedAreas = new LinkedHashSet<String>();
@@ -127,15 +123,9 @@
Object oncomplete = null;
- static {
- try {
- // Attempt to create JSF1.2 specific invoker.
- invoker = new JsfOneTwoInvoker();
- } catch (Exception e) {
- invoker = new JsfOneOneInvoker();
- }
- }
+
+ @PreDestroy
public void release() {
ajaxAreasToRender = new HashSet<String>();
@@ -162,6 +152,7 @@
* @see org.ajax4jsf.context.AjaxContext#decode(javax.faces.context.FacesContext)
*/
@Override
+ @PostConstruct
public void decode(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
if (null == externalContext.getRequestMap().get(
@@ -181,79 +172,20 @@
}
}
- /**
- * @param root
- * @param context
- * @param callback
- * @param regionId
- * @return
- * @see org.ajax4jsf.context.JsfOneOneInvoker#invokeOnComponent(javax.faces.component.UIComponent,
- * javax.faces.context.FacesContext,
- * org.ajax4jsf.context.InvokerCallback, java.lang.String)
- */
- public static boolean invokeOnComponent(UIComponent root,
- FacesContext context, InvokerCallback callback, String regionId) {
- return invoker.invokeOnComponent(root, context, callback, regionId);
- }
/**
- * @param viewRoot
* @param context
- * @param callback
- * @see org.ajax4jsf.context.JsfOneOneInvoker#invokeOnRegionOrRoot(org.ajax4jsf.component.AjaxViewRoot,
- * javax.faces.context.FacesContext,
- * org.ajax4jsf.context.InvokerCallback)
- */
- public static void invokeOnRegionOrRoot(AjaxViewRoot viewRoot,
- FacesContext context, InvokerCallback callback) {
- invoker.invokeOnRegionOrRoot(viewRoot, context, callback);
- }
-
- public void renderSubmittedAjaxRegion(FacesContext context) {
- renderSubmittedAjaxRegion(context, true);
- }
-
- public void renderSubmittedAjaxRegion(FacesContext context,
- final boolean useFilterWriter) {
- InvokerCallback ajaxInvoker = new InvokerCallback() {
-
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- if (component instanceof AjaxContainer) {
- renderAjaxRegion(context, component, useFilterWriter);
- } else {
- // Container not found, use Root for encode.
- renderAjaxRegion(context, context.getViewRoot(),
- useFilterWriter);
- }
- }
-
- public void invokeRoot(FacesContext context) {
- renderAjaxRegion(context, context.getViewRoot(),
- useFilterWriter);
- }
-
- };
- if (!invokeOnComponent(context.getViewRoot(), context, ajaxInvoker,
- getSubmittedRegionClientId())) {
- renderAjaxRegion(context, context.getViewRoot(), useFilterWriter);
- }
-
- }
-
- /**
- * @param context
- * @param useFilterWriter
- * TODO
* @throws AbortProcessingException
*/
- public void renderAjaxRegion(FacesContext context, UIComponent component,
- boolean useFilterWriter) throws FacesException {
+ public void renderAjax(FacesContext context) throws FacesException {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.RENDER_AJAX_REQUEST,
- component.getId()));
+ getSubmittedRegionClientId()));
}
try {
+ // Just in case...
setSelfRender(true);
+ setAjaxRequest(true);
// create response writer.
ExternalContext extContext = context.getExternalContext();
RenderKit renderKit = context.getRenderKit();
@@ -264,8 +196,6 @@
.getRequest();
ServletResponse response = (ServletResponse) extContext
.getResponse();
- // HACK - bypass MyFaces ( and other ) extensions filter.
-
// Setup encoding and content type
String contentType = "text/xml";
// get the encoding - must be setup by faces context or filter.
@@ -278,36 +208,16 @@
encoding = "UTF-8";
PrintWriter servletWriter;
- if (useFilterWriter
- && extContext.getRequestMap().containsKey(
- BaseFilter.RESPONSE_WRAPPER_ATTRIBUTE)) {
- // HACK - Special case for MyFaces, since <f:view don't call
- // encode methods,
- // encode response as for self-rendered region directly to
- // filter response wrpper.
- // to avoid exceptions, inform wrapper to ignore illegal states
- // for getWriter/Stream.
- ServletResponse servletResponse = (ServletResponse) extContext
- .getRequestMap().get(
- BaseFilter.RESPONSE_WRAPPER_ATTRIBUTE);
- servletResponse.resetBuffer();
- servletWriter = servletResponse.getWriter();
- ((FilterServletResponseWrapper) servletResponse)
- .setUseNullStream(true);
- } else {
servletWriter = getWriter(extContext);
- }
ResponseWriter writer = renderKit.createResponseWriter(
servletWriter, null, encoding);
context.setResponseWriter(writer);
// make response
writer.startDocument();
- encodeAjaxBegin(context, component);
- component.encodeBegin(context);
- ((AjaxContainer) component).encodeAjax(context);
- component.encodeEnd(context);
+ encodeAjaxBegin(context);
+ context.getViewRoot().encodeAll(context);
saveViewState(context);
- encodeAjaxEnd(context, component);
+ encodeAjaxEnd(context);
writer.endDocument();
writer.flush();
writer.close();
@@ -315,8 +225,7 @@
// Save tree state.
} catch (IOException e) {
throw new FacesException(Messages.getMessage(
- Messages.RENDERING_AJAX_REGION_ERROR, component
- .getClientId(context)), e);
+ Messages.RENDERING_AJAX_REGION_ERROR, getSubmittedRegionClientId()), e);
} finally {
context.responseComplete();
// component.setRendererType(defaultRenderer);
@@ -327,19 +236,19 @@
* Encode declaration for AJAX response. Render <html><body>
*
* @param context
- * @param component
* @throws IOException
*/
- public void encodeAjaxBegin(FacesContext context, UIComponent component)
+ public void encodeAjaxBegin(FacesContext context)
throws IOException {
+ UIViewRoot viewRoot = context.getViewRoot();
// AjaxContainer ajax = (AjaxContainer) component;
ResponseWriter out = context.getResponseWriter();
// DebugUtils.traceView("ViewRoot in AJAX Page encode begin");
- out.startElement(HTML.HTML_ELEMENT, component);
+ out.startElement(HTML.HTML_ELEMENT, viewRoot);
// TODO - html attributes. lang - from current locale ?
- Locale locale = context.getViewRoot().getLocale();
+ Locale locale = viewRoot.getLocale();
out.writeAttribute(HTML.lang_ATTRIBUTE, locale.toString(), "lang");
- out.startElement(HTML.BODY_ELEMENT, component);
+ out.startElement(HTML.BODY_ELEMENT, viewRoot);
}
/**
@@ -347,10 +256,9 @@
* </body></html>
*
* @param context
- * @param component
* @throws IOException
*/
- public void encodeAjaxEnd(FacesContext context, UIComponent component)
+ public void encodeAjaxEnd(FacesContext context)
throws IOException {
// AjaxContainer ajax = (AjaxContainer) component;
ResponseWriter out = context.getResponseWriter();
@@ -570,13 +478,6 @@
@SuppressWarnings("deprecation")
public void saveViewState(FacesContext context) throws IOException {
- // TODO - for facelets environment, we need to remove transient
- // components.
- try {
- Application.class.getMethod("getExpressionFactory", (Class<?>) null);
- } catch (NoSuchMethodException e) {
- // JSF 1.1 !
- }
ResponseWriter writer = context.getResponseWriter();
StateManager stateManager = context.getApplication().getStateManager();
SerializedView serializedView = stateManager
@@ -584,11 +485,7 @@
if (null != serializedView && null != writer) {
StringWriter bufWriter = new StringWriter();
ResponseWriter tempWriter;
-// if(null != writer) {
- tempWriter = writer.cloneWithWriter(bufWriter);
-// } else {
-// tempWriter = getRenderKit(context).createResponseWriter(bufWriter, null, null);
-// }
+ tempWriter = writer.cloneWithWriter(bufWriter);
context.setResponseWriter(tempWriter);
stateManager.writeState(context, serializedView);
tempWriter.flush();
@@ -597,10 +494,7 @@
AjaxViewHandler.SERIALIZED_STATE_KEY,
bufWriter.toString());
}
- // Restore original writer.
-// if (null != writer) {
- context.setResponseWriter(writer);
-// }
+ context.setResponseWriter(writer);
}
}
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -1,90 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.context;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.component.AjaxViewRoot;
-import org.ajax4jsf.context.AjaxContext;
-
-/**
- * @author shura
- *
- */
-public class JsfOneOneInvoker implements ComponentInvoker {
-
-
- /**
- *
- */
- public JsfOneOneInvoker() {
- // TODO Auto-generated constructor stub
- }
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnRegionOrRoot(org.ajax4jsf.framework.ajax.AjaxViewRoot, javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback, javax.faces.event.PhaseId)
- */
- public void invokeOnRegionOrRoot(AjaxViewRoot viewRoot, FacesContext context, InvokerCallback callback) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- String submittedRegionClientId = ajaxContext.getSubmittedRegionClientId();
- if(null == submittedRegionClientId || viewRoot.getId().equals(submittedRegionClientId)){
- // This is a not AJAX request, or active region is root.
- callback.invokeRoot(context);
- } else {
- if(!invokeOnComponent(viewRoot, context, callback, submittedRegionClientId)){
- // Region not found - perform default actions.
- // TODO - log errors.
- callback.invokeRoot(context);
- }
- }
-
- }
-
- public void invokeOnRegion(FacesContext context, InvokerCallback callback, String regionId) {
- UIViewRoot viewRoot = context.getViewRoot();
- invokeOnComponent(viewRoot,context,callback,regionId);
- }
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnComponent(javax.faces.component.UIComponent, javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback, java.lang.String)
- */
- public boolean invokeOnComponent(UIComponent root, FacesContext context, InvokerCallback callback, String regionId) {
- if(regionId.equals(root.getClientId(context))){
- callback.invokeContextCallback(context, root);
- return true;
- }
- for (Iterator iter = root.getFacetsAndChildren(); iter.hasNext();) {
- UIComponent child = (UIComponent) iter.next();
- if(invokeOnComponent(child, context, callback, regionId)){
- return true;
- }
- }
- return false;
- }
-
-}
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -1,74 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.context;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.component.AjaxViewRoot;
-import org.ajax4jsf.context.AjaxContext;
-
-/**
- * @author shura
- *
- */
-public class JsfOneTwoInvoker implements ComponentInvoker {
-
-
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnRegionOrRoot(org.ajax4jsf.framework.ajax.AjaxViewRoot, javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback, javax.faces.event.PhaseId)
- */
- public void invokeOnRegionOrRoot(AjaxViewRoot viewRoot, FacesContext context, InvokerCallback callback) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- String submittedRegionClientId = ajaxContext.getSubmittedRegionClientId();
- if(null == submittedRegionClientId || viewRoot.getClientId(context).equals(submittedRegionClientId)){
- // This is a not AJAX request, or active region is root.
- callback.invokeRoot(context);
- } else {
- if(!invokeOnComponent(viewRoot, context, callback, submittedRegionClientId)){
- // Region not found - perform default actions.
- // TODO - log errors.
- callback.invokeRoot(context);
- }
- }
-
- }
-
- public void invokeOnRegion(FacesContext context, InvokerCallback callback, String regionId) {
- UIViewRoot viewRoot = context.getViewRoot();
- invokeOnComponent(viewRoot,context,callback,regionId);
- }
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnComponent(javax.faces.component.UIComponent, javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback, java.lang.String)
- */
- public boolean invokeOnComponent(UIComponent root, FacesContext context, InvokerCallback callback, String regionId) {
- return root.invokeOnComponent(context, regionId, callback);
- }
-
-}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -71,48 +71,26 @@
log.debug("Process after phase " + phaseId.toString());
}
FacesContext context = event.getFacesContext();
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if (phaseId == PhaseId.RENDER_RESPONSE) {
- try {
- if (ajaxContext.isAjaxRequest()) {
- // JSF RI 1.1 hack - view state not saved in <f:view> tag.
- if (null == requestMap.get(VIEW_STATE_SAVED_PARAM)) {
- ajaxContext.saveViewState(context);
- }
- }
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- ajaxContext.release();
- }
- // ajaxContext.processHeadResources(context);
- } else if (phaseId == PhaseId.RESTORE_VIEW) {
-
+ if (phaseId == PhaseId.RESTORE_VIEW) {
UIViewRoot viewRoot = context.getViewRoot();
if (null != viewRoot) {
boolean isAjax = ajaxContext.isAjaxRequest();
- Map attributes = viewRoot.getAttributes();
- for (Iterator it = attributes.keySet().iterator(); it.hasNext();) {
- Object key = it.next();
- if (key instanceof String) {
- String stringKey = (String) key;
+ Map<String, Object> attributes = viewRoot.getAttributes();
+ for(String stringKey:attributes.keySet()) {
if (stringKey.startsWith(VIEW_BEAN_PREFIX)) {
requestMap.put(stringKey.substring(VIEW_BEAN_PREFIX
- .length()), attributes.get(key));
+ .length()), attributes.get(stringKey));
} else if (isAjax
&& stringKey.startsWith(AJAX_BEAN_PREFIX)) {
requestMap.put(stringKey.substring(AJAX_BEAN_PREFIX
- .length()), attributes.get(key));
+ .length()), attributes.get(stringKey));
}
- }
}
}
}
- if (context.getResponseComplete()) {
- ajaxContext.release();
- }
}
/*
@@ -166,16 +144,5 @@
return PhaseId.ANY_PHASE;
}
- protected boolean isValueReference(String value) {
- if (value == null)
- throw new NullPointerException("value");
- int start = value.indexOf("#{");
- if (start < 0)
- return false;
-
- int end = value.lastIndexOf('}');
- return (end >= 0 && start < end);
- }
-
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -134,7 +134,7 @@
* @see javax.faces.component.UIComponent#getRendersChildren()
*/
public boolean getRendersChildren() {
- return true;
+ return false;
}
/*
@@ -156,6 +156,9 @@
AjaxContainer ajaxContainer = (AjaxContainer) component;
if (null != ajaxParameter && ajaxParameter.equals(clientId)) {
ajaxContainer.setSubmitted(true);
+ if(ajaxContainer.isSelfRendered()){
+ AjaxContext.getCurrentInstance(context).setSelfRender(true);
+ }
AjaxEvent event = new AjaxEvent(component);
component.queueEvent(event);
} else {
Modified: trunk/framework/pom.xml
===================================================================
--- trunk/framework/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -79,7 +79,6 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -102,9 +101,16 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
<modules>
<!--
Modified: trunk/framework/test/pom.xml
===================================================================
--- trunk/framework/test/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/test/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -49,7 +49,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>htmlunit</groupId>
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -73,7 +73,7 @@
* @see org.ajax4jsf.context.AjaxContext#encodeAjaxBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
@Override
- public void encodeAjaxBegin(FacesContext context, UIComponent component)
+ public void encodeAjaxBegin(FacesContext context)
throws IOException {
// TODO Auto-generated method stub
@@ -83,7 +83,7 @@
* @see org.ajax4jsf.context.AjaxContext#encodeAjaxEnd(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
@Override
- public void encodeAjaxEnd(FacesContext context, UIComponent component)
+ public void encodeAjaxEnd(FacesContext context)
throws IOException {
// TODO Auto-generated method stub
@@ -233,31 +233,12 @@
return false;
}
- /* (non-Javadoc)
- * @see org.ajax4jsf.context.AjaxContext#renderAjaxRegion(javax.faces.context.FacesContext, javax.faces.component.UIComponent, boolean)
- */
- @Override
- public void renderAjaxRegion(FacesContext context, UIComponent component,
- boolean useFilterWriter) throws FacesException {
- // TODO Auto-generated method stub
- }
-
/* (non-Javadoc)
- * @see org.ajax4jsf.context.AjaxContext#renderSubmittedAjaxRegion(javax.faces.context.FacesContext, boolean)
- */
- @Override
- public void renderSubmittedAjaxRegion(FacesContext context,
- boolean useFilterWriter) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
* @see org.ajax4jsf.context.AjaxContext#renderSubmittedAjaxRegion(javax.faces.context.FacesContext)
*/
@Override
- public void renderSubmittedAjaxRegion(FacesContext context) {
+ public void renderAjax(FacesContext context) {
// TODO Auto-generated method stub
}
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -189,12 +189,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -244,12 +244,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -289,12 +289,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -343,13 +343,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
Copied: trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml (from rev 6920, trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml)
===================================================================
--- trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml (rev 0)
+++ trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>seamEARDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+ <metadata>
+ <type-mapping>Hypersonic SQL</type-mapping>
+ </metadata>
+<!--
+ <exception-sorter-class-name>
+ org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
+ </exception-sorter-class-name>
+ <metadata>
+ <type-mapping>mySQL</type-mapping>
+ </metadata>
+-->
+ </local-tx-datasource>
+
+</datasources>
+
Modified: trunk/samples/seamEAR/ejbs/pom.xml
===================================================================
--- trunk/samples/seamEAR/ejbs/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/ejbs/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -23,9 +23,9 @@
<artifactId>logging</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <scope>provided</scope>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
@@ -68,19 +68,21 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <artifactId>hibernate-annotations</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
+ <artifactId>hibernate-validator</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ </dependency>
</dependencies>
<build>
- <finalName>ejbs</finalName>
+ <finalName>ejbs</finalName>
<plugins>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
Deleted: trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml
===================================================================
--- trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE datasources
- PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
-
-<datasources>
-
- <local-tx-datasource>
- <jndi-name>seamEARDatasource</jndi-name>
- <connection-url>jdbc:hsqldb:.</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
- <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
- <metadata>
- <type-mapping>Hypersonic SQL</type-mapping>
- </metadata>
-<!--
- <exception-sorter-class-name>
- org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
- </exception-sorter-class-name>
- <metadata>
- <type-mapping>mySQL</type-mapping>
- </metadata>
--->
- </local-tx-datasource>
-
-</datasources>
-
Modified: trunk/samples/seamEAR/pom.xml
===================================================================
--- trunk/samples/seamEAR/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -16,7 +16,7 @@
<packaging>pom</packaging>
<name>seam EAR project</name>
<properties>
- <seam>2.0.0.GA</seam>
+ <seam>2.0.1.GA</seam>
</properties>
<modules>
<module>projects</module>
@@ -89,16 +89,21 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <version>3.3.1.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>3.3.1.ga</version>
+ <version>3.3.2.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${seam}</version>
Modified: trunk/samples/seamEAR/wars/seamWebapp/pom.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/wars/seamWebapp/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -13,7 +13,7 @@
<version>3.2.0-SNAPSHOT</version>
</parent>
<build>
- <finalName>seamWebapp</finalName>
+ <finalName>seamWebapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -58,13 +58,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -74,33 +74,18 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>3.3.0.ga</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
<scope>provided</scope>
- </dependency>
- <!--
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.4.ga</version>
- </dependency>
- -->
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>3.0.0.ga</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <scope>provided</scope>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
Modified: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -32,10 +32,10 @@
authenticate-method="#{authenticator.authenticate}" />
<event type="org.jboss.seam.notLoggedIn">
- <action expression="#{redirect.captureCurrentView}" />
+ <action execute="#{redirect.captureCurrentView}" />
</event>
<event type="org.jboss.seam.postAuthenticate">
- <action expression="#{redirect.returnToCapturedView}" />
+ <action execute="#{redirect.returnToCapturedView}" />
</event>
<mail:mail-session host="localhost" port="2525" username="test"
@@ -43,15 +43,11 @@
<!-- For use with jBPM pageflow or process management -->
<!--
- <bpm:jbpm>
- <bpm:process-definitions></bpm:process-definitions>
- <bpm:pageflow-definitions></bpm:pageflow-definitions>
- </bpm:jbpm>
- -->
<bpm:jbpm>
<bpm:pageflow-definitions>
<value>/pageflows/pageflow.jpdl.xml</value>
</bpm:pageflow-definitions>
</bpm:jbpm>
+ -->
</components>
Modified: trunk/samples/skins/pom.xml
===================================================================
--- trunk/samples/skins/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/skins/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -8,5 +8,5 @@
<groupId>org.richfaces.samples</groupId>
<artifactId>skins</artifactId>
<name>skins</name>
- <dependencies />
+ <dependencies/>
</project>
\ No newline at end of file
Modified: trunk/sandbox/api/pom.xml
===================================================================
--- trunk/sandbox/api/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/sandbox/api/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -35,7 +35,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -51,7 +51,7 @@
*/
public void processAjaxRender(AjaxRenderEvent event) {
FacesContext facesContext = FacesContext.getCurrentInstance();
- AjaxContext.getCurrentInstance(facesContext).renderSubmittedAjaxRegion(facesContext,false);
+ AjaxContext.getCurrentInstance(facesContext).renderAjax(facesContext);
}
}
Modified: trunk/ui/pickList/pom.xml
===================================================================
--- trunk/ui/pickList/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/pickList/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -66,7 +66,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -179,7 +179,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -431,9 +431,9 @@
}
AjaxRendererUtils.addRegionsFromComponent(this, context);
AjaxRendererUtils.addRegionByName(context, this, this.getId());
- setSubmitted(true);
+// setSubmitted(true);
if (isSelfRendered()) {
- ajaxContext.renderSubmittedAjaxRegion(context, true);
+ ajaxContext.setSelfRender(true);
}
} else if (event instanceof SelectSuggestionEvent) {
setValue(null);
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-19 18:16:27 UTC (rev 6975)
@@ -164,22 +164,22 @@
protected final void doDecode(final FacesContext context,
final UIComponent component) {
String clientId = component.getClientId(context);
- Map requestParameterMap = context.getExternalContext()
+ Map<String, String> requestParameterMap = context.getExternalContext()
.getRequestParameterMap();
- String reqValue = (String) requestParameterMap.get(clientId);
+ String reqValue = requestParameterMap.get(clientId);
if (reqValue != null && reqValue.equals(clientId)) {
+ UISuggestionBox suggestionBox = ((UISuggestionBox) component);
String paramName = (String) component.getAttributes().get("param");
if (null == paramName) {
paramName = "inputvalue";
}
- Object elementValue = requestParameterMap.get(paramName);
+ String elementValue = requestParameterMap.get(paramName);
+ suggestionBox.setSubmitted(true);
component.queueEvent(
new AjaxSuggestionEvent(component, elementValue));
-
-
String requestedParamName = paramName + "request";
String[] requestedValues = null;
- Object requestedValuesParam = requestParameterMap.get(requestedParamName);
+ String requestedValuesParam = requestParameterMap.get(requestedParamName);
if (requestedValuesParam != null) {
String requestedString = requestedValuesParam.toString();
@@ -193,8 +193,7 @@
} else {
//TODO nick - review together with pasha
}
-
- ((UISuggestionBox) component).setSubmitedValue(elementValue,
+ suggestionBox.setSubmitedValue(elementValue,
requestedValues);
}
@@ -342,7 +341,7 @@
return parent;
} else {
throw new FacesException("SuggestonBox cannot be attached to the component with id = " + parent.getId() +
- ", because a client identifier of the component won�t be rendered onto the page. Please, set the identifier.");
+ ", because a client identifier of the component won�t be rendered onto the page. Please, set the identifier.");
}
} else {
throw new FacesException("Parent component is null for SuggestionBox " +
16 years, 10 months
JBoss Rich Faces SVN: r6974 - in trunk/ui/datascroller/src/main: java/org/richfaces/renderkit/html and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-19 14:10:39 -0400 (Wed, 19 Mar 2008)
New Revision: 6974
Removed:
trunk/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/scripts/
Modified:
trunk/ui/datascroller/src/main/config/component/datascroller.xml
trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2233
Modified: trunk/ui/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-03-19 18:10:23 UTC (rev 6973)
+++ trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-03-19 18:10:39 UTC (rev 6974)
@@ -263,6 +263,11 @@
<classname>java.lang.String</classname>
<description>Name of variable in request scope containing number of pages</description>
</property>
+
+ <property>
+ <name>onpagechange</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
&listeners;
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2008-03-19 18:10:23 UTC (rev 6973)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2008-03-19 18:10:39 UTC (rev 6974)
@@ -35,7 +35,7 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
-import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.richfaces.component.UIDatascroller;
@@ -224,7 +224,7 @@
}
public Object getOnClick(String string) {
- return "RichFaces.Datascroller.switchToPage(this, event, '" + string + "');";
+ return "Event.fire(this, 'rich:datascroller:onscroll', {'page': '" + string + "'});";
}
public void renderPages(FacesContext context, UIComponent component, int pageIndex, int count)
@@ -275,8 +275,7 @@
}
public String getSubmitFunction(FacesContext context, UIComponent component) {
-
- JSFunctionDefinition definition = new JSFunctionDefinition("event", "value");
+ JSFunctionDefinition definition = new JSFunctionDefinition("event");
JSFunction function = AjaxRendererUtils.buildAjaxFunction(component,
context);
@@ -289,13 +288,28 @@
parameters.putAll(params);
}
- parameters.put(component.getClientId(context), new JSReference("value"));
+ parameters.put(component.getClientId(context), new JSLiteral("event.memo.page"));
function.addParameter(eventOptions);
StringBuffer buffer = new StringBuffer();
function.appendScript(buffer);
buffer.append("; return false;");
- definition.addToBody(buffer.toString());
+
+ String onPageChange = (String) component.getAttributes().get("onpagechange");
+ if (onPageChange != null && onPageChange.length() != 0) {
+ JSFunctionDefinition onPageChangeDef = new JSFunctionDefinition("event");
+ onPageChangeDef.addToBody(onPageChange);
+ onPageChangeDef.addToBody("; return true;");
+
+ definition.addToBody("if (");
+ definition.addToBody(onPageChangeDef.toScript());
+ definition.addToBody("(event)) {");
+ definition.addToBody(buffer.toString());
+ definition.addToBody("}");
+ } else {
+ definition.addToBody(buffer.toString());
+ }
+
return definition.toScript();
}
Modified: trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
===================================================================
--- trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2008-03-19 18:10:23 UTC (rev 6973)
+++ trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2008-03-19 18:10:39 UTC (rev 6974)
@@ -13,8 +13,7 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
- new org.ajax4jsf.javascript.AjaxScript(),
- /org/richfaces/renderkit/html/scripts/datascroller.js
+ new org.ajax4jsf.javascript.AjaxScript()
</h:scripts>
<f:clientid var="clientId"/>
@@ -351,7 +350,7 @@
]]>
</jsp:scriptlet>
<script type="text/javascript">
- RichFaces.Datascroller.initialize('#{clientId}', #{this:getSubmitFunction(context,component)});
+ Event.observe('#{clientId}', 'rich:datascroller:onscroll', #{this:getSubmitFunction(context,component)});
</script>
</div>
</f:root>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6973 - trunk/samples/datascroller-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-19 14:10:23 -0400 (Wed, 19 Mar 2008)
New Revision: 6973
Modified:
trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-2233
Modified: trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2008-03-19 18:07:58 UTC (rev 6972)
+++ trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2008-03-19 18:10:23 UTC (rev 6973)
@@ -28,7 +28,7 @@
<h:outputText value="Data Table test" />
<br />
- <ds:datascroller page="2" for="master" reRender="actionCount, eventCount" rendered="true" fastStep="2" actionListener="#{testBean.onAction}" renderIfSinglePage="#{testBean.renderIfSinglePage}" scrollerListener="#{testBean.doScroll}" maxPages="#{testBean.maxpage}"/>
+ <ds:datascroller onpagechange="return confirm('Do you want to go to: ' + event.memo.page + '?')" page="2" for="master" reRender="actionCount, eventCount" rendered="true" fastStep="2" actionListener="#{testBean.onAction}" renderIfSinglePage="#{testBean.renderIfSinglePage}" scrollerListener="#{testBean.doScroll}" maxPages="#{testBean.maxpage}"/>
<h:dataTable rows="#{testBean.rows}" id="master" border="1" value="#{testBean.data}" var="data">
<f:facet name="header">
16 years, 10 months
JBoss Rich Faces SVN: r6972 - trunk/framework/impl/src/main/resources/org/ajax4jsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-19 14:07:58 -0400 (Wed, 19 Mar 2008)
New Revision: 6972
Modified:
trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
Datascroller message updated
Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-03-19 17:24:14 UTC (rev 6971)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-03-19 18:07:58 UTC (rev 6972)
@@ -255,4 +255,4 @@
UI_INSERT_RESOURCE_NOT_FOUND="Resource {1} not found, component {0}
HIGHLIGHT_LIBRARY_NOT_FOUND="In order to use highlight attribute of the rich:insert component, add jhighlight.jar from https://jhighlight.dev.java.net/ into application."
INVALID_VALUE="Component {0} has invalid value expression {1}"
-DATASCROLLER_PAGE_MISSING=Datascroller {0}: The requested page #{1} isn't found in the model containing {2} pages. Datascroller is reset to page #{3}
\ No newline at end of file
+DATASCROLLER_PAGE_MISSING=Datascroller {0}: The requested page #{1} isn''t found in the model containing {2} pages. Datascroller is reset to page #{3}
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6971 - trunk/ui/inplaceInput/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-19 13:24:14 -0400 (Wed, 19 Mar 2008)
New Revision: 6971
Modified:
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2619
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-19 17:16:27 UTC (rev 6970)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-19 17:24:14 UTC (rev 6971)
@@ -52,8 +52,8 @@
String controlClass = (String)component.getAttributes().get("controlClass");
variables.setVariable("controlClass", controlClass);
- String controlHoveredClass = (String)component.getAttributes().get("controlHoverClass");
- variables.setVariable("controlHoverClass", controlHoveredClass);
+ String controlHoverClass = (String)component.getAttributes().get("controlHoverClass");
+ variables.setVariable("controlHoverClass", controlHoverClass);
String controlPressedClass = (String)component.getAttributes().get("controlPressedClass");
variables.setVariable("controlPressedClass", controlPressedClass);
@@ -142,14 +142,14 @@
onmouseup="this.className='rich-inplace-control #{controlClass}'"
onmouseout="this.className='rich-inplace-control #{controlClass}'"
onmousedown="this.className='rich-inplace-control-press #{controlPressedClass}'"
- onmouseover="this.className='rich-inplace-control #{controlHoveredClass}'"
+ onmouseover="this.className='rich-inplace-control #{controlHoverClass}'"
src='#{saveIcon}'/>
<input id='#{clientId}cancel' class='rich-inplace-control #{controlClass}'
type='image'
onmouseup="this.className='rich-inplace-control #{controlClass}'"
onmouseout="this.className='rich-inplace-control #{controlClass}'"
onmousedown="this.className='rich-inplace-control-press #{controlPressedClass}'"
- onmouseover="this.className='rich-inplace-control #{controlHoveredClass}'"
+ onmouseover="this.className='rich-inplace-control #{controlHoverClass}'"
src='#{cancelIcon}'/>
</div>
<jsp:scriptlet>
16 years, 10 months
JBoss Rich Faces SVN: r6970 - in trunk/test-applications/jsp/src/main/webapp: FileUpload and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-03-19 13:16:27 -0400 (Wed, 19 Mar 2008)
New Revision: 6970
Modified:
trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
trunk/test-applications/jsp/src/main/webapp/TabPanel/TabPanelProperty.jsp
Log:
TabThee id instead of TabThr for selectedTab testing.
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-03-19 17:09:28 UTC (rev 6969)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-03-19 17:16:27 UTC (rev 6970)
@@ -46,6 +46,10 @@
<h:inputText value="#{columns.width}" onchange="submit();">
</h:inputText>
+ <h:outputText value="first:"></h:outputText>
+ <h:inputText value="#{columns.first}" onchange="submit();">
+ </h:inputText>
+
<h:outputText value="sortable"></h:outputText>
<h:selectBooleanCheckbox value="#{columns.sortable}" onchange="submit();">
</h:selectBooleanCheckbox>
Modified: trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-03-19 17:09:28 UTC (rev 6969)
+++ trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-03-19 17:16:27 UTC (rev 6970)
@@ -13,7 +13,8 @@
listHeight="#{fileUpload.listHeight}"
listWidth="#{fileUpload.listWidth}"
maxFilesQuantity="#{fileUpload.maxFilesQuantity}"
- fileUploadListener="#{fileUpload.fileUploadListener}">
+ fileUploadListener="#{fileUpload.fileUploadListener}"
+ cleanButtonClass="style" onuploadcanceled="alert('hi')">
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
</f:facet>
Modified: trunk/test-applications/jsp/src/main/webapp/TabPanel/TabPanelProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/TabPanel/TabPanelProperty.jsp 2008-03-19 17:09:28 UTC (rev 6969)
+++ trunk/test-applications/jsp/src/main/webapp/TabPanel/TabPanelProperty.jsp 2008-03-19 17:16:27 UTC (rev 6970)
@@ -44,7 +44,7 @@
<h:selectOneRadio value="#{tabPanel.selectedTab}" onchange="submit();">
<f:selectItem itemLabel="1" itemValue="tabOne" />
<f:selectItem itemLabel="2" itemValue="tabTwo" />
- <f:selectItem itemLabel="3" itemValue="tabThr" />
+ <f:selectItem itemLabel="3" itemValue="tabThree" />
</h:selectOneRadio>
<h:outputText value="immediate" />
16 years, 10 months
JBoss Rich Faces SVN: r6969 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-03-19 13:09:28 -0400 (Wed, 19 Mar 2008)
New Revision: 6969
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
Log:
RF-1877
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2008-03-19 17:06:09 UTC (rev 6968)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2008-03-19 17:09:28 UTC (rev 6969)
@@ -213,11 +213,11 @@
this.restoreState();
this.setListeners();
this.eventKeyPress = this.processKeyDown.bindAsEventListener(this);
- Event.observe(document, "keypress", this.eventKeyPress);
+ Event.observe(document, "keydown", this.eventKeyPress);
A4J.AJAX.AddListener({
onafterajax: function(req, event, data) {
if(!$(this.prefix + ":n")) {
- Event.stopObserving(document, "keypress", this.eventKeyPress);
+ Event.stopObserving(document, "keydown", this.eventKeyPress);
}
}.bind(this)
});
16 years, 10 months