JBoss Rich Faces SVN: r89 - trunk/richfaces/tree/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-03-16 15:26:04 -0400 (Fri, 16 Mar 2007)
New Revision: 89
Added:
trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
Log:
JUnit test for TreeNodeImpl class.
Added: trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeNodeTest.java (rev 0)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeNodeTest.java 2007-03-16 19:26:04 UTC (rev 89)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIViewRoot;
+
+import org.richfaces.component.html.HtmlTree;
+
+import junit.framework.TestCase;
+
+/**
+ * @author hans
+ *
+ */
+public class TreeNodeTest extends TestCase {
+
+ protected TreeNode node = null;
+ protected static final int TEST_CHILDREN_COUNT = 7;
+
+ /**
+ * @param arg0
+ */
+ public TreeNodeTest(String arg0) {
+ super(arg0);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ node = new TreeNodeImpl();
+ }
+
+ public void testChildrenNew() {
+ assertFalse(node.getChildren().hasNext());
+ }
+
+ public void testChildrenCount() {
+ for (int i = 0; i < TEST_CHILDREN_COUNT; i++)
+ node.addChild(new Integer(i), new TreeNodeImpl());
+ Iterator it = node.getChildren();
+ int count = 0;
+ for (; it.hasNext(); it.next())
+ count++;
+ assertEquals(count, TEST_CHILDREN_COUNT);
+ }
+
+ public void testIsLeafNew() {
+ assertTrue(node.isLeaf());
+ }
+
+ public void testIsLeaf() {
+ node.addChild("first", new TreeNodeImpl());
+ assertFalse(node.isLeaf());
+ }
+
+ public void testParent() {
+ TreeNode child = new TreeNodeImpl();
+ node.addChild("first", child);
+ assertEquals(child.getParent(), node);
+ }
+
+ public void testGetChild() {
+ TreeNode firstNode = new TreeNodeImpl();
+ firstNode.setData("First Node");
+ TreeNode secondNode = new TreeNodeImpl();
+ secondNode.setData("Second Node");
+ node.addChild("first", firstNode);
+ node.addChild("second", secondNode);
+ node.addChild("third", new TreeNodeImpl());
+ assertTrue(node.getChild("second").getData().equals("Second Node"));
+ }
+
+}
17 years, 2 months
JBoss Rich Faces SVN: r88 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-16 15:23:34 -0400 (Fri, 16 Mar 2007)
New Revision: 88
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
Log:
Revision 85 rollbacked as resizing has been broken by that revision
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-16 17:16:46 UTC (rev 87)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-16 19:23:34 UTC (rev 88)
@@ -426,24 +426,19 @@
var vetoes = {};
var cssHash = {};
- var winSize = Richfaces.getWindowSize();
-
var vetoeChange = false;
var newSize = Richfaces.getComputedStyleSize(this.cdiv, "width");
var oldSize = newSize;
- var maxX = winSize.width - oldSize;
newSize += diff.deltaWidth || 0;
if (newSize >= this.minWidth) {
if (diff.deltaWidth) {
cssHash.width = newSize + 'px';
- maxX = winSize.width - newSize;
}
} else {
if (diff.deltaWidth) {
cssHash.width = this.minWidth + 'px';
- maxX = this.minWidth;
vetoes.vx = oldSize - this.minWidth;
}
@@ -463,24 +458,18 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpLeft || 0;
newPos += diff.deltaX;
- if (newPos<0) newPos = 0;
- if (newPos>maxX) newPos = maxX;
this.cdiv.mpLeft = newPos;
//this.iframe.mpLeft = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
newPos += diff.deltaX;
- if (newPos<0) newPos = 0;
- if (newPos>maxX) newPos = maxX;
-
cssHash.left = newPos + 'px';
}
}
var newSize = Richfaces.getComputedStyleSize(this.cdiv, "height");
var oldSize = newSize;
- var maxY = winSize.height - oldSize;
newSize += diff.deltaHeight || 0;
if (newSize >= this.minHeight) {
@@ -510,17 +499,12 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpTop || 0;
newPos += diff.deltaY;
- if (newPos<0) newPos = 0;
- if (newPos>maxY) newPos = maxY;
this.cdiv.mpTop = newPos;
//this.iframe.mpTop = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
newPos += diff.deltaY;
- if (newPos<0) newPos = 0;
- if (newPos>maxY) newPos = maxY;
-
cssHash.top = newPos + 'px';
}
}
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-16 17:16:46 UTC (rev 87)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-16 19:23:34 UTC (rev 88)
@@ -28,9 +28,6 @@
this.dragX = event.clientX;
this.dragY = event.clientY;
- this.startX = event.clientX-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "left");
- this.startY = event.clientY-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "top");
-
Event.observe(document, 'mousemove', this.boundDoDrag);
Event.observe(document, 'mouseup', this.boundEndDrag);
@@ -51,27 +48,6 @@
var dx = evtX - this.dragX;
var dy = evtY - this.dragY;
- var delX = evtX-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "left");
- if (dx>0) {
- if (delX<this.startX) {
- dx = Math.max(delX+dx-this.startX,0);
- }
- } else {
- if (delX>this.startX) {
- dx = Math.min(delX+dx-this.startX,0);
- }
- }
- var delY = evtY-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "top");
- if (dy>0) {
- if (delY<this.startY) {
- dy = Math.max(delY+dy-this.startY,0);
- }
- } else {
- if (delY>this.startY) {
- dy = Math.min(delY+dy-this.startY,0);
- }
- }
-
if (dx != 0 || dy != 0) {
var diff = this.sizer.doDiff(dx, dy);
var vetoes = this.modalPanel.doResizeOrMove(diff);
17 years, 2 months
JBoss Rich Faces SVN: r87 - in trunk: richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-16 13:16:46 -0400 (Fri, 16 Mar 2007)
New Revision: 87
Modified:
trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
Log:
DnD fixes and improvements:
- Fixed http://jira.jboss.com/jira/browse/RF-3
- Drag by dragSupport is started by the first mousemove event, not mousedown
- Slight bug fixes for DnD in tree
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-03-16 15:17:50 UTC (rev 86)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-03-16 17:16:46 UTC (rev 87)
@@ -4,6 +4,12 @@
*/
DnD.Draggable = function() {};
+DnD.ieReleaseCapture = function() {
+ if (document.releaseCapture) {
+ document.releaseCapture();
+ }
+};
+
DnD.Draggable.prototype = {
getElement: function() {
@@ -100,11 +106,19 @@
}
// cancel out any text selections
- document.body.focus();
+ //document.body.focus();
// prevent text selection in IE
this.onSelectStartHandler = document.onselectstart;
+ this.onDragStartHandler = document.ondragstart;
+
document.onselectstart = function () { return false; };
+ document.ondragstart = function () { DnD.ieReleaseCapture(); return false; };
+
+ if (document.releaseCapture) {
+ Event.observe(document, "mousemove", DnD.ieReleaseCapture);
+ }
+
},
/**
*
@@ -112,7 +126,12 @@
*/
endDrag: function(event, drag) {
document.onselectstart = this.onSelectStartHandler;
+ document.ondragstart = this.onDragStartHandler;
+ if (document.releaseCapture) {
+ Event.stopObserving(document, "mousemove", DnD.ieReleaseCapture);
+ }
+
var indicator = drag.indicator;
if (indicator) {
indicator.hide();
Modified: trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
--- trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-03-16 15:17:50 UTC (rev 86)
+++ trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-03-16 17:16:46 UTC (rev 87)
@@ -16,6 +16,9 @@
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
+ this.listenDragBound = this.listenDrag.bindAsEventListener(this);
+ this.stopListenDragBound = this.stopListenDrag.bindAsEventListener(this);
+
Event.observe(this.id, "mousedown", this.eventMouseDown);
},
@@ -50,10 +53,31 @@
//this.dragEnter(event);
},
+ ondragend : function(event, drag) {
+ this.dragStarted = false;
+ },
+
getContentType: function() {
return this.options.dragType;
},
+ listenDrag: function(e) {
+ if (!this.dragStarted) {
+ this.startDrag(e);
+
+ Event.stopObserving(this.id, "mousemove", this.listenDragBound);
+ Event.stopObserving(this.id, "mouseup", this.stopListenDragBound);
+ this.dragStarted = true;
+ }
+ },
+
+ stopListenDrag: function(e) {
+ this.dragStarted = false;
+
+ Event.stopObserving(this.id, "mousemove", this.listenDragBound);
+ Event.stopObserving(this.id, "mouseup", this.stopListenDragBound);
+ },
+
initDrag: function(event) {
if(Event.isLeftClick(event)) {
var src = Event.element(event);
@@ -64,7 +88,10 @@
src.tagName=='BUTTON' ||
src.tagName=='TEXTAREA')) return;
- this.startDrag(event);
+ Event.stop(event);
+
+ Event.observe(this.id, "mousemove", this.listenDragBound);
+ Event.observe(this.id, "mouseup", this.stopListenDragBound);
}
}
});
\ No newline at end of file
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2007-03-16 15:17:50 UTC (rev 86)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2007-03-16 17:16:46 UTC (rev 87)
@@ -100,6 +100,10 @@
this.dragEnter(event);
},
+ ondragend : function(event, drag) {
+ this.dragStarted = false;
+ },
+
getDraggableOptions: function() {
var attr = this.elements.icon.attributes["rich:draggableoptions"];
if (attr) {
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-16 15:17:50 UTC (rev 86)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-16 17:16:46 UTC (rev 87)
@@ -204,6 +204,8 @@
src.tagName=='BUTTON' ||
src.tagName=='TEXTAREA')) return;
+ Event.stop(e);
+
Event.observe(this.elements.icon, "mousemove", this.listenDragBound);
Event.observe(this.elements.text, "mousemove", this.listenDragBound);
@@ -255,6 +257,12 @@
if (!this.dragStarted) {
this.initDrag(e);
+ Event.stopObserving(this.elements.icon, "mousemove", this.listenDragBound);
+ Event.stopObserving(this.elements.text, "mousemove", this.listenDragBound);
+
+ Event.stopObserving(this.elements.icon, "mouseup", this.stopListenDragBound);
+ Event.stopObserving(this.elements.text, "mouseup", this.stopListenDragBound);
+
this.dragStarted = true;
}
},
Modified: trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-03-16 15:17:50 UTC (rev 86)
+++ trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-03-16 17:16:46 UTC (rev 87)
@@ -3,7 +3,7 @@
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>
-<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/drag-drop" prefix="dnd" %>
+<%@ taglib uri="http://richfaces.ajax4jsf.org/drag-drop" prefix="dnd" %>
<html>
<head>
@@ -189,6 +189,8 @@
<dnd:dndParam name="marker" value="testMarkerValue" />
<dnd:dndParam name="label" value="testDragValue" />
</dnd:dragSupport>
+
+ <h:graphicImage id="dragImage" value="/images/file-manager.png" width="48" />
<f:verbatim>
dragSupport
</f:verbatim>
17 years, 2 months
JBoss Rich Faces SVN: r86 - trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-16 11:17:50 -0400 (Fri, 16 Mar 2007)
New Revision: 86
Modified:
trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
Log:
Empty javax.faces.CONFIG_FILES context param removed because of crashing app on 1.2_04 JSF
Modified: trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2007-03-16 15:17:44 UTC (rev 85)
+++ trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2007-03-16 15:17:50 UTC (rev 86)
@@ -35,10 +35,6 @@
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
- <context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value/>
- </context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
17 years, 2 months
JBoss Rich Faces SVN: r85 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-16 11:17:44 -0400 (Fri, 16 Mar 2007)
New Revision: 85
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
Log:
RFA-247 fixed
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-16 15:08:32 UTC (rev 84)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-16 15:17:44 UTC (rev 85)
@@ -426,19 +426,24 @@
var vetoes = {};
var cssHash = {};
+ var winSize = Richfaces.getWindowSize();
+
var vetoeChange = false;
var newSize = Richfaces.getComputedStyleSize(this.cdiv, "width");
var oldSize = newSize;
+ var maxX = winSize.width - oldSize;
newSize += diff.deltaWidth || 0;
if (newSize >= this.minWidth) {
if (diff.deltaWidth) {
cssHash.width = newSize + 'px';
+ maxX = winSize.width - newSize;
}
} else {
if (diff.deltaWidth) {
cssHash.width = this.minWidth + 'px';
+ maxX = this.minWidth;
vetoes.vx = oldSize - this.minWidth;
}
@@ -458,18 +463,24 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpLeft || 0;
newPos += diff.deltaX;
+ if (newPos<0) newPos = 0;
+ if (newPos>maxX) newPos = maxX;
this.cdiv.mpLeft = newPos;
//this.iframe.mpLeft = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
newPos += diff.deltaX;
+ if (newPos<0) newPos = 0;
+ if (newPos>maxX) newPos = maxX;
+
cssHash.left = newPos + 'px';
}
}
var newSize = Richfaces.getComputedStyleSize(this.cdiv, "height");
var oldSize = newSize;
+ var maxY = winSize.height - oldSize;
newSize += diff.deltaHeight || 0;
if (newSize >= this.minHeight) {
@@ -499,12 +510,17 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpTop || 0;
newPos += diff.deltaY;
+ if (newPos<0) newPos = 0;
+ if (newPos>maxY) newPos = maxY;
this.cdiv.mpTop = newPos;
//this.iframe.mpTop = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
newPos += diff.deltaY;
+ if (newPos<0) newPos = 0;
+ if (newPos>maxY) newPos = maxY;
+
cssHash.top = newPos + 'px';
}
}
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-16 15:08:32 UTC (rev 84)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-16 15:17:44 UTC (rev 85)
@@ -28,6 +28,9 @@
this.dragX = event.clientX;
this.dragY = event.clientY;
+ this.startX = event.clientX-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "left");
+ this.startY = event.clientY-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "top");
+
Event.observe(document, 'mousemove', this.boundDoDrag);
Event.observe(document, 'mouseup', this.boundEndDrag);
@@ -48,6 +51,27 @@
var dx = evtX - this.dragX;
var dy = evtY - this.dragY;
+ var delX = evtX-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "left");
+ if (dx>0) {
+ if (delX<this.startX) {
+ dx = Math.max(delX+dx-this.startX,0);
+ }
+ } else {
+ if (delX>this.startX) {
+ dx = Math.min(delX+dx-this.startX,0);
+ }
+ }
+ var delY = evtY-Richfaces.getComputedStyleSize(this.modalPanel.cdiv, "top");
+ if (dy>0) {
+ if (delY<this.startY) {
+ dy = Math.max(delY+dy-this.startY,0);
+ }
+ } else {
+ if (delY>this.startY) {
+ dy = Math.min(delY+dy-this.startY,0);
+ }
+ }
+
if (dx != 0 || dy != 0) {
var diff = this.sizer.doDiff(dx, dy);
var vetoes = this.modalPanel.doResizeOrMove(diff);
17 years, 2 months
JBoss Rich Faces SVN: r84 - trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-16 11:08:32 -0400 (Fri, 16 Mar 2007)
New Revision: 84
Modified:
trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
Integer.valueOf(int) method call replaced with the analogous call from 1.4 JDK
Modified: trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-03-16 13:38:37 UTC (rev 83)
+++ trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-03-16 15:08:32 UTC (rev 84)
@@ -387,7 +387,7 @@
// for iterate over columns
return columns;
} else if ("columnsCount".equals(key)) {
- return Integer.valueOf(columns.size());
+ return new Integer(columns.size());
} else {
return super.getParameter(key);
}
17 years, 2 months
JBoss Rich Faces SVN: r83 - trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-16 09:38:37 -0400 (Fri, 16 Mar 2007)
New Revision: 83
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
Log:
Bindings for Drag/Drop listeners not created in facelets - fixed
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-03-16 10:26:01 UTC (rev 82)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-03-16 13:38:37 UTC (rev 83)
@@ -44,73 +44,65 @@
super(config);
}
- public static class DragHandler extends AjaxComponentHandler {
+ private static final DragSupportHandlerMetaRule metaRule = new DragSupportHandlerMetaRule();
- private static final DragSupportHandlerMetaRule metaRule = new DragSupportHandlerMetaRule();
+ // Metarule
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(metaRule);
+ return m;
+ }
- public DragHandler(ComponentConfig config) {
- super(config);
- }
+ /**
+ * @author shura (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ *
+ */
+ static class DragSupportHandlerMetaRule extends MetaRule {
- // Metarule
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset m = super.createMetaRuleset(type);
- m.addRule(metaRule);
- return m;
- }
-
- /**
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date$
+ /*
+ * (non-Javadoc)
*
+ * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
+ * com.sun.facelets.tag.TagAttribute,
+ * com.sun.facelets.tag.MetadataTarget)
*/
- static class DragSupportHandlerMetaRule extends MetaRule {
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
- if (meta.isTargetInstanceOf(UIDragSupport.class)) {
- if ("dragListener".equals(name)) {
- return new dragListenerMapper(attribute);
- }
-
+ public Metadata applyRule(String name, TagAttribute attribute,
+ MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(UIDragSupport.class)) {
+ if ("dragListener".equals(name)) {
+ return new dragListenerMapper(attribute);
}
- return null;
- }
+ }
+ return null;
}
- static class dragListenerMapper extends Metadata {
+ }
- private static final Class[] SIGNATURE = new Class[] { org.ajax4jsf.dnd.event.DragEvent.class };
+ static class dragListenerMapper extends Metadata {
- private final TagAttribute _action;
+ private static final Class[] SIGNATURE = new Class[] { org.ajax4jsf.dnd.event.DragEvent.class };
- /**
- * @param attribute
- */
- public dragListenerMapper(TagAttribute attribute) {
- _action = attribute;
- }
+ private final TagAttribute _action;
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
- * java.lang.Object)
- */
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIDragSupport) instance)
- .setDragListener(new LegacyMethodBinding(this._action
- .getMethodExpression(ctx, null, SIGNATURE)));
- }
+ /**
+ * @param attribute
+ */
+ public dragListenerMapper(TagAttribute attribute) {
+ _action = attribute;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
+ * java.lang.Object)
+ */
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIDragSupport) instance)
+ .setDragListener(new LegacyMethodBinding(this._action
+ .getMethodExpression(ctx, null, SIGNATURE)));
}
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-03-16 10:26:01 UTC (rev 82)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-03-16 13:38:37 UTC (rev 83)
@@ -43,73 +43,65 @@
super(config);
}
- public static class DropHandler extends AjaxComponentHandler {
+ private static final DropSupportHandlerMetaRule metaRule = new DropSupportHandlerMetaRule();
- private static final DropSupportHandlerMetaRule metaRule = new DropSupportHandlerMetaRule();
+ // Metarule
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(metaRule);
+ return m;
+ }
- public DropHandler(ComponentConfig config) {
- super(config);
- }
+ /**
+ * @author shura (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ *
+ */
+ static class DropSupportHandlerMetaRule extends MetaRule {
- // Metarule
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset m = super.createMetaRuleset(type);
- m.addRule(metaRule);
- return m;
- }
-
- /**
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date$
+ /*
+ * (non-Javadoc)
*
+ * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
+ * com.sun.facelets.tag.TagAttribute,
+ * com.sun.facelets.tag.MetadataTarget)
*/
- static class DropSupportHandlerMetaRule extends MetaRule {
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
- if (meta.isTargetInstanceOf(UIDropSupport.class)) {
- if ("dropListener".equals(name)) {
- return new dropListenerMapper(attribute);
- }
-
+ public Metadata applyRule(String name, TagAttribute attribute,
+ MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(UIDropSupport.class)) {
+ if ("dropListener".equals(name)) {
+ return new dropListenerMapper(attribute);
}
- return null;
- }
+ }
+ return null;
}
- static class dropListenerMapper extends Metadata {
+ }
- private static final Class[] SIGNATURE = new Class[] { org.ajax4jsf.dnd.event.DropEvent.class };
+ static class dropListenerMapper extends Metadata {
- private final TagAttribute _action;
+ private static final Class[] SIGNATURE = new Class[] { org.ajax4jsf.dnd.event.DropEvent.class };
- /**
- * @param attribute
- */
- public dropListenerMapper(TagAttribute attribute) {
- _action = attribute;
- }
+ private final TagAttribute _action;
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
- * java.lang.Object)
- */
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIDropSupport) instance)
- .setDropListener(new LegacyMethodBinding(this._action
- .getMethodExpression(ctx, null, SIGNATURE)));
- }
+ /**
+ * @param attribute
+ */
+ public dropListenerMapper(TagAttribute attribute) {
+ _action = attribute;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
+ * java.lang.Object)
+ */
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIDropSupport) instance)
+ .setDropListener(new LegacyMethodBinding(this._action
+ .getMethodExpression(ctx, null, SIGNATURE)));
}
}
17 years, 2 months
JBoss Rich Faces SVN: r82 - in trunk/richfaces/datascroller/src/main/java/org/richfaces: renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-03-16 06:26:01 -0400 (Fri, 16 Mar 2007)
New Revision: 82
Modified:
trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
Log:
DataScrollerEvent actioListener method is not invoked
the first time when scrolling occurs - fixed (RF-17)
Modified: trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
===================================================================
--- trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2007-03-15 20:04:25 UTC (rev 81)
+++ trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2007-03-16 10:26:01 UTC (rev 82)
@@ -78,7 +78,8 @@
if (event instanceof DataScrollerEvent){
if(getScrollerListeners().length < 1){
- addScrollerListener(new DataScrollerAdapter(getScrollerListener()));
+ addScrollerListener(new DataScrollerAdapter(getScrollerListener()));
+ event.queue();
}
}
Modified: trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-03-15 20:04:25 UTC (rev 81)
+++ trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-03-16 10:26:01 UTC (rev 82)
@@ -50,9 +50,12 @@
String param = (String) getParamMap(context).get(
component.getClientId(context) + PARAM_SUFFIX);
-
+ UIDatascroller scroller = (UIDatascroller) component;
+ if (scroller.getHandleValue()==null){
+ scroller.setHandleValue("1");
+ }
if (param != null) {
- UIDatascroller scroller = (UIDatascroller) component;
+ //UIDatascroller scroller = (UIDatascroller) component;
scroller.setPage(param);
scroller.getPageIndex();
String oldScrolVal = scroller.getHandleValue();
17 years, 2 months
JBoss Rich Faces SVN: r81 - in trunk: richfaces/dataTable/src/main/java/org/richfaces/renderkit and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-03-15 16:04:25 -0400 (Thu, 15 Mar 2007)
New Revision: 81
Modified:
trunk/richfaces-samples/dataTableDemo/pom.xml
trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Bean.java
trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Data.java
trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/ajax.jsp
trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/index.jsp
trunk/richfaces/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
Log:
Fix issues :
RF-19 - properly handle 'rendered' columns attribute.
FR-14 - re-render iteration components by AJAX
RF-4 - store current row key value in EL-variable.
Fiv versions in data table demo application.
Modified: trunk/richfaces/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/richfaces/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2007-03-15 20:04:25 UTC (rev 81)
@@ -35,14 +35,13 @@
/**
* JSF component class
- *
+ *
*/
public abstract class UIDataTable extends UIRepeat {
-
/**
* @author shura
- *
+ *
*/
private static final class NotColumnPredicate implements Predicate {
public boolean evaluate(Object input) {
@@ -52,7 +51,7 @@
/**
* @author shura
- *
+ *
*/
private static final class ColumnPredicate implements Predicate {
public boolean evaluate(Object input) {
@@ -62,51 +61,70 @@
/**
* @author shura
- *
+ *
*/
private static final class AjaxSupportPredicate implements Predicate {
public boolean evaluate(Object input) {
- return (input instanceof AjaxSupport||input instanceof Dropzone);
+ return (input instanceof AjaxSupport || input instanceof Dropzone);
}
}
-
public static final Predicate isColumn = new ColumnPredicate();
public static final Predicate isNotColumn = new NotColumnPredicate();
public static final Predicate isAjaxSupport = new AjaxSupportPredicate();
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
public Iterator dataChildren() {
- IteratorChain dataChildren = new IteratorChain(columns());
- dataChildren.addIterator(new FilterIterator(getFacets().values().iterator(),isAjaxSupport));
+ IteratorChain dataChildren = new IteratorChain();
+ dataChildren.addIterator(new FilterIterator(getFacets().values()
+ .iterator(), isAjaxSupport));
+ // Append all columns children.
+ for (Iterator iter = columns(); iter.hasNext();) {
+ UIComponent column = (UIComponent) iter.next();
+ if (column.isRendered()) {
+ dataChildren.addIterator(column.getChildren()
+ .iterator());
+
+ }
+ }
return dataChildren;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
public Iterator fixedChildren() {
// Iterate over facets, non-column childrens and column's facets.
- IteratorChain fixedChildren = new IteratorChain(getFacets().values().iterator());
- fixedChildren.addIterator(new FilterIterator(getChildren().iterator(),isNotColumn ));
+ IteratorChain fixedChildren = new IteratorChain(getFacets().values()
+ .iterator());
+ fixedChildren.addIterator(new FilterIterator(getChildren().iterator(),
+ isNotColumn));
// Append all columns facets.
for (Iterator iter = columns(); iter.hasNext();) {
UIComponent column = (UIComponent) iter.next();
- fixedChildren.addIterator(column.getFacets().values().iterator());
+ if (column.isRendered()) {
+ fixedChildren.addIterator(column.getFacets().values()
+ .iterator());
+
+ }
}
return fixedChildren;
}
-
- public Iterator columns(){
- return new FilterIterator(getChildren().iterator(),isColumn);
+
+ public Iterator columns() {
+ return new FilterIterator(getChildren().iterator(), isColumn);
}
private static final String COMPONENT_TYPE = "org.richfaces.DataTable";
-
+
private static final String COMPONENT_FAMILY = "org.richfaces.DataTable";
-
+
}
Modified: trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2007-03-15 20:04:25 UTC (rev 81)
@@ -43,24 +43,28 @@
public abstract class AbstractTableRenderer extends AbstractRowsRenderer {
/**
- * Encode all table structure - colgroups definitions, caption, header, footer
+ * Encode all table structure - colgroups definitions, caption, header,
+ * footer
+ *
* @param context
* @param table
* @throws IOException
*/
- public void encodeTableStructure(FacesContext context, UIDataTable table) throws IOException {
+ public void encodeTableStructure(FacesContext context, UIDataTable table)
+ throws IOException {
ResponseWriter writer = context.getResponseWriter();
int columns = getColumnsCount(table);
// Encode colgroup definition.
writer.startElement("colgroup", table);
writer.writeAttribute("span", String.valueOf(columns), null);
- String columnsWidth = (String)table.getAttributes().get("columnsWidth");
- if(null!=columnsWidth){
+ String columnsWidth = (String) table.getAttributes()
+ .get("columnsWidth");
+ if (null != columnsWidth) {
String[] widths = columnsWidth.split(",");
for (int i = 0; i < widths.length; i++) {
writer.startElement("col", table);
writer.writeAttribute("width", widths[i], null);
- writer.endElement("col");
+ writer.endElement("col");
}
}
writer.endElement("colgroup");
@@ -68,10 +72,9 @@
encodeHeader(context, table, columns);
encodeFooter(context, table, columns);
}
-
-
- public void encodeHeader(FacesContext context, UIDataTable table, int columns)
- throws IOException {
+
+ public void encodeHeader(FacesContext context, UIDataTable table,
+ int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent header = table.getHeader();
Iterator headers = columnFacets(table, "header");
@@ -80,27 +83,38 @@
String headerClass = (String) table.getAttributes().get(
"headerClass");
if (header != null) {
- encodeTableHeaderFacet(context, columns, writer, header, "dr-table-header rich-table-header","dr-table-header-continue rich-table-header-continue", "dr-table-headercell rich-table-headercell", headerClass, "td");
+ encodeTableHeaderFacet(context, columns, writer, header,
+ "dr-table-header rich-table-header",
+ "dr-table-header-continue rich-table-header-continue",
+ "dr-table-headercell rich-table-headercell",
+ headerClass, "td");
}
if (headers.hasNext()) {
writer.startElement("tr", table);
- encodeStyleClass(writer, null, "dr-table-subheader rich-table-subheader", null, headerClass);
- encodeHeaderFacets(context, writer, headers, "dr-table-subheadercell rich-table-subheadercell",headerClass,"header", "td");
+ encodeStyleClass(writer, null,
+ "dr-table-subheader rich-table-subheader", null,
+ headerClass);
+ encodeHeaderFacets(context, writer, headers,
+ "dr-table-subheadercell rich-table-subheadercell",
+ headerClass, "header", "td");
writer.endElement("tr");
}
writer.endElement("thead");
}
}
-
- protected void encodeHeaderFacets(FacesContext context, ResponseWriter writer, Iterator headers, String skinCellClass,String headerClass, String facetName, String element) throws IOException {
+ protected void encodeHeaderFacets(FacesContext context,
+ ResponseWriter writer, Iterator headers, String skinCellClass,
+ String headerClass, String facetName, String element)
+ throws IOException {
while (headers.hasNext()) {
UIComponent column = (UIComponent) headers.next();
- String classAttribute = facetName+"Class";
- String columnHeaderClass = (String) column.getAttributes()
- .get(classAttribute);
+ String classAttribute = facetName + "Class";
+ String columnHeaderClass = (String) column.getAttributes().get(
+ classAttribute);
writer.startElement(element, column);
- encodeStyleClass(writer, null, skinCellClass, headerClass, columnHeaderClass);
+ encodeStyleClass(writer, null, skinCellClass, headerClass,
+ columnHeaderClass);
writer.writeAttribute("scope", "col", null);
getUtils().encodeAttribute(context, column, "colspan");
UIComponent facet = column.getFacet(facetName);
@@ -111,8 +125,8 @@
}
}
- public void encodeFooter(FacesContext context, UIDataTable table, int columns)
- throws IOException {
+ public void encodeFooter(FacesContext context, UIDataTable table,
+ int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent footer = table.getFooter();
Iterator footers = columnFacets(table, "footer");
@@ -122,19 +136,26 @@
"footerClass");
if (footers.hasNext()) {
writer.startElement("tr", table);
- encodeStyleClass(writer, null, "dr-table-subfooter rich-table-subfooter", null, footerClass);
- encodeHeaderFacets(context, writer, footers, "dr-table-subfootercell rich-table-subfootercell",footerClass,"footer", "td");
+ encodeStyleClass(writer, null,
+ "dr-table-subfooter rich-table-subfooter", null,
+ footerClass);
+ encodeHeaderFacets(context, writer, footers,
+ "dr-table-subfootercell rich-table-subfootercell",
+ footerClass, "footer", "td");
writer.endElement("tr");
}
if (footer != null) {
- encodeTableHeaderFacet(context, columns, writer, footer, "dr-table-footer rich-table-footer","dr-table-footer-continue rich-table-footer-continue", "dr-table-footercell rich-table-footercell", footerClass, "td");
+ encodeTableHeaderFacet(context, columns, writer, footer,
+ "dr-table-footer rich-table-footer",
+ "dr-table-footer-continue rich-table-footer-continue",
+ "dr-table-footercell rich-table-footercell",
+ footerClass, "td");
}
writer.endElement("tfoot");
}
}
-
public void encodeOneRow(FacesContext context, TableHolder holder)
throws IOException {
UIDataTable table = (UIDataTable) holder.getTable();
@@ -148,7 +169,8 @@
// Start new row for first column - expect a case of the detail
// table, wich will be insert own row.
if (first && !(column instanceof Row)) {
- encodeRowStart(context,getFirstRowSkinClass() ,holder.getRowClass(), table, writer);
+ encodeRowStart(context, getFirstRowSkinClass(), holder
+ .getRowClass(), table, writer);
}
if (column instanceof Column) {
boolean breakBefore = ((Column) column).isBreakBefore()
@@ -162,24 +184,30 @@
// will be insert own row.
if (!(column instanceof Row)) {
holder.nextRow();
- encodeRowStart(context, holder.getRowClass(), table, writer);
+ encodeRowStart(context, holder.getRowClass(), table,
+ writer);
}
}
- encodeCellChildren(context, column,first?getFirstRowSkinClass():null,getRowSkinClass(), holder.getRowClass(), getCellSkinClass(), holder.getColumnClass(currentColumn));
-// renderChild(context, column);
+ encodeCellChildren(context, column,
+ first ? getFirstRowSkinClass() : null,
+ getRowSkinClass(), holder.getRowClass(),
+ getCellSkinClass(), holder
+ .getColumnClass(currentColumn));
+ // renderChild(context, column);
if ((column instanceof Row) && iter.hasNext()) {
// Start new row for remained columns.
- holder.nextRow();
- encodeRowStart(context, holder.getRowClass(), table, writer);
- // reset columns counter.
- currentColumn = -1;
+ holder.nextRow();
+ encodeRowStart(context, holder.getRowClass(), table, writer);
+ // reset columns counter.
+ currentColumn = -1;
}
- } else {
+ } else if (column.isRendered()) {
// UIColumn don't have own renderer
writer.startElement(HTML.td_ELEM, table);
getUtils().encodeId(context, column);
String columnClass = holder.getColumnClass(currentColumn);
- encodeStyleClass(writer, null, getCellSkinClass(), null, columnClass);
+ encodeStyleClass(writer, null, getCellSkinClass(), null,
+ columnClass);
// TODO - encode column attributes.
renderChildren(context, column);
writer.endElement(HTML.td_ELEM);
@@ -197,7 +225,7 @@
UIDataTable table, ResponseWriter writer) throws IOException {
encodeRowStart(context, getRowSkinClass(), rowClass, table, writer);
}
-
+
/**
* @return
*/
@@ -211,6 +239,7 @@
protected String getFirstRowSkinClass() {
return "dr-table-firstrow rich-table-firstrow";
}
+
/**
* @return
*/
@@ -218,9 +247,9 @@
return "dr-table-cell rich-table-cell";
}
-
- protected void encodeRowStart(FacesContext context,String skinClass, String rowClass,
- UIDataTable table, ResponseWriter writer) throws IOException {
+ protected void encodeRowStart(FacesContext context, String skinClass,
+ String rowClass, UIDataTable table, ResponseWriter writer)
+ throws IOException {
writer.startElement(HTML.TR_ELEMENT, table);
encodeStyleClass(writer, null, skinClass, null, rowClass);
encodeRowEvents(context, table);
@@ -230,8 +259,10 @@
return new FilterIterator(table.columns(), new Predicate() {
public boolean evaluate(Object input) {
+ UIComponent component = (UIComponent) input;
// accept only components with requested facet.
- return ((UIComponent) input).getFacet(name) != null;
+ return component.isRendered()
+ && component.getFacet(name) != null;
}
});
@@ -259,8 +290,11 @@
}
/**
- * Calculate max number of columns per row. For rows, recursive calculate max length.
- * @param col - Iterator other all columns in table.
+ * Calculate max number of columns per row. For rows, recursive calculate
+ * max length.
+ *
+ * @param col -
+ * Iterator other all columns in table.
* @return
*/
protected int calculateRowColumns(Iterator col) {
@@ -268,38 +302,43 @@
int currentLength = 0;
while (col.hasNext()) {
UIComponent column = (UIComponent) col.next();
- if (column instanceof Row) {
- // Store max calculated value of previsous rows.
- if (currentLength > count) {
- count = currentLength;
- }
- // Calculate number of columns in row.
- currentLength = calculateRowColumns(((Row) column).columns());
- // Store max calculated value
- if (currentLength > count) {
- count = currentLength;
- }
- currentLength = 0;
- } else if (column instanceof Column) {
- Column tableColumn = (Column) column;
- // For new row, save length of previsous.
- if (tableColumn.isBreakBefore()) {
+ if (column.isRendered()) {
+ if (column instanceof Row) {
+ // Store max calculated value of previsous rows.
if (currentLength > count) {
count = currentLength;
}
+ // Calculate number of columns in row.
+ currentLength = calculateRowColumns(((Row) column)
+ .columns());
+ // Store max calculated value
+ if (currentLength > count) {
+ count = currentLength;
+ }
currentLength = 0;
- }
- Integer colspan = (Integer) column.getAttributes().get(
- "colspan");
- // Append colspan of this column
- if (null != colspan && colspan.intValue() != Integer.MIN_VALUE) {
- currentLength += colspan.intValue();
- } else {
+ } else if (column instanceof Column) {
+ Column tableColumn = (Column) column;
+ // For new row, save length of previsous.
+ if (tableColumn.isBreakBefore()) {
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ }
+ Integer colspan = (Integer) column.getAttributes().get(
+ "colspan");
+ // Append colspan of this column
+ if (null != colspan
+ && colspan.intValue() != Integer.MIN_VALUE) {
+ currentLength += colspan.intValue();
+ } else {
+ currentLength++;
+ }
+ } else if (column instanceof UIColumn) {
+ // UIColumn always have colspan == 1.
currentLength++;
}
- } else if (column instanceof UIColumn) {
- // UIColumn always have colspan == 1.
- currentLength++;
+
}
}
if (currentLength > count) {
Modified: trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
===================================================================
--- trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2007-03-15 20:04:25 UTC (rev 81)
@@ -39,14 +39,18 @@
* @author shura
*
*/
-public class ColgroupRenderer extends AbstractRowsRenderer {
+public class ColgroupRenderer extends AbstractRowsRenderer {
- private static final String[] STYLE_ATTRS = {"style","class"};
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.renderer.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ private static final String[] STYLE_ATTRS = { "style", "class" };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.renderer.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent colgroup) throws IOException {
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context,
+ UIComponent colgroup) throws IOException {
encodeRowStart(context, colgroup, writer, 0);
}
@@ -55,8 +59,9 @@
UIColumnGroup colgroup = (UIColumnGroup) component;
ResponseWriter writer = context.getResponseWriter();
String[] classes = null;
- String columnClasses = (String) component.getAttributes().get("columnClasses");
- if(null != columnClasses){
+ String columnClasses = (String) component.getAttributes().get(
+ "columnClasses");
+ if (null != columnClasses) {
classes = columnClasses.split(",");
}
Iterator iter = colgroup.columns();
@@ -80,64 +85,87 @@
encodeRowStart(context, colgroup, writer, currentRow);
}
String styleClass = null;
- if(null!= classes){
- styleClass = classes[currentColumn%classes.length];
+ if (null != classes) {
+ styleClass = classes[currentColumn % classes.length];
}
- encodeCellChildren(context, column, null, null, null, (String) requestMap.get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY), styleClass);
-// renderChild(context, column);
+ encodeCellChildren(context, column, null, null, null,
+ (String) requestMap
+ .get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY),
+ styleClass);
+ // renderChild(context, column);
} else {
// UIColumn don't have own renderer
- writer.startElement(HTML.td_ELEM, column);
- getUtils().encodeId(context, column);
- String styleClass;
- if(null!= classes){
- styleClass = classes[currentColumn%classes.length];
- }else {
- styleClass = (String) column.getAttributes().get("styleClass");
+ if (column.isRendered()) {
+ writer.startElement(HTML.td_ELEM, column);
+ getUtils().encodeId(context, column);
+ String styleClass;
+ if (null != classes) {
+ styleClass = classes[currentColumn % classes.length];
+ } else {
+ styleClass = (String) column.getAttributes().get(
+ "styleClass");
+ }
+ encodeStyleClass(context.getResponseWriter(), requestMap
+ .get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY),
+ "dr-table-cell rich-table-cell", requestMap
+ .get(AbstractRowsRenderer.CELL_CLASS_KEY),
+ styleClass);
+ // TODO - encode column attributes.
+ renderChildren(context, column);
+ writer.endElement(HTML.td_ELEM);
+
}
- encodeStyleClass(context.getResponseWriter(), requestMap.get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY), "dr-table-cell rich-table-cell", requestMap.get(AbstractRowsRenderer.CELL_CLASS_KEY), styleClass);
- // TODO - encode column attributes.
- renderChildren(context, column);
- writer.endElement(HTML.td_ELEM);
}
currentColumn++;
first = false;
}
}
- /* (non-Javadoc)
- * @see org.ajax4jsf.framework.renderer.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.renderer.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
writer.endElement(HTML.TR_ELEMENT);
}
-
+
private void encodeRowStart(FacesContext context, UIComponent colspan,
ResponseWriter writer, int currentRow) throws IOException {
writer.startElement(HTML.TR_ELEMENT, colspan);
String styleClass;
String rowClasses = (String) colspan.getAttributes().get("rowClasses");
- if(null != rowClasses){
+ if (null != rowClasses) {
String[] classes = rowClasses.split(",");
- styleClass = classes[currentRow%classes.length];
+ styleClass = classes[currentRow % classes.length];
} else {
- styleClass = (String) colspan.getAttributes().get("styleClass");
+ styleClass = (String) colspan.getAttributes().get("styleClass");
}
Map requestMap = context.getExternalContext().getRequestMap();
- Object skinRowClass = currentRow==0? requestMap.get(AbstractRowsRenderer.SKIN_FIRST_ROW_CLASS_KEY):requestMap.get(AbstractRowsRenderer.SKIN_ROW_CLASS_KEY);
- encodeStyleClass(context.getResponseWriter(), skinRowClass, "dr-tablerow rich-tablerow", requestMap.get(AbstractRowsRenderer.ROW_CLASS_KEY), styleClass);
+ Object skinRowClass = currentRow == 0 ? requestMap
+ .get(AbstractRowsRenderer.SKIN_FIRST_ROW_CLASS_KEY)
+ : requestMap.get(AbstractRowsRenderer.SKIN_ROW_CLASS_KEY);
+ encodeStyleClass(context.getResponseWriter(), skinRowClass,
+ "dr-tablerow rich-tablerow", requestMap
+ .get(AbstractRowsRenderer.ROW_CLASS_KEY), styleClass);
getUtils().encodePassThru(context, colspan);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.faces.render.Renderer#getRendersChildren()
*/
public boolean getRendersChildren() {
-
+
return true;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.framework.renderer.RendererBase#getComponentClass()
*/
protected Class getComponentClass() {
@@ -145,11 +173,15 @@
return UIColumnGroup.class;
}
- /* (non-Javadoc)
- * @see org.richfaces.renderkit.AbstractRowsRenderer#encodeOneRow(javax.faces.context.FacesContext, org.richfaces.renderkit.TableHolder)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.renderkit.AbstractRowsRenderer#encodeOneRow(javax.faces.context.FacesContext,
+ * org.richfaces.renderkit.TableHolder)
*/
- public void encodeOneRow(FacesContext context, TableHolder holder) throws IOException {
+ public void encodeOneRow(FacesContext context, TableHolder holder)
+ throws IOException {
// this method don't used in columnGroup component.
-
+
}
}
Modified: trunk/richfaces-samples/dataTableDemo/pom.xml
===================================================================
--- trunk/richfaces-samples/dataTableDemo/pom.xml 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces-samples/dataTableDemo/pom.xml 2007-03-15 20:04:25 UTC (rev 81)
@@ -17,7 +17,7 @@
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>dataTable</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces</groupId>
Modified: trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Bean.java 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Bean.java 2007-03-15 20:04:25 UTC (rev 81)
@@ -24,6 +24,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.faces.event.ValueChangeEvent;
+
/**
* @author $Autor$
*
@@ -89,6 +91,7 @@
* @return the checked
*/
public boolean isChecked() {
+ System.out.println("Invoke get checked for mounth "+getMounth()+", checked:"+checked);
return this.checked;
}
@@ -96,6 +99,7 @@
* @param checked the checked to set
*/
public void setChecked(boolean checked) {
+ System.out.println("Invoke set checked for mounth "+getMounth()+", checked:"+checked);
this.checked = checked;
}
@@ -105,4 +109,7 @@
return null;
}
+ public void checkChanged(ValueChangeEvent event) {
+ System.out.println("Checked changed for mounth "+getMounth());
+ }
}
\ No newline at end of file
Modified: trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Data.java
===================================================================
--- trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Data.java 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces-samples/dataTableDemo/src/main/java/org/richfaces/Data.java 2007-03-15 20:04:25 UTC (rev 81)
@@ -36,8 +36,30 @@
private List mounths = new ArrayList();
private List numbers = new ArrayList();
+
+ private boolean c3rendered=true;
+ private boolean c2rendered=true;
+
/**
+ * @return the c3rendered
+ */
+ public boolean isC3rendered() {
+ return this.c3rendered;
+ }
+
+ /**
+ * @param c3rendered the c3rendered to set
+ */
+ public void setC3rendered(boolean c3rendered) {
+ this.c3rendered = c3rendered;
+ }
+
+ public String toggleColumn() {
+ this.c3rendered = !this.c3rendered;
+ return null;
+ }
+ /**
* @return the numbers
*/
public List getNumbers() {
@@ -88,4 +110,26 @@
this.mounths = mounths;
}
+ /**
+ * @return the c2rendered
+ */
+ public boolean isC2rendered() {
+ return this.c2rendered;
+ }
+
+ /**
+ * @param c2rendered the c2rendered to set
+ */
+ public void setC2rendered(boolean c2rendered) {
+ this.c2rendered = c2rendered;
+ }
+
+ public int getC2span(){
+ return c3rendered?1:2;
+ }
+
+ public int getC1span(){
+ int i = c2rendered?1:c3rendered?2:3;
+ return i;
+ }
}
Modified: trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/ajax.jsp
===================================================================
--- trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/ajax.jsp 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/ajax.jsp 2007-03-15 20:04:25 UTC (rev 81)
@@ -10,8 +10,17 @@
<f:view >
<h:form>
<h:selectOneRadio binding="#{skinBean.component}" />
- <h:commandLink action="#{skinBean.change}" value="set skin" />
-
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <h:panelGrid columns="2">
+ <h:selectBooleanCheckbox id="c2rendered" value="#{data.c2rendered}" >
+ <a4j:support event="onchange" reRender="master"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputLabel value="Show 2-d column" for="c2rendered"></h:outputLabel>
+ <h:selectBooleanCheckbox id="c3rendered" value="#{data.c3rendered}" >
+ <a4j:support event="onchange" reRender="master"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputLabel value="Show 3-d column" for="c3rendered"></h:outputLabel>
+ </h:panelGrid>
<data:dataTable id="master" var="master" value="#{data.mounths}"
styleClass="table" captionClass="caption" rowClasses="rowa,rowb,rowc rowcc"
headerClass="header" footerClass="footer">
@@ -21,59 +30,52 @@
<f:facet name="caption"><h:outputText value="caption" /></f:facet>
<f:facet name="header">
<data:columnGroup columnClasses="cola, colb ,rowc rowcc">
- <data:column rowspan="2">
+ <data:column rowspan="2" colspan="#{data.c1span}" >
<h:outputText value="2-row head" />
</data:column>
- <data:column rowspan="2">
+ <data:column rowspan="2" colspan="#{data.c2span}" rendered="#{data.c2rendered}">
<h:outputText value="2-row head" />
</data:column>
- <h:column >
+ <h:column rendered="#{data.c3rendered}" >
<h:outputText value="head in UIColumn" />
</h:column>
- <data:column breakBefore="true">
+ <data:column breakBefore="true" rendered="#{data.c3rendered}">
<h:outputText value="2-d row head" />
</data:column>
</data:columnGroup>
</f:facet>
<f:facet name="footer"><h:outputText value="table foot" /></f:facet>
- <data:column id="mounth" styleClass="column" colspan="1"
+ <data:column id="mounth" styleClass="column" colspan="#{data.c1span}"
headerClass="cheader" footerClass="cfooter" >
<f:facet name="header"><h:outputText value="mounth" /></f:facet>
<f:facet name="footer"><h:outputText value="-//-" /></f:facet>
<h:outputText value="#{master.mounth}" />
</data:column>
- <data:column id="cell2" styleClass="column" colspan="1"
- headerClass="dheader" footerClass="dfooter" >
+ <data:column id="cell2" styleClass="column" colspan="#{data.c2span}"
+ headerClass="dheader" footerClass="dfooter" rendered="#{data.c2rendered}">
<f:facet name="header"><h:outputText value="cell 2 head" /></f:facet>
<f:facet name="footer"><h:outputText value="-//-" /></f:facet>
<h:outputText value="cell 2" />
</data:column>
- <data:column id="cell3" styleClass="column" colspan="1"
- headerClass="eheader" footerClass="efooter" >
- <f:facet name="header"><h:outputText value="cell 3 head" /></f:facet>
+ <h:column id="cell3" rendered="#{data.c3rendered}" >
+ <f:facet name="header">
+ <h:outputText id="c3head" value="cell 3 head" >
+ <a4j:support event="onclick" action="#{data.toggleColumn}" reRender="master,c3rendered"></a4j:support>
+ </h:outputText>
+ </f:facet>
<f:facet name="footer"><h:outputText value="-//-" /></f:facet>
<h:outputText value="cell 3" />
+ </h:column>
+ <data:column breakBefore="true" colspan="2">
+ <h:selectBooleanCheckbox id="checked" value="#{master.checked}"
+ valueChangeListener="#{master.checkChanged}"/>
+ <h:outputLabel value="Click to toggle" for="checked"></h:outputLabel>
</data:column>
- <data:subTable id="detail" var="detail" value="#{master.detail}">
- <data:column id="name" colspan="2">
- <f:facet name="header"><h:outputText value="property" /></f:facet>
- <f:facet name="footer"><h:outputText value="-/-/-" /></f:facet>
- <h:outputText value="#{detail.name}" />
+ <data:column id="total" styleClass="total" colspan="1">
+ <h:outputText value="#{master.total}" />
</data:column>
- <data:column id="qty">
- <f:facet name="header"><h:outputText value="qty" /></f:facet>
- <f:facet name="footer"><h:outputText value="total" /></f:facet>
- <h:outputText value="#{detail.qty}" />
- </data:column>
- </data:subTable>
- <data:column>
- <h:selectBooleanCheckbox id="checked" value="#{master.checked}" />
- </data:column>
- <data:column id="total" styleClass="total" colspan="2">
- <h:outputText value="#{master.total}" />
- </data:column>
</data:dataTable>
- </h:form>
+ </h:form>
<a4j:log hotkey="D"/>
</f:view>
</body>
Modified: trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/index.jsp 2007-03-15 19:50:08 UTC (rev 80)
+++ trunk/richfaces-samples/dataTableDemo/src/main/webapp/pages/index.jsp 2007-03-15 20:04:25 UTC (rev 81)
@@ -1,13 +1,15 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.ajax4jsf.org/dataTable" prefix="data" %>
+<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>
<html>
<head>
<title></title>
</head>
<body>
- <f:view >
- <h:panelGrid columns="4" border="1">
+ <f:view >
+ <h:form>
+ <h:panelGrid columns="3" border="1">
<data:dataTable id="master" var="master" value="#{data.mounths}"
styleClass="table" captionClass="caption" rowClasses="rowa,rowb,rowc rowcc"
headerClass="header" footerClass="footer">
@@ -79,8 +81,13 @@
<h:outputText value="#{detail.qty}" />
</data:column>
</data:subTable>
- </data:dataTable>
- </h:panelGrid>
- </f:view>
+ </data:dataTable>
+ <a4j:commandButton value="Re-render table" reRender="master"></a4j:commandButton>
+ <a4j:commandButton value="Re-render table" reRender="master1"></a4j:commandButton>
+ <a4j:commandButton value="Re-render table" reRender="master2"></a4j:commandButton>
+ </h:panelGrid>
+ </h:form>
+ <a4j:log hotkey="D"/>
+ </f:view>
</body>
</html>
17 years, 2 months
JBoss Rich Faces SVN: r80 - in trunk/richfaces/modal-panel/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-03-15 15:50:08 -0400 (Thu, 15 Mar 2007)
New Revision: 80
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
z-indexes were made relative.
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2007-03-15 18:52:17 UTC (rev 79)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2007-03-15 19:50:08 UTC (rev 80)
@@ -15,6 +15,9 @@
width: 100%;
height: 100%;
border-style: none;
+ background-color: #d0d0d0;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
}
.dr-mpnl-mask {
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-15 18:52:17 UTC (rev 79)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-15 19:50:08 UTC (rev 80)
@@ -32,7 +32,7 @@
Event.observe(document, 'mouseup', this.boundEndDrag);
this.modalPanel.cursorDiv.style.cursor = this.id.style.cursor;
- this.modalPanel.cursorDiv.style.zIndex = this.modalPanel.baseZIndex + 5;
+ this.modalPanel.cursorDiv.style.zIndex = 8;
this.modalPanel.startDrag(this);
},
@@ -83,7 +83,7 @@
this.modalPanel.endDrag(this);
vetoes = this.modalPanel.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
- this.modalPanel.cursorDiv.style.zIndex = this.modalPanel.baseZIndex - 200;
+ this.modalPanel.cursorDiv.style.zIndex = -200;
},
doPosition: function() {
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 18:52:17 UTC (rev 79)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 19:50:08 UTC (rev 80)
@@ -37,14 +37,14 @@
x:passThruWithExclusions="id,style,class"
>
<div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}Div"
- style="background-color: #d0d0d0; filter: alpha(opacity=50); opacity: 0.5; z-index: #{component.zindex - 2};"></div>
+ style="z-index: 1;"></div>
<div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
- style="background-color: #d0d0d0; filter: alpha(opacity=1); opacity: 0.01; z-index: #{component.zindex - 200 }"></div>
+ style="filter: alpha(opacity=1); opacity: 0.01; z-index: -200"></div>
- <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="z-index: #{component.zindex - 1};">
+ <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="z-index: 2;">
<iframe frameborder="0" scrolling="no" id="#{clientId}IFrame"
- style="position: absolute; width: 100%; height: 100%; background-color: white; overflow-y: hidden; z-index: #{component.zindex - 2};">
+ style="position: absolute; width: 100%; height: 100%; background-color: white; overflow-y: hidden; z-index: 1;">
</iframe>
<jsp:scriptlet>
@@ -57,7 +57,7 @@
String style = isHor ? "width: 40px; height: 4px;" : "height: 40px; width: 4px;";
//higher z-index for corner elements
- style += "z-index: " + ((i % 3 == 1 ? 0 : 1) + component.getZindex()) + ";";
+ style += "z-index: " + (i % 3 == 1 ? 0 : 1) + 3 + ";";
variables.setVariable("resizerStyle", style);
]]>
</jsp:scriptlet>
@@ -70,15 +70,15 @@
]]>
</jsp:scriptlet>
- <div style="position: absolute; width: 100%; height: 100%; overflow: hidden; z-index: #{component.zindex - 1};"
+ <div style="position: absolute; width: 100%; height: 100%; overflow: hidden; z-index: 2;"
class="dr-mpnl-pnl" >
<table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null && component.getFacet("header").isRendered()) {]]>
</jsp:scriptlet>
- <tr style="height: 1%;">
- <td class="dr-mpnl-header rich-mpnl-header-cell" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
- <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-text rich-mpnl-header #{component.attributes['headerClass']}"
+ <tr style="height: 1%;">
+ <td class="dr-mpnl-header rich-mpnl-header-cell" style="position: relative; vertical-align: middle; z-index: 5;" width="100%">
+ <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-text rich-mpnl-header #{component.attributes['headerClass']}"
nowrap="nowrap">
<u:insertFacet name="header" />
</div>
17 years, 2 months