[richfaces-svn-commits] JBoss Rich Faces SVN: r13580 - in trunk: samples/listShuttleDemo/src/main/webapp/pages and 8 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Apr 14 12:32:50 EDT 2009


Author: nbelaevski
Date: 2009-04-14 12:32:50 -0400 (Tue, 14 Apr 2009)
New Revision: 13580

Modified:
   trunk/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java
   trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
   trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
   trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
   trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
   trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
   trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
   trunk/ui/pickList/src/main/config/component/picklist.xml
   trunk/ui/pickList/src/main/resources/org/richfaces/renderkit/html/scripts/PickList.js
   trunk/ui/pickList/src/main/templates/htmlPickList.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4724
https://jira.jboss.org/jira/browse/RF-6769

Modified: trunk/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java
===================================================================
--- trunk/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java	2009-04-14 16:32:50 UTC (rev 13580)
@@ -34,15 +34,9 @@
 	private boolean fastOrderControlsVisible = true;
 
 	private boolean switchByClick = false;
+	private boolean switchByDblClick = true;
 	
-	public boolean isSwitchByClick() {
-		return switchByClick;
-	}
-
-	public void setSwitchByClick(boolean switchByClick) {
-		this.switchByClick = switchByClick;
-	}
-
+	
 	public ListShuttleDemoBean() {
 		super();
 		
@@ -178,4 +172,21 @@
 	public void setZebraItems(String[] zebraItems) {
 		this.zebraItems = zebraItems;
 	}
+	
+	public boolean isSwitchByClick() {
+		return switchByClick;
+	}
+
+	public void setSwitchByClick(boolean switchByClick) {
+		this.switchByClick = switchByClick;
+	}
+
+	public boolean isSwitchByDblClick() {
+		return switchByDblClick;
+	}
+
+	public void setSwitchByDblClick(boolean switchByDblClick) {
+		this.switchByDblClick = switchByDblClick;
+	}
+
 }

Modified: trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp	2009-04-14 16:32:50 UTC (rev 13580)
@@ -55,7 +55,8 @@
 					sourceSelection="#{listShuttleDemoBean.sourceSelection}"
 					targetSelection="#{listShuttleDemoBean.targetSelection}"
 					switchByClick="#{listShuttleDemoBean.switchByClick}"
-          
+					switchByDblClick="#{listShuttleDemoBean.switchByDblClick}"
+          			
                     bottomControlLabel="test bottomControlLabel"
                     bottomTitle="test bottomTitle"
                     
@@ -93,7 +94,7 @@
 					</script>
 				</f:verbatim>
 				
-				<h:panelGrid columns="2">
+				<h:panelGrid columns="4">
 					<h:outputText value="Order controls visible:" />
 					<h:selectBooleanCheckbox value="#{listShuttleDemoBean.orderControlsVisible}" />
 
@@ -108,6 +109,9 @@
 
 					<h:outputText value="Switch by click:" />
 					<h:selectBooleanCheckbox value="#{listShuttleDemoBean.switchByClick}" />
+					
+					<h:outputText value="Switch by double click:" />
+					<h:selectBooleanCheckbox value="#{listShuttleDemoBean.switchByDblClick}" />
 
 				</h:panelGrid>
 
@@ -120,7 +124,8 @@
 
 
 				<ls:listShuttle onlistchanged="alert(event.type)" id="listShuttle2" var="item" sourceValue="#{listShuttleDemoBean.zebraItems}" 
-						columnClasses="zebraCell1, zebraCell2" rowClasses="zebraRow1, zebraRow2" downControlClass="downControlClass">
+						columnClasses="zebraCell1, zebraCell2" rowClasses="zebraRow1, zebraRow2" downControlClass="downControlClass"
+						switchByClick="#{listShuttleDemoBean.switchByClick}" switchByDblClick="#{listShuttleDemoBean.switchByDblClick}"						>
 					<rich:column width="10px">
 						<f:facet name="header">
 							<h:outputText value="Name" />

Modified: trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java	2009-04-14 16:32:50 UTC (rev 13580)
@@ -28,8 +28,10 @@
     private boolean copyVisible = true;
     private boolean removeVisible = true;
     private boolean removeAllVisible = true;
-    
-    
+    private boolean switchByClick = false;
+    private boolean switchByDblClick = true;
+
+
     private List <Animal> listValues = new ArrayList<Animal>();
     
 //    private List <String> listValues = new ArrayList<String>();
@@ -259,9 +261,23 @@
 		this.removeAllVisible = removeAllVisible;
 	}
 	
-	
-	
+    public boolean isSwitchByClick() {
+		return switchByClick;
+	}
 
+	public void setSwitchByClick(boolean switchByClick) {
+		this.switchByClick = switchByClick;
+	}
+
+	public boolean isSwitchByDblClick() {
+		return switchByDblClick;
+	}
+
+	public void setSwitchByDblClick(boolean switchByDblClick) {
+		this.switchByDblClick = switchByDblClick;
+	}
+
+
 //	public List<String> getListValues() {
 //		return listValues;
 //	}

Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp	2009-04-14 16:32:50 UTC (rev 13580)
@@ -50,8 +50,8 @@
 					<h:outputText value="remove control visible"></h:outputText>
 					<h:selectBooleanCheckbox value="#{pickBean.removeVisible}"></h:selectBooleanCheckbox>
 					
-					<h:outputText value=""></h:outputText>
-					<h:outputText value=""></h:outputText>
+					<h:outputText value="switch By Click"></h:outputText>
+					<h:selectBooleanCheckbox value="#{pickBean.switchByClick}"></h:selectBooleanCheckbox>
 					
 					<h:outputText value="set disabled"></h:outputText>
 					<h:selectBooleanCheckbox value="#{pickBean.disabled}"></h:selectBooleanCheckbox>
@@ -62,8 +62,8 @@
 					<h:outputText value="removeAll control visible"></h:outputText>
 					<h:selectBooleanCheckbox value="#{pickBean.removeAllVisible}"></h:selectBooleanCheckbox>
 					
-					<h:outputText value=""></h:outputText>
-					<h:outputText value=""></h:outputText>
+					<h:outputText value="switch By DblClick"></h:outputText>
+					<h:selectBooleanCheckbox value="#{pickBean.switchByDblClick}"></h:selectBooleanCheckbox>
 					
 				</h:panelGrid>
 			
@@ -92,6 +92,8 @@
 				copyVisible="#{pickBean.copyVisible}"
 				removeVisible="#{pickBean.removeVisible}"
 				removeAllVisible="#{pickBean.removeAllVisible}"
+				switchByClick="#{pickBean.switchByClick}"
+				switchByDblClick="#{pickBean.switchByDblClick}"
 				disabled="#{pickBean.disabled}"
 				>
 				<f:selectItems value="#{pickBean.testList}"/>

Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml	2009-04-14 16:32:50 UTC (rev 13580)
@@ -144,10 +144,16 @@
 		<property>
             <name>switchByClick</name>
             <classname>boolean</classname>
-			<description>If &quot;true&quot;, dragging between lists realized by click. Default value is &quot;false&quot;. </description>
+			<description>If &quot;true&quot;, items can be moved between the lists by clicking on them. Default value is &quot;false&quot;. </description>
             <defaultvalue>false</defaultvalue>
         </property>
         <property>
+            <name>switchByDblClick</name>
+            <classname>boolean</classname>
+			<description>If &quot;true&quot;, items can be moved between the lists by double-clicking on them. Default value is &quot;true&quot;. </description>
+            <defaultvalue>true</defaultvalue>
+        </property>
+        <property>
             <name>sourceListWidth</name>
             <classname>java.lang.String</classname>
             <description>

Modified: trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js	2009-04-14 16:32:50 UTC (rev 13580)
@@ -42,7 +42,7 @@
 }
 
 Richfaces.ListShuttle.prototype = {
-	initialize: function(targetList, sourceList, clientId, controlIds, switchByClick, events) {
+	initialize: function(targetList, sourceList, clientId, controlIds, switchByClick, switchByDblClick, events) {
 		this.containerId = clientId;
 		this["rich:destructor"] = "destroy";
 		
@@ -75,9 +75,10 @@
 			Event.stopObserving(this.sourceList.shuttleTable, "click", this.sourceList.clckHandler);
 			Event.stopObserving(this.targetList.shuttleTable, "click", this.targetList.clckHandler);
 		} else {
-			this.targetList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.targetList, this.sourceList)}.bindAsEventListener(this));
-			this.sourceList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.sourceList, this.targetList)}.bindAsEventListener(this));
-			
+			if (switchByDblClick == "true"){
+				this.targetList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.targetList, this.sourceList)}.bindAsEventListener(this));
+				this.sourceList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.sourceList, this.targetList)}.bindAsEventListener(this));
+			}
 			sourceList._onclickHandler = sourceList.onclickHandler;
 			sourceList.onclickHandler = function(e) { this.onclickHandler(e, sourceList); }.bindAsEventListener(this);
 			targetList._onclickHandler = targetList.onclickHandler;

Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2009-04-14 16:32:50 UTC (rev 13580)
@@ -50,6 +50,9 @@
 						Boolean switchByClick = (Boolean) component.getAttributes().get("switchByClick");
 						variables.setVariable("switchByClick", switchByClick);
 					
+						Boolean switchByDblClick = (Boolean) component.getAttributes().get("switchByDblClick");
+						variables.setVariable("switchByDblClick", switchByDblClick);
+						
 						variables.setVariable("baseClientId", component.getBaseClientId(context));
 					]]>
 				</jsp:scriptlet>
@@ -215,6 +218,7 @@
 										"#{clientId}", 
 										[['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
 										"#{switchByClick}", 
+										"#{switchByDblClick}",
 										{onlistchanged:#{this:getAsEventHandler(context, component, "onlistchanged")},
 										 onlistchange:#{this:getAsEventHandler(context, component, "onlistchange")},
 										 oncopyallclick:#{this:getAsEventHandler(context, component, "oncopyallclick")},

Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml	2009-04-14 16:32:50 UTC (rev 13580)
@@ -131,15 +131,21 @@
                 <defaultvalue><![CDATA[""]]></defaultvalue>
             </property> 
             
-                
-	       	<property>
+			<property>
 	            <name>switchByClick</name>
 	            <classname>boolean</classname>
-	       		<description>If &quot;true&quot;, dragging between lists realized by click. Default value is &quot;false&quot;</description>
+				<description>If &quot;true&quot;, items can be moved between the lists by clicking on them. Default value is &quot;false&quot;. </description>
 	            <defaultvalue>false</defaultvalue>
 	        </property>
 	        
 	        <property>
+	            <name>switchByDblClick</name>
+	            <classname>boolean</classname>
+				<description>If &quot;true&quot;, items can be moved between the lists by double-clicking on them. Default value is &quot;true&quot;. </description>
+	            <defaultvalue>true</defaultvalue>
+	        </property>
+	        
+	        <property>
 	            <name>sourceListWidth</name>
 	            <classname>java.lang.String</classname>
 	            <description>

Modified: trunk/ui/pickList/src/main/resources/org/richfaces/renderkit/html/scripts/PickList.js
===================================================================
--- trunk/ui/pickList/src/main/resources/org/richfaces/renderkit/html/scripts/PickList.js	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/pickList/src/main/resources/org/richfaces/renderkit/html/scripts/PickList.js	2009-04-14 16:32:50 UTC (rev 13580)
@@ -1,8 +1,8 @@
 if(!window.Richfaces) window.Richfaces = {};
 
 Richfaces.PickList = Class.create(Richfaces.ListShuttle, {
-		initialize : function($super, targetList, sourceList, clientId, controlIds, switchByClick, events, valueKeeperId) {
-			$super(targetList, sourceList, clientId, controlIds, switchByClick, events);
+		initialize : function($super, targetList, sourceList, clientId, controlIds, switchByClick, switchByDblClick, events, valueKeeperId) {
+			$super(targetList, sourceList, clientId, controlIds, switchByClick, switchByDblClick, events);
 			this.valueKeeper = $(valueKeeperId);
 			//this.controlListManager();
 		},

Modified: trunk/ui/pickList/src/main/templates/htmlPickList.jspx
===================================================================
--- trunk/ui/pickList/src/main/templates/htmlPickList.jspx	2009-04-14 16:22:27 UTC (rev 13579)
+++ trunk/ui/pickList/src/main/templates/htmlPickList.jspx	2009-04-14 16:32:50 UTC (rev 13580)
@@ -72,6 +72,9 @@
 						
 						Boolean switchByClick = (Boolean) component.getAttributes().get("switchByClick");
 						variables.setVariable("switchByClick", switchByClick);
+						
+						Boolean switchByDblClick = (Boolean) component.getAttributes().get("switchByDblClick");
+						variables.setVariable("switchByDblClick", switchByDblClick);
 					
 						variables.setVariable("baseClientId", component.getBaseClientId(context));
 					]]>
@@ -196,11 +199,15 @@
 					new Richfaces.PickList(
 						new Richfaces.PickList.Target('#{clientId}', '#{clientId}tlInternal_tab', '#{clientId}tlInternal_header_tab', '#{clientId}tlFocusKeeper', undefined, Richfaces.PickList.Target.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
 						new Richfaces.PickList.Source('#{clientId}', '#{clientId}internal_tab', '#{clientId}internal_header_tab', '#{clientId}focusKeeper', undefined, Richfaces.PickList.Source.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}), 
-						"#{clientId}", [['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
-						"#{switchByClick}", {onlistchanged: #{this:getAsEventHandler(context, component, "onlistchanged")},
-											 onlistchange: #{this:getAsEventHandler(context, component, "onlistchange")},
-											 onfocus:#{this:getAsEventHandler(context, component, "onfocus")},
-											 onblur:#{this:getAsEventHandler(context, component, "onblur")}},
+						"#{clientId}", 
+						[['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
+						"#{switchByClick}", 
+						"#{switchByDblClick}", 
+						{onlistchanged: #{this:getAsEventHandler(context, component, "onlistchanged")},
+						 onlistchange: #{this:getAsEventHandler(context, component, "onlistchange")},
+						 onfocus:#{this:getAsEventHandler(context, component, "onfocus")},
+						 onblur:#{this:getAsEventHandler(context, component, "onblur")}
+						},
 						"#{clientId}valueKeeper");
 			</script>
 		</c:if>




More information about the richfaces-svn-commits mailing list