[richfaces-svn-commits] JBoss Rich Faces SVN: r1130 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Jun 11 14:31:30 EDT 2007


Author: konstantin.mishin
Date: 2007-06-11 14:31:30 -0400 (Mon, 11 Jun 2007)
New Revision: 1130

Modified:
   trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelection.java
   trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelectionConverter.java
Log:
Updated a server part of selection.

Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelection.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelection.java	2007-06-11 18:08:32 UTC (rev 1129)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelection.java	2007-06-11 18:31:30 UTC (rev 1130)
@@ -16,6 +16,8 @@
 	
 	private static final long serialVersionUID = 5855157282287053681L;
 
+	private String selectionFlag;
+	
 	private List ranges = new ArrayList();
 	
 	public ClientSelection() {
@@ -91,4 +93,14 @@
 		
 
 	}
+
+
+	public String getSelectionFlag() {
+		return selectionFlag;
+	}
+
+
+	public void setSelectionFlag(String selectionFlag) {
+		this.selectionFlag = selectionFlag;
+	}
 }

Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelectionConverter.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelectionConverter.java	2007-06-11 18:08:32 UTC (rev 1129)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/selection/ClientSelectionConverter.java	2007-06-11 18:31:30 UTC (rev 1130)
@@ -62,28 +62,31 @@
 		final ClientSelection clientSelection = new ClientSelection();
 		
 		String [] selections = stringSelection.split(";");
-		
-		for (int i = 0; i < selections.length; i++) {
+		int length = selections.length;
+		if (selections[length-1].length() == 1) {
+			clientSelection.setSelectionFlag(selections[length-1]);
+			length--;
+		}
+		for (int i = 0; i < length; i++) {
 			
 			String range = selections[i];
 			
-			if (range.length() == 0) {
-				continue;
-			}
-			String [] rng = range.split(",");
-			
-			try {
-				int fi = Integer.parseInt(rng[0]);
-				int il = Integer.parseInt(rng[1]);
+			if (range.length() != 0) {
+				String [] rng = range.split(",");
 				
-				if (log.isDebugEnabled()) {
-					log.debug("Parsed range " + fi + " " + il);
+				try {
+					int fi = Integer.parseInt(rng[0]);
+					int il = Integer.parseInt(rng[1]);
+					
+					if (log.isDebugEnabled()) {
+						log.debug("Parsed range " + fi + " " + il);
+					}
+					
+					clientSelection.addRange(new SelectionRange(fi, il));
+					
+				} catch (NumberFormatException e) {
+					throw new ConverterException(e);
 				}
-				
-				clientSelection.addRange(new SelectionRange(fi, il));
-				
-			} catch (NumberFormatException e) {
-				throw new ConverterException(e);
 			}
 		}
 




More information about the richfaces-svn-commits mailing list