JBoss Rich Faces SVN: r139 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-26 07:38:48 -0400 (Mon, 26 Mar 2007)
New Revision: 139
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 10:12:56 UTC (rev 138)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 11:38:48 UTC (rev 139)
@@ -37,6 +37,7 @@
<name>disabled</name>
<classname>boolean</classname>
<description>If “true” sets state of the item to disabled state. “false” is default.</description>
+ <defaultvalue>false</defaultvalue>
</property>
<property required="true">
<name>value</name>
18 years, 6 months
JBoss Rich Faces SVN: r138 - trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-26 06:12:56 -0400 (Mon, 26 Mar 2007)
New Revision: 138
Modified:
trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
Log:
Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-26 09:02:53 UTC (rev 137)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-26 10:12:56 UTC (rev 138)
@@ -10,7 +10,67 @@
border-top: 1px solid #bfbfc0;
margin : 2px 0px 2px 24px;
}
+.dr-menu-item {
+ padding : 1px 35px 1px 1px;
+ white-space : nowrap;
+ font-family : arial;
+ font-size : 11px;
+ position : relative;
+}
+.dr-menu-item-unselect {
+ border : 1px solid transparent;
+}
+.dr-menu-item-select {
+ border : 1px solid #4a70ab;
+ cursor : pointer;
+ background : url(menu_item_bg.gif) repeat-x top #a9c5e7;
+}
+.dr-menu-item-disabled {
+ border : 1px solid transparent;
+ cursor : default; color : #839eca;
+}
+.dr-menu-ico {
+ vertical-align: middle;
+ margin-right : 10px;
+}
+.dr-menu-item a {
+ color : #000000;
+ text-decoration : none;
+}
+.dr-menu-node {
+ position : absolute;
+ background : url(node.gif) no-repeat top;
+ width : 7px;
+ height : 7px;
+ top : 7px;
+ right : 6px;
+ font-size : 1px;
+}
+.dr-menu-item-disabled .dr-menu-node {
+ background-position : bottom;
+}
+.dr-menu-list-position {
+ top : 17;
+ left: -1
+}
+.dr-menu-list-border {
+ border : 1px solid #bfbfc0;
+ background-color : #e7f2fb;
+ float : left;
+ position : absolute;
+}
+.dr-menu-sublist {
+ top : -8;
+ left:13;
+}
+.dr-menu-list-bg {
+ border-top : 1px solid #e7f2fb;
+ border-left : 1px solid #e7f2fb;
+ border-right : 1px solid #e7f2fb;
+ background : url(menu_list_bg.gif) repeat-y left;
+}
+
]]>
</f:verbatim>
18 years, 6 months
JBoss Rich Faces SVN: r137 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-26 05:02:53 -0400 (Mon, 26 Mar 2007)
New Revision: 137
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 08:28:42 UTC (rev 136)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 09:02:53 UTC (rev 137)
@@ -38,7 +38,7 @@
<classname>boolean</classname>
<description>If “true” sets state of the item to disabled state. “false” is default.</description>
</property>
- <property>
+ <property required="true">
<name>value</name>
<classname>java.lang.Object</classname>
<description>Defines representation text for menuItem.</description>
18 years, 6 months
JBoss Rich Faces SVN: r136 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-26 04:28:42 -0400 (Mon, 26 Mar 2007)
New Revision: 136
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 08:22:36 UTC (rev 135)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 08:28:42 UTC (rev 136)
@@ -142,14 +142,90 @@
</superclass>
</tag>
-
+ <!-- Standart component attributes -->
+ &ui_component_attributes;
+
+ <!-- Specific component attributes -->
<property>
- <name>id</name>
+ <name>icon</name>
<classname>java.lang.String</classname>
- <description>
- </description>
+ <description>Path to the icon to be displayed for the enabled item state</description>
+ </property>
+ <property>
+ <name>iconDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled item state</description>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If “true” sets state of the item to disabled state. “false” is default</description>
+ <defaultvalue>false</defaultvalue>
</property>
+ <!-- property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>Defines representation text for menuItem</description>
+ </property -->
+ <property>
+ <name>mode</name>
+ <classname>java.lang.String</classname>
+ <description>Set the submission mode (ajax, server(Default), none)</description>
+ <defaultvalue>"server"</defaultvalue>
+ </property>
+ <!-- Command attributes -->
+ &ui_command_attributes;
+ <property>
+ <name>target</name>
+ <classname>java.lang.Object</classname>
+ <description></description>
+ </property>
+
+ <!-- Events attributes -->
+ &html_events;
+ <property>
+ <name>onselect</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; The onselect event occurs when a user selects some menu item.</description>
+ </property>
+ <property hidden="true">
+ <name>ondblclick</name>
+ </property>
+ <property hidden="true">
+ <name>onkeydown</name>
+ </property>
+ <property hidden="true">
+ <name>onkeypress</name>
+ </property>
+ <property hidden="true">
+ <name>onkeyup</name>
+ </property>
+
+ <!-- Style Attributes -->
+ &html_style_attributes;
+ <property>
+ <name>selectClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to selected items</description>
+ </property>
+ <property>
+ <name>selectStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to selected items</description>
+ </property>
+ <property>
+ <name>iconClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to icon element</description>
+ </property>
+ <property>
+ <name>iconStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to icon element</description>
+ </property>
+
+ &ajax_component_attributes;
</component>
<component>
<name>org.richfaces.MenuSeparator</name>
18 years, 6 months
JBoss Rich Faces SVN: r135 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-03-26 04:22:36 -0400 (Mon, 26 Mar 2007)
New Revision: 135
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 07:59:12 UTC (rev 134)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 08:22:36 UTC (rev 135)
@@ -151,29 +151,26 @@
</property>
</component>
- <component>
- <name>org.richfaces.MenuSeparator</name>
- <family>org.richfaces.DropDownMenu</family>
- <classname>org.richfaces.component.html.HtmlMenuSeparator</classname>
- <superclass>org.richfaces.component.UIMenuSeparator</superclass>
- <description>
- <![CDATA[ ]]>
- </description>
+ <component>
+ <name>org.richfaces.MenuSeparator</name>
+ <family>org.richfaces.DropDownMenu</family>
+ <classname>org.richfaces.component.html.HtmlMenuSeparator</classname>
+ <superclass>org.richfaces.component.UIMenuSeparator</superclass>
+ <description><![CDATA[
+ A horizontal separator to use in the menu.
+ ]]></description>
- <renderer generate="true" override="true">
- <name>org.richfaces.MenuSeparatorRenderer</name>
- <template>org/richfaces/htmlMenuSeparator.jspx</template>
- </renderer>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.MenuSeparatorRenderer</name>
+ <template>org/richfaces/htmlMenuSeparator.jspx</template>
+ </renderer>
+ <tag bodyContent="empty">
+ <name>menuSeparator</name>
+ <classname>org.richfaces.taglib.MenuSeparatorTag</classname>
+ <superclass>org.ajax4jsf.framework.taglib.UIComponentTagBase</superclass>
+ </tag>
- <tag>
- <name>MenuSeparator</name>
- <classname>org.richfaces.taglib.MenuSeparatorTag</classname>
- <superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
- </superclass>
- </tag>
-
&ui_component_attributes;
- </component>
+ </component>
</components>
18 years, 6 months
JBoss Rich Faces SVN: r134 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-26 03:59:12 -0400 (Mon, 26 Mar 2007)
New Revision: 134
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 07:47:19 UTC (rev 133)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 07:59:12 UTC (rev 134)
@@ -7,31 +7,117 @@
<classname>org.richfaces.component.html.HtmlMenuGroup</classname>
<superclass>org.richfaces.component.UIMenuGroup</superclass>
<description>
- <![CDATA[ ]]>
+ <![CDATA[Defines expandable group of items inside popup list or another group. Should accept only “menuItem”, ”menuGroup” and ”menuSeparator” components as children.]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuGroupRenderer</name>
<template>org/richfaces/htmlMenuGroup.jspx</template>
</renderer>
-
<tag>
- <name>MenuGroup</name>
+ <name>menuGroup</name>
<classname>org.richfaces.taglib.MenuGroupTag</classname>
<superclass>
org.ajax4jsf.framework.taglib.HtmlComponentTagBase
</superclass>
</tag>
+ <property>
+ <name>icon</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the enabled item state</description>
+ </property>
+ <property>
+ <name>iconDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled item state</description>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If “true” sets state of the item to disabled state. “false” is default.</description>
+ </property>
+ <property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>Defines representation text for menuItem.</description>
+ </property>
+ <property>
+ <name>direction</name>
+ <classname>java.lang.String</classname>
+ <description>Defines direction of the popup sublist to appear (right, left, auto(Default))</description>
+ </property>
+ <property>
+ <name>iconFolder</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the folder icon to be displayed for the enabled item state</description>
+ </property>
+ <property>
+ <name>iconFolderDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the folder icon to be displayed for the enabled item state</description>
+ </property>
+ <property>
+ <name>event</name>
+ <classname>java.lang.String</classname>
+ <description>Defines the event on the representation element that triggers the menu's appearance.</description>
+ </property>
+ <property>
+ <name>showDelay</name>
+ <classname>int</classname>
+ <description>Delay between event and menu showing.</description>
+ </property>
- <property>
- <name>id</name>
- <classname>java.lang.String</classname>
- <description>
- </description>
- </property>
+ <property>
+ <name>onmousemove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved within</description>
+ </property>
+ <property>
+ <name>onmouseout</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved away</description>
+ </property>
+ <property>
+ <name>onmouseover</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved onto</description>
+ </property>
+ <property>
+ <name>onopen</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; group was opened.</description>
+ </property>
+ <property>
+ <name>onclose</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; group was closed.</description>
+ </property>
+ <property>
+ <name>selectStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to selected items.</description>
+ </property>
+ <property>
+ <name>selectClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to selected items.</description>
+ </property>
+ <property>
+ <name>iconStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to icon element.</description>
+ </property>
+ <property>
+ <name>iconClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to icon element.</description>
+ </property>
+
+ &ui_component_attributes;
+ &html_style_attributes;
</component>
<component>
<name>org.richfaces.MenuItem</name>
@@ -41,7 +127,7 @@
<description>
<![CDATA[ ]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuItemRenderer</name>
<template>org/richfaces/htmlMenuItem.jspx</template>
@@ -63,7 +149,7 @@
<description>
</description>
</property>
-
+
</component>
<component>
<name>org.richfaces.MenuSeparator</name>
@@ -73,7 +159,7 @@
<description>
<![CDATA[ ]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuSeparatorRenderer</name>
<template>org/richfaces/htmlMenuSeparator.jspx</template>
18 years, 6 months
JBoss Rich Faces SVN: r133 - in trunk/richfaces/menu-components/src/main: resources/org/richfaces/renderkit/html/css and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-03-26 03:47:19 -0400 (Mon, 26 Mar 2007)
New Revision: 133
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx
Log:
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-23 18:48:54 UTC (rev 132)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-03-26 07:47:19 UTC (rev 133)
@@ -9,7 +9,7 @@
<description>
<![CDATA[ ]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuGroupRenderer</name>
<template>org/richfaces/htmlMenuGroup.jspx</template>
@@ -31,7 +31,7 @@
<description>
</description>
</property>
-
+
</component>
<component>
<name>org.richfaces.MenuItem</name>
@@ -41,7 +41,7 @@
<description>
<![CDATA[ ]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuItemRenderer</name>
<template>org/richfaces/htmlMenuItem.jspx</template>
@@ -63,7 +63,7 @@
<description>
</description>
</property>
-
+
</component>
<component>
<name>org.richfaces.MenuSeparator</name>
@@ -73,7 +73,7 @@
<description>
<![CDATA[ ]]>
</description>
-
+
<renderer generate="true" override="true">
<name>org.richfaces.MenuSeparatorRenderer</name>
<template>org/richfaces/htmlMenuSeparator.jspx</template>
@@ -88,13 +88,6 @@
</superclass>
</tag>
-
- <property>
- <name>id</name>
- <classname>java.lang.String</classname>
- <description>
- </description>
- </property>
-
+ &ui_component_attributes;
</component>
</components>
Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-23 18:48:54 UTC (rev 132)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-26 07:47:19 UTC (rev 133)
@@ -5,6 +5,11 @@
<f:verbatim><![CDATA[
+.dr-menu-separator {
+ font-size : 0px;
+ border-top: 1px solid #bfbfc0;
+ margin : 2px 0px 2px 24px;
+}
]]>
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx 2007-03-23 18:48:54 UTC (rev 132)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx 2007-03-26 07:47:19 UTC (rev 133)
@@ -1,17 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- baseclass="org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase"
- class="org.richfaces.renderkit.html.MenuSeparatorRenderer"
- component="org.richfaces.component.UIMenuSeparator"
- >
- <h:styles>css/menucomponents.xcss</h:styles>
-
- <f:clientid var="clientId"/>
- <div id="#{clientId}" name="#{clientId}">
- </div>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ baseclass="org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase"
+ class="org.richfaces.renderkit.html.MenuSeparatorRenderer"
+ component="org.richfaces.component.UIMenuSeparator"
+ >
+ <h:styles>css/menucomponents.xcss</h:styles>
+
+ <f:clientid var="clientId"/>
+
+ <div id="#{clientId}" name="#{clientId}" class="dr-menu-separator rich-menu-separator">
+
+ </div>
</f:root>
\ No newline at end of file
18 years, 6 months
JBoss Rich Faces SVN: r132 - in trunk: richfaces/tree/src/main/java/org/richfaces/renderkit and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-23 14:48:54 -0400 (Fri, 23 Mar 2007)
New Revision: 132
Modified:
trunk/richfaces-samples/tree-demo/src/main/java/org/richfaces/Bean.java
trunk/richfaces-samples/tree-demo/src/main/webapp/pages/index.jsp
trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
Log:
RF-33 Fixes:
1. Now ClientId's of UITreeNode but not of UITree are used as required by DnD contributors contract
2. Test case changed to print out drag & drop values
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-03-23 18:48:54 UTC (rev 132)
@@ -455,13 +455,6 @@
// fire node events
TreeEvents.invokeListenerBindings(this, event, getFacesContext());
- //TODO quick fix for UITreeNode to invoke listeners
- UITreeNode treeNode = getNodeFacet();
- if (treeNode != null) {
- if (event instanceof DragEvent || event instanceof DropEvent) {
- treeNode.broadcast(event);
- }
- }
if (event instanceof AjaxEvent) {
AjaxRendererUtils.addRegionsFromComponent(this, getFacesContext());
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-03-23 18:48:54 UTC (rev 132)
@@ -14,7 +14,9 @@
import org.ajax4jsf.dnd.Draggable;
import org.ajax4jsf.dnd.Dropzone;
+import org.ajax4jsf.dnd.event.DragEvent;
import org.ajax4jsf.dnd.event.DragListener;
+import org.ajax4jsf.dnd.event.DropEvent;
import org.ajax4jsf.dnd.event.DropListener;
import org.ajax4jsf.framework.ajax.AjaxEvent;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
@@ -98,6 +100,14 @@
FacesContext context = getFacesContext();
TreeEvents.invokeListenerBindings(this, event, context);
+ //TODO quick fix for UITree to invoke listeners
+ UITree tree = getUITree();
+ if (tree != null) {
+ if (event instanceof DragEvent || event instanceof DropEvent) {
+ tree.broadcast(event);
+ }
+ }
+
if (event instanceof AjaxEvent) {
AjaxRendererUtils.addRegionsFromComponent(this, getFacesContext());
}
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-03-23 18:48:54 UTC (rev 132)
@@ -71,15 +71,15 @@
protected String getToggleScript(FacesContext context, UITreeNode treeNode) {
UITree tree = treeNode.getUITree();
- String id = tree.getClientId(context);
+ String id = treeNode.getClientId(context);
String toggleId = id + NamingContainer.SEPARATOR_CHAR
+ UITree.TOGGLE_LINK_ATTRIBUTE;
if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
- JSFunction function = AjaxRendererUtils.buildAjaxFunction(tree,
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(tree.getNodeFacet(),
context);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- tree);
+ tree.getNodeFacet());
Map parameters = (Map) eventOptions.get("parameters");
parameters.remove(id);
parameters.put(toggleId, toggleId);
@@ -224,7 +224,7 @@
UITree tree = node.getUITree();
Map requestMap = context.getExternalContext().getRequestParameterMap();
- String id = tree.getClientId(context);
+ String id = node.getClientId(context);
TreeState componentState = (TreeState) tree.getComponentState();
TreeRowKey key = (TreeRowKey) tree.getRowKey();
@@ -286,11 +286,6 @@
return null;
}
- public String getParentClientId(FacesContext context, UITreeNode treeNode)
- throws IOException {
- return treeNode.getUITree().getClientId(context);
- }
-
public String getDraggableScriptOptions(FacesContext context,
UITreeNode component) {
ScriptOptions options = new TreeNodeOptions(component);
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-03-23 18:48:54 UTC (rev 132)
@@ -77,7 +77,7 @@
navigator.followRowKey((TreeRowKey) rowKey);
if (tree.isSelected()) {
- holder.setValue(tree.getClientId(context));
+ holder.setValue(tree.getNodeFacet().getClientId(context));
}
if (!flag.isFlagSet()) {
@@ -153,7 +153,7 @@
TreeRowKey key = (TreeRowKey) ajaxKeysItr.next();
tree.setRowKey(key);
- String id = tree.getClientId(context);
+ String id = tree.getNodeFacet().getClientId(context);
if (ids.isEmpty() || ids.contains(id)) {
writeContent(context, tree, key);
encodeScripts = true;
@@ -271,18 +271,26 @@
Set set = tree.getAjaxKeys();
String varName = getJavaScriptVarName(context, tree);
- if (set != null) {
- Iterator iterator = set.iterator();
- while (iterator.hasNext()) {
- TreeRowKey rowKey = (TreeRowKey) iterator.next();
+ Object storedRowKey = tree.getRowKey();
+
+ try {
+ if (set != null) {
+ Iterator iterator = set.iterator();
+ while (iterator.hasNext()) {
+ TreeRowKey rowKey = (TreeRowKey) iterator.next();
- writer.writeText(varName + ".getNodeElements(" + varName
- + ", \"" + clientId + NamingContainer.SEPARATOR_CHAR
- + rowKey.toString() + "\");", null);
+ tree.setRowKey(rowKey);
+
+ writer.writeText(varName + ".getNodeElements(" + varName
+ + ", \"" + tree.getNodeFacet().getClientId(context) + "\");", null);
+ }
+
+ set.clear();
}
-
- set.clear();
+ } finally {
+ tree.setRowKey(storedRowKey);
}
+
writer.endElement("script");
writer.endElement("div");
@@ -332,9 +340,18 @@
public void beforeDown() throws IOException {
droppedDownToLevelFlag.setFlag();
- String id = getTree().getClientId(context)
- + NamingContainer.SEPARATOR_CHAR;
+ String id;
+ Object rowKey = getTree().getRowKey();
+ if (rowKey == null) {
+ id = getTree().getClientId(context)
+ + NamingContainer.SEPARATOR_CHAR;
+ } else {
+ id = getTree().getNodeFacet().getClientId(context)
+ + NamingContainer.SEPARATOR_CHAR;
+ }
+
+
writer.startElement("tr", input);
getUtils().writeAttribute(writer, "id", id + "childs");
@@ -404,9 +421,10 @@
getUtils().writeAttribute(writer, "border", "0");
getUtils().writeAttribute(writer, "cellpadding", "0");
getUtils().writeAttribute(writer, "cellspacing", "0");
- getUtils().writeAttribute(writer, "id", tree.getClientId(context));
+ getUtils().writeAttribute(writer, "id", tree.getNodeFacet().getClientId(context));
getUtils().writeAttribute(writer, "style", "width: 100%;");
-
+ getUtils().writeAttribute(writer, "rich:nodeId", tree.getNodeFacet().getId());
+
writer.startElement("tbody", tree);
}
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-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2007-03-23 18:48:54 UTC (rev 132)
@@ -67,8 +67,8 @@
} */
drop: function(event, drag){
//alert("type:" + drag.type+" source:"+drag.source.id+" target:"+this.id);
- drag.params[DnD.Dropzone.DROP_TARGET_ID] = this.tree.id;
-
+ drag.params[DnD.Dropzone.DROP_TARGET_ID] = this.id;
+
var opts = this.getDropzoneOptions();
if (opts && opts.parameters) {
Object.extend(drag.params, opts.parameters);
Modified: trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 18:48:54 UTC (rev 132)
@@ -11,7 +11,7 @@
component="org.richfaces.component.UITreeNode"
xmlns:ils="urn:intralinks">
- <c:set var="clientId" value="#{this:getParentClientId(context, component) }" />
+ <f:clientId var="clientId" />
<f:resource
name="images/spacer.gif"
Modified: trunk/richfaces-samples/tree-demo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/richfaces-samples/tree-demo/src/main/java/org/richfaces/Bean.java 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces-samples/tree-demo/src/main/java/org/richfaces/Bean.java 2007-03-23 18:48:54 UTC (rev 132)
@@ -241,7 +241,11 @@
}
public void processDrop(DropEvent dropEvent) {
+ System.out.println("Should be printed twice per event!!!");
System.out.println(dropEvent);
+ System.out.println("DragValue: " + dropEvent.getDragValue());
+ System.out.println("DropValue: " + dropEvent.getDropValue());
+ System.out.println("+++++");
}
public String getIconCollapsed() {
Modified: trunk/richfaces-samples/tree-demo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/tree-demo/src/main/webapp/pages/index.jsp 2007-03-23 16:51:36 UTC (rev 131)
+++ trunk/richfaces-samples/tree-demo/src/main/webapp/pages/index.jsp 2007-03-23 18:48:54 UTC (rev 132)
@@ -58,6 +58,7 @@
ajaxSubmitSelection="true" reRender="outputText, selectOneListbox"
preserveModel="none"
dragIndicator="treeIndicator"
+ immediate="false"
acceptedTypes="file1"
dragType="file1"
18 years, 6 months
JBoss Rich Faces SVN: r131 - in trunk/richfaces/tree/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-03-23 12:51:36 -0400 (Fri, 23 Mar 2007)
New Revision: 131
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.js
trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
Log:
Small optimize finding main TR for tree node.
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-23 16:16:13 UTC (rev 130)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-23 16:51:36 UTC (rev 131)
@@ -47,6 +47,7 @@
($(this.id)).object = this;
this.childs = [];
var childsRowId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
+ var mainRowId = this.id + Tree.ID_DEVIDER + Tree.ID_MAIN_ROW;
this.elements.row = $(childsRowId);
var handleId = this.id + Tree.ID_DEVIDER + Tree.ID_HANDLE;
this.elements.handle = $(handleId);
@@ -69,13 +70,8 @@
}
}
}
- var parent = this.elements.handle;
- while (parent) {
- parent = parent.parentNode;
- if (parent.nodeName.toLowerCase() == "tr")
- break;
- }
- this.elements.mainRow = parent;
+
+ this.elements.mainRow = $(mainRowId);
},
addChild: function(child) {
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-03-23 16:16:13 UTC (rev 130)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-03-23 16:51:36 UTC (rev 131)
@@ -12,6 +12,7 @@
Tree.ID_HANDLE_IMG_COLLAPSED = "img:collapsed";
Tree.ID_ICON = "icon";
Tree.ID_TEXT = "text";
+Tree.ID_MAIN_ROW = "mainRow";
Tree.CLASS_ITEM_SELECTED = "dr-tree-i-sel";
Tree.CLASS_ITEM_EXPANDED = "dr-tree-h-ic-line-exp";
Tree.CLASS_ITEM_COLLAPSED = "dr-tree-h-ic-line-clp";
Modified: trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:16:13 UTC (rev 130)
+++ trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:51:36 UTC (rev 131)
@@ -32,7 +32,7 @@
<f:call name="initializeLines" />
<f:call name="initializeResources" />
- <tr>
+ <tr id="#{clientId}:mainRow" >
<f:call name="encodeAttributeParameters" />
<td class="dr-tree-h-ic #{line}" style="width: 16px;">
<div style="width: 16px;">
18 years, 6 months
JBoss Rich Faces SVN: r130 - in trunk/richfaces/tree/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-03-23 12:16:13 -0400 (Fri, 23 Mar 2007)
New Revision: 130
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
Log:
Fix tree expand/collapse in Opera.
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-23 16:05:54 UTC (rev 129)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-23 16:16:13 UTC (rev 130)
@@ -69,6 +69,13 @@
}
}
}
+ var parent = this.elements.handle;
+ while (parent) {
+ parent = parent.parentNode;
+ if (parent.nodeName.toLowerCase() == "tr")
+ break;
+ }
+ this.elements.mainRow = parent;
},
addChild: function(child) {
@@ -79,6 +86,13 @@
toggleCollapsion: function() {
if (this.hasChilds()) Element.toggle(this.elements.row);
+
+ // Rerender main row to avoid bad representation in Opera and Konqueror/Safari
+ if (this.elements.mainRow) {
+ Element.hide(this.elements.mainRow);
+ Element.show(this.elements.mainRow);
+ }
+
if (this.isCollapsed()) {
this.elements.handleImgExpanded.style.display="none";
this.elements.handleImgCollapsed.style.display="";
Modified: trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:05:54 UTC (rev 129)
+++ trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:16:13 UTC (rev 130)
@@ -34,33 +34,35 @@
<tr>
<f:call name="encodeAttributeParameters" />
- <td class="dr-tree-h-ic #{line}">
- <jsp:scriptlet>
- <![CDATA[
- if (component.getUITree().isLeaf()) {
- ]]>
- </jsp:scriptlet> <img id="#{clientId}:handle:img" src="#{spacer}"/> <jsp:scriptlet>
- <![CDATA[
- } else {
- ]]>
- </jsp:scriptlet> <a href="#" id="#{clientId}:handle"
- onclick="#{this:getToggleScript(context, component)} return false;"> <jsp:scriptlet>
- <![CDATA[if (component.getUITree().isExpanded()) {]]>
- </jsp:scriptlet> <img border="0" id="#{clientId}:handle:img:collapsed"
- src="#{collapsed}" class="dr-tree-pointer-cursor" style="display: none;" />
- <img border="0" id="#{clientId}:handle:img:expanded" src="#{expanded}"
- class="dr-tree-pointer-cursor" /> <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet> <img border="0" id="#{clientId}:handle:img:collapsed"
- src="#{collapsed}" class="dr-tree-pointer-cursor" /> <img border="0"
- id="#{clientId}:handle:img:expanded" src="#{expanded}"
- class="dr-tree-pointer-cursor" style="display: none;" /> <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet> </a> <jsp:scriptlet>
- <![CDATA[
- }
- ]]>
- </jsp:scriptlet>
+ <td class="dr-tree-h-ic #{line}" style="width: 16px;">
+ <div style="width: 16px;">
+ <jsp:scriptlet>
+ <![CDATA[
+ if (component.getUITree().isLeaf()) {
+ ]]>
+ </jsp:scriptlet> <img id="#{clientId}:handle:img" src="#{spacer}"/> <jsp:scriptlet>
+ <![CDATA[
+ } else {
+ ]]>
+ </jsp:scriptlet> <a href="#" id="#{clientId}:handle"
+ onclick="#{this:getToggleScript(context, component)} return false;"> <jsp:scriptlet>
+ <![CDATA[if (component.getUITree().isExpanded()) {]]>
+ </jsp:scriptlet> <img border="0" id="#{clientId}:handle:img:collapsed"
+ src="#{collapsed}" class="dr-tree-pointer-cursor" style="display: none;" />
+ <img border="0" id="#{clientId}:handle:img:expanded" src="#{expanded}"
+ class="dr-tree-pointer-cursor" /> <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet> <img border="0" id="#{clientId}:handle:img:collapsed"
+ src="#{collapsed}" class="dr-tree-pointer-cursor" /> <img border="0"
+ id="#{clientId}:handle:img:expanded" src="#{expanded}"
+ class="dr-tree-pointer-cursor" style="display: none;" /> <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet> </a> <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+ </div>
</td>
<td
rich:ajaxselectedlistener="#{this:getAjaxSelectedListenerFlag(context, component)}"
18 years, 6 months