JBoss Rich Faces SVN: r3517 - in branches/3.1.x: framework/impl/src/main/java/org/ajax4jsf/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 15:40:02 -0400 (Wed, 24 Oct 2007)
New Revision: 3517
Modified:
branches/3.1.x/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-980
Modified: branches/3.1.x/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-10-24 19:14:03 UTC (rev 3516)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-10-24 19:40:02 UTC (rev 3517)
@@ -76,12 +76,8 @@
return ((StackEntry) stackEntries.getLast()).model;
}
- return null;
- //FIXME: Maksim: Handle deleted entries correctly
-/*
throw new IllegalStateException(
"No tree element available or row key not set!");
-*/
}
public boolean isEmpty() {
@@ -226,12 +222,9 @@
if (isRowAvailable()) {
return null;
}
- return null;
- //FIXME: Maksim: Handle deleted entries correctly
-/*
+
throw new IllegalStateException(
"No tree element available or row key not set!");
-*/
}
/*
@@ -252,12 +245,9 @@
return true;
}
- return true;
- //FIXME: Maksim: Handle deleted entries correctly
-/*
+
throw new IllegalStateException(
"No tree element available or row key not set!");
-*/
}
protected StackingTreeModel getRoot() {
@@ -491,12 +481,8 @@
return lastEntry.model.rowData;
}
- return null;
- //FIXME: Maksim: Handle deleted entries correctly
- /*
throw new IllegalStateException(
"No tree element available or row key not set!");
- */
}
/*
Modified: branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2007-10-24 19:14:03 UTC (rev 3516)
+++ branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2007-10-24 19:40:02 UTC (rev 3517)
@@ -259,22 +259,35 @@
public void setRowIndex(int index) {
FacesContext faces = FacesContext.getCurrentInstance();
ExtendedDataModel localModel = getExtendedDataModel();
+
+ boolean rowAvailable = isRowAvailable();
+
// if(key == localModel.getRowIndex()){
// return;
// }
- // save child state
- this.saveChildState(faces);
+
+ if (rowAvailable) {
+ // save child state
+ this.saveChildState(faces);
+ }
+
// Set current model row by int, but immediately get value from model.
// for compability, complex models must provide values map between
// integer and key value.
localModel.setRowIndex(index);
+ rowAvailable = isRowAvailable();
+
this._rowKey = localModel.getRowKey();
this._clientId = null;
- boolean rowSelected = this._rowKey != null;
+
+ boolean rowSelected = this._rowKey != null && rowAvailable;
setupVariable(faces, localModel, rowSelected);
- // restore child state
- this.restoreChildState(faces);
+
+ if (rowAvailable) {
+ // restore child state
+ this.restoreChildState(faces);
+ }
}
/*
@@ -312,18 +325,29 @@
*/
public void setRowKey(FacesContext faces, Object key) {
ExtendedDataModel localModel = getExtendedDataModel();
- // save child state
- this.saveChildState(faces);
+
+ boolean rowAvailable = isRowAvailable();
+
+ if (rowAvailable) {
+ // save child state
+ this.saveChildState(faces);
+ }
+
this._rowKey = key;
this._clientId = null;
+
localModel.setRowKey(key);
+ rowAvailable = isRowAvailable();
- boolean rowSelected = key != null;
+ boolean rowSelected = key != null && rowAvailable;
+ //XXX check for row availability
setupVariable(faces, localModel, rowSelected);
- // restore child state
- this.restoreChildState(faces);
-
+
+ if (rowAvailable) {
+ // restore child state
+ this.restoreChildState(faces);
+ }
}
/*
@@ -485,6 +509,8 @@
* component state will be put into request scope attributes with names
* given by "var" and "varState" bean properties.
*
+ * Changed: does not check for row availability now
+ *
* @param faces
* current faces context
* @param localModel
@@ -493,7 +519,7 @@
protected void setupVariable(FacesContext faces, DataModel localModel,
boolean rowSelected) {
Map attrs = faces.getExternalContext().getRequestMap();
- if (rowSelected && isRowAvailable()) {
+ if (rowSelected/*&& isRowAvailable()*/) {
// Current row data.
setupVariable(getVar(), attrs, localModel.getRowData());
// Component state variable.
Modified: branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-10-24 19:14:03 UTC (rev 3516)
+++ branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-10-24 19:40:02 UTC (rev 3517)
@@ -22,10 +22,10 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -34,6 +34,7 @@
import javax.faces.FacesException;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.el.MethodBinding;
@@ -50,7 +51,6 @@
import org.richfaces.component.state.TreeState;
import org.richfaces.component.state.TreeStateAdvisor;
import org.richfaces.model.LastElementAware;
-import org.richfaces.model.ListRowKey;
import org.richfaces.model.TreeRange;
import org.richfaces.model.TreeRowKey;
@@ -367,28 +367,6 @@
NSUtils.writeNameSpace(context, component);
}
-
- private TreeRowKey parentRowKey(TreeRowKey key) {
- //If depth is > 1, return parent row key
- int depth = key.depth();
- TreeRowKey rowKey = key;
-
- if (depth > 1) {
- List keyComps = new ArrayList(depth);
-
- for(Iterator iter = key.iterator(); iter.hasNext(); ) {
- Object next = iter.next();
- if (iter.hasNext()) {
- keyComps.add(next);
- }
- }
-
- rowKey = new ListRowKey(keyComps);
- }
-
- return rowKey;
- }
-
public void encodeAjaxChildren(FacesContext context, UIComponent component,
String path, Set ids, Set renderedAreas) throws IOException {
super.encodeAjaxChildren(context, component, path, ids, renderedAreas);
@@ -416,30 +394,14 @@
try {
Set ajaxKeys = tree.getAllAjaxKeys();
-
if (ajaxKeys != null) {
- Set aKeys = new HashSet();
-
- for(Iterator it = ajaxKeys.iterator(); it.hasNext(); ) {
- TreeRowKey treeRowKey = (TreeRowKey) it.next();
- treeRowKey = parentRowKey(treeRowKey);
-
- if (treeRowKey.depth() > 0) {
- aKeys.add(treeRowKey);
- }
- }
- ajaxKeys = aKeys;
- }
-
-
- if (ajaxKeys != null) {
List sortedKeys = new ArrayList(ajaxKeys.size());
sortedKeys.addAll(ajaxKeys);
Collections.sort(sortedKeys, treeRowKeyComparator);
Iterator ajaxKeysItr = sortedKeys.iterator();
TreeRowKey lastKey = null;
boolean nullRoot = false;
-
+
while (!nullRoot && ajaxKeysItr.hasNext()) {
TreeRowKey key = (TreeRowKey) ajaxKeysItr.next();
@@ -459,48 +421,35 @@
key = null;
}
-
-
-
tree.setRowKey(context, key);
-
- if (key != null) {
- int d = key.depth();
- List components = new ArrayList(d);
-
- for(Iterator iter = key.iterator(); iter.hasNext(); components.add(iter.next()));
-
- while(!tree.isRowAvailable()) {
-
- key = new ListRowKey(components.subList(0, d--));
-
- tree.setRowKey(context, key);
+
+ if (tree.isRowAvailable()) {
+ String treeClientId;
+ if (key == null) {
+ treeClientId = tree.getClientId(context);
+ } else {
+ treeClientId = tree.getNodeFacet().getClientId(context);
}
- }
-
-
- //key.getPath().
-
- //TODO: In case of deleted entry, try to update its parent
- //ey.getSubPathIterator(fromIndex)
-
-
- String treeClientId;
- if (key == null) {
- treeClientId = tree.getClientId(context);
- } else {
- treeClientId = tree.getNodeFacet().getClientId(context);
- }
- String treeChildrenId = treeClientId + NamingContainer.SEPARATOR_CHAR + "childs";
-
- writeContent(context, tree, key);
- encodeScripts = true;
- renderedAreas.add(treeClientId);
- encodedAreaIds.add(treeClientId);
+ String treeChildrenId = treeClientId + NamingContainer.SEPARATOR_CHAR + "childs";
+
+ writeContent(context, tree, key);
+ encodeScripts = true;
+ renderedAreas.add(treeClientId);
+ encodedAreaIds.add(treeClientId);
- renderedAreas.add(treeChildrenId);
- //encodedAreaIds.add(id+":childs");
+ renderedAreas.add(treeChildrenId);
+ //encodedAreaIds.add(id+":childs");
+ } else {
+ String cid = tree.getClientId(context);
+ String message = MessageFormat.format(
+ "Failed to re-render tree node: {0} due to model data unavailability! " +
+ "Maybe parent node should be re-rendered instead?",
+ new Object[] { cid });
+
+ ExternalContext externalContext = context.getExternalContext();
+ externalContext.log(message);
+ }
}
//ajaxKeys.clear();
}
17 years
JBoss Rich Faces SVN: r3515 - trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-10-24 15:10:19 -0400 (Wed, 24 Oct 2007)
New Revision: 3515
Modified:
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
Log:
http://jira.jboss.com/jira/browse/RF-1236
Modified: trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
===================================================================
--- trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-10-24 18:18:22 UTC (rev 3514)
+++ trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-10-24 19:10:19 UTC (rev 3515)
@@ -13,6 +13,7 @@
</u:style>
<u:style name="background-color" skin="tableBackgroundColor" /> <!--tableBackgroundColor-->
<!-- <u:style name="border-collapse" value="inherit" /> fix RF-535 -->
+ <u:style name="empty-cells" value="show" />
</u:selector>
<u:selector name=".dr-table-cell" >
17 years
JBoss Rich Faces SVN: r3514 - management.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:18:22 -0400 (Wed, 24 Oct 2007)
New Revision: 3514
Added:
management/design/
Removed:
management/RichFaces 3.1.3-3.2.0.mpp
Log:
design folder added
Relocated RichFaces 3.1.3-3.2.0.mpp removed
Deleted: management/RichFaces 3.1.3-3.2.0.mpp
===================================================================
(Binary files differ)
17 years
JBoss Rich Faces SVN: r3513 - in management: planning and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:17:27 -0400 (Wed, 24 Oct 2007)
New Revision: 3513
Added:
management/planning/
management/planning/RichFaces 3.1.3-3.2.0.mpp
Log:
Plan moved to planning
Copied: management/planning/RichFaces 3.1.3-3.2.0.mpp (from rev 3512, management/RichFaces 3.1.3-3.2.0.mpp)
===================================================================
(Binary files differ)
17 years
JBoss Rich Faces SVN: r3512 - management and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:14:15 -0400 (Wed, 24 Oct 2007)
New Revision: 3512
Added:
management/
management/RichFaces 3.1.3-3.2.0.mpp
Log:
management folder added
Added: management/RichFaces 3.1.3-3.2.0.mpp
===================================================================
(Binary files differ)
Property changes on: management/RichFaces 3.1.3-3.2.0.mpp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years
JBoss Rich Faces SVN: r3511 - /.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:13:38 -0400 (Wed, 24 Oct 2007)
New Revision: 3511
Removed:
planning/
Log:
Removed file/folder
17 years
JBoss Rich Faces SVN: r3510 - planning.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:04:31 -0400 (Wed, 24 Oct 2007)
New Revision: 3510
Added:
planning/RichFaces 3.1.3-3.2.0.mpp
Log:
Project plan added
Added: planning/RichFaces 3.1.3-3.2.0.mpp
===================================================================
(Binary files differ)
Property changes on: planning/RichFaces 3.1.3-3.2.0.mpp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years
JBoss Rich Faces SVN: r3509 - /.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-24 14:01:04 -0400 (Wed, 24 Oct 2007)
New Revision: 3509
Added:
planning/
Log:
17 years
JBoss Rich Faces SVN: r3508 - branches/3.1.x/test-applications/facelets/src/main/webapp/DradAndDrop.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-10-24 13:21:37 -0400 (Wed, 24 Oct 2007)
New Revision: 3508
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/DradAndDrop/DragAndDrop.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1148
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/DradAndDrop/DragAndDrop.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/DradAndDrop/DragAndDrop.xhtml 2007-10-24 15:44:48 UTC (rev 3507)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/DradAndDrop/DragAndDrop.xhtml 2007-10-24 17:21:37 UTC (rev 3508)
@@ -74,7 +74,7 @@
<h:panelGrid styleClass="dropzoneDecoration" id="grid1">
<f:verbatim>Accepts file and folder... Customizes</f:verbatim>
<rich:dropSupport id="zone1"
- ondrop="var zone = $('form:grid1'); zone.style.borderColor= 'red'; setTimeout( function() { this.style.borderColor= 'navy'; }.bind(zone), 300);"
+ ondrop="var zone = $('DtadAndDropSubviewID:form:grid1'); zone.style.borderColor= 'red'; setTimeout( function() { this.style.borderColor= 'navy'; }.bind(zone), 300);"
acceptedTypes="file, folder" typeMapping="{file: testDrop}">
<rich:dndParam name="testDrop">
<h:graphicImage height="16" width="16"
17 years
JBoss Rich Faces SVN: r3507 - in trunk/cdk/generator/src/main: resources/META-INF/templates12 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-24 11:44:48 -0400 (Wed, 24 Oct 2007)
New Revision: 3507
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ListenerBean.java
trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
Log:
correct output of listener tags
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-24 15:42:43 UTC (rev 3506)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-24 15:44:48 UTC (rev 3507)
@@ -416,6 +416,7 @@
try {
Class<?> listenerClass = Class.forName(listener
.getComponentclass(), false, getLoader());
+
for (ComponentBean bean : getComponents()) {
if (bean.getSuperclass() != null) {
Class<?> componentSClass = Class.forName(bean
@@ -468,6 +469,8 @@
} catch (ClassNotFoundException e) {
throw new BuildException(e);
}
+
+ listener.checkProperties();
}
for (Iterator iter = this.getComponents().iterator(); iter.hasNext();) {
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ListenerBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ListenerBean.java 2007-10-24 15:42:43 UTC (rev 3506)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ListenerBean.java 2007-10-24 15:44:48 UTC (rev 3507)
@@ -29,7 +29,7 @@
* created 03.12.2006
*
*/
-public class ListenerBean extends ComponentBean {
+public class ListenerBean extends ComponentBaseBean {
private String listenerclass;
private String componentclass;
private String eventclass;
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-24 15:42:43 UTC (rev 3506)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-24 15:44:48 UTC (rev 3507)
@@ -39,7 +39,7 @@
<tag>
#if(${source.tag.description})
<description>${source.tag.xmlEncodedDescription}</description>
- #else
+ #elseif(${source.description})
<description>${source.xmlEncodedDescription}</description>
#end
#if(${source.tag.displayname})
@@ -47,7 +47,11 @@
#elseif(${source.displayname})
<display-name>${source.xmlEncodedDisplayname}</display-name>
#end
- <name>${source.tag.name}</name>
+ #if(${source.tag.name})
+ <name>${source.tag.name}</name>
+ #else
+ <name>${source.name}</name>
+ #end
<tag-class>${source.tag.classname}</tag-class>
<body-content>${source.tag.bodyContent}</body-content>
17 years