[richfaces-svn-commits] JBoss Rich Faces SVN: r240 - in trunk/richfaces/dropdown-menu/src/main: java/org/richfaces/renderkit/html and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Apr 3 06:23:11 EDT 2007


Author: d.bulahov
Date: 2007-04-03 06:23:10 -0400 (Tue, 03 Apr 2007)
New Revision: 240

Modified:
   trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml
   trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
Log:
Development add events attributes in javascript

Modified: trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml	2007-04-03 00:50:12 UTC (rev 239)
+++ trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml	2007-04-03 10:23:10 UTC (rev 240)
@@ -79,6 +79,7 @@
 			<description>
 			  Defines direction of the popup list to appear (top-right, top-left bottom-right, bottom-left, auto(default))
 			</description>
+			<defaultvalue>"auto"</defaultvalue>
 		</property>
 
 
@@ -96,6 +97,7 @@
 			<description>
 			  Set the corner of the label for the popup to be connected with. (auto(default), tr, tl, bl, br, where tr – top-right)
 			</description>
+			<defaultvalue>"auto"</defaultvalue>
 		</property>
 
 		<property>
@@ -104,6 +106,7 @@
 			<description>
 			  Sets the horizontal offset between popup list and label element conjunction point
 			</description>
+			<defaultvalue><![CDATA[0]]></defaultvalue>
 		</property>
 
 		<property>
@@ -112,15 +115,9 @@
 			<description>
 			  Sets the vertical offset between popup list and label element conjunction point
 			</description>
+			<defaultvalue><![CDATA[0]]></defaultvalue>			
 		</property>
 
-		<property>
-			<name>verticalOffset</name>
-			<classname>int</classname>
-			<description>
-			  Sets the vertical offset between popup list and label element conjunction point
-			</description>
-		</property>
 
 		&html_style_attributes;
 
@@ -172,6 +169,7 @@
 			<description>
 			   Event must occurs on menu closure
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 		<property>
@@ -180,6 +178,7 @@
 			<description>
 			Event must occurs on menu opening
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 
@@ -189,6 +188,7 @@
 			<description>
 			HTML: script expression; a pointer was moved away.
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 		<property>
@@ -197,6 +197,7 @@
 			<description>
 			HTML: script expression; a pointer was moved within.
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 		<property>
@@ -205,6 +206,7 @@
 			<description>
 			HTML: script expression; a pointer was moved onto.
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 		<property>
@@ -213,6 +215,7 @@
 			<description>
 			HTML: script expression; some item was selected.
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 		<property>
@@ -221,6 +224,7 @@
 			<description>
 			HTML: script expression; some group was activated.
 			</description>
+			<defaultvalue><![CDATA[""]]></defaultvalue>
 		</property>
 
 

Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java	2007-04-03 00:50:12 UTC (rev 239)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java	2007-04-03 10:23:10 UTC (rev 240)
@@ -127,16 +127,42 @@
 		StringBuffer buffer = 
 			new StringBuffer("new Exadel.Menu.Layer('")	
 				.append(component.getClientId(context)+"_menu")
-				.append("',")
+				.append("','")
 				.append(component.getAttributes().get("showDelay"))
-				.append( ")");
+				.append("',");
+                if (component instanceof UIDropDownMenu) {
+                	buffer.append("'")
+                	.append(component.getAttributes().get("hideDelay"))
+                	.append("'");
+                }
+                else{
+                	buffer.append("null");
+                }
+                buffer.append( ")");
 		if (component instanceof UIMenuGroup) {
 			buffer.append(".asSubMenu('")
 				.append(component.getParent().getClientId(context)+"_menu")
 				.append("','")	
 				.append("ref")
 				.append(component.getClientId(context))
-				.append("')");
+				.append("',");
+				 String evt = (String) component.getAttributes().get("event");
+			     if(evt == null || evt.trim().length() == 0){
+				     evt = "onmouseover";
+			     }
+			    buffer.append("'").append(evt).append("',")				
+				.append("{")
+			    .append("onmouseout:'" + component.getAttributes().get("onmouseout")+"'")
+			    .append(",")
+			    .append("onmousemove:'" + component.getAttributes().get("onmousemove")+"'")
+			    .append(",")
+			    .append("onmouseover:'" + component.getAttributes().get("onmouseover")+"'")
+			    .append(",")
+			    .append("onopen:'" + component.getAttributes().get("onopen")+"'")
+			    .append(",")
+			    .append("onclose:'" + component.getAttributes().get("onclose")+"'")
+				.append("}")
+				.append(")");
 		} else {
 		    buffer
 	         .append(".asDropDown('")
@@ -147,8 +173,31 @@
 			if(evt == null || evt.trim().length() == 0){
 				evt = "onmouseover";
 			}
-			buffer.append(",'").append(evt).append("')");
-			
+			buffer.append(",'").append(evt).append("','onmouseout',")
+			.append("{")
+			.append("direction:'" + component.getAttributes().get("direction")+"'")
+			.append(",")
+			.append("jointPoint:'" + component.getAttributes().get("jointPoint")+"'")
+			.append(",")
+			.append("verticalOffset:'" + component.getAttributes().get("verticalOffset")+"'")
+			.append(",")		
+			.append("horizontalOffset:'" + component.getAttributes().get("horizontalOffset")+"'")
+			.append(",")
+			.append("oncollapse:'" + component.getAttributes().get("oncollapse")+"'")
+			.append(",")
+            .append("onexpand:'" + component.getAttributes().get("onexpand")+"'")
+			.append(",")
+            .append("onmouseout:'" + component.getAttributes().get("onmouseout")+"'")
+			.append(",")
+            .append("onmousemove:'" + component.getAttributes().get("onmousemove")+"'")
+			.append(",")
+            .append("onmouseover:'" + component.getAttributes().get("onmouseover")+"'")
+			.append(",")
+            .append("onitemselect:'" + component.getAttributes().get("onitemselect")+"'")            
+			.append(",")
+            .append("ongroupactivate:'" + component.getAttributes().get("ongroupactivate")+"'")
+			.append("}")
+			.append(")");			
 		}
 		List children = component.getChildren();
 		for(Iterator it = children.iterator();it.hasNext();) {




More information about the richfaces-svn-commits mailing list