[richfaces-svn-commits] JBoss Rich Faces SVN: r2378 - in trunk/ui/scrollableDataTable/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 Aug 21 09:39:36 EDT 2007


Author: konstantin.mishin
Date: 2007-08-21 09:39:36 -0400 (Tue, 21 Aug 2007)
New Revision: 2378

Modified:
   trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
   trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
Log:
RF-644

Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml	2007-08-21 13:35:33 UTC (rev 2377)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml	2007-08-21 13:39:36 UTC (rev 2378)
@@ -121,6 +121,27 @@
 			<classname>boolean</classname>
 			<defaultvalue>false</defaultvalue>
 		</property>
+		
+		<property>
+			<name>onRowClick</name>
+			<classname>java.lang.String</classname>
+		</property>	
+			
+		<property>
+			<name>onRowMouseDown</name>
+			<classname>java.lang.String</classname>
+		</property>	
+			
+		<property>
+			<name>onRowMouseUp</name>
+			<classname>java.lang.String</classname>
+		</property>	
+			
+		<property>
+			<name>onRowDblClick</name>
+			<classname>java.lang.String</classname>
+		</property>	
+			
 		&ui_component_attributes;
 	</component>
 	

Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java	2007-08-21 13:35:33 UTC (rev 2377)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java	2007-08-21 13:39:36 UTC (rev 2378)
@@ -278,7 +278,7 @@
 				state.setFrozenColumnCount(ScrollableDataTableUtils.getFrozenColumnsCount(grid));
 				getUtils().writeAttribute(writer, "id",row_id);
 				getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(index));
-				
+				addRowJavascriptEvents(writer, grid);
 				if (log.isDebugEnabled()) {
 					log.debug("rowIndex : " + index);
 				}
@@ -339,6 +339,7 @@
 							writer.startElement("tr", grid);
 							getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
 							getUtils().writeAttribute(writer,"id",row_id);
+							addRowJavascriptEvents(writer, grid);
 							collection.add(row_id);
 																							
 						}else if(!state.isFrozenColumn() && !normalTRRendered){
@@ -353,6 +354,7 @@
 							writer.startElement("tr", grid);
 							getUtils().writeAttribute(writer,"id",row_id);
 							getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
+							addRowJavascriptEvents(writer, grid);
 							normalTRRendered = true;
 							collection.add(row_id);
 									
@@ -802,4 +804,38 @@
 		}
 	}
 	
+	private void addRowJavascriptEvents(ResponseWriter writer, UIComponent component) {
+		String attribute = (String)component.getAttributes().get("onRowClick");
+		if (attribute != null) {
+			try {
+				getUtils().writeAttribute(writer, "onclick", attribute);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		attribute = (String)component.getAttributes().get("onRowMouseDown");
+		if (attribute != null) {
+			try {
+				getUtils().writeAttribute(writer, "onmousedown", attribute);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		attribute = (String)component.getAttributes().get("onRowMouseUp");
+		if (attribute != null) {
+			try {
+				getUtils().writeAttribute(writer, "onmouseup", attribute);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		attribute = (String)component.getAttributes().get("onRowDblClick");
+		if (attribute != null) {
+			try {
+				getUtils().writeAttribute(writer, "ondblclick", attribute);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
 }




More information about the richfaces-svn-commits mailing list