Author: mvitenkov
Date: 2008-04-18 06:51:14 -0400 (Fri, 18 Apr 2008)
New Revision: 7925
Added:
branches/3.1.x/test-applications/jsp/src/main/java/util/converter/inputNumberSpinnerConverter.java
Log:
+inputNumberSpinnerConverter
Added:
branches/3.1.x/test-applications/jsp/src/main/java/util/converter/inputNumberSpinnerConverter.java
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/java/util/converter/inputNumberSpinnerConverter.java
(rev 0)
+++
branches/3.1.x/test-applications/jsp/src/main/java/util/converter/inputNumberSpinnerConverter.java 2008-04-18
10:51:14 UTC (rev 7925)
@@ -0,0 +1,27 @@
+package util.converter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+//import inputNumberSpinner.*;
+
+import util.data.Data;
+
+public class inputNumberSpinnerConverter implements Converter {
+
+ public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
+ String [] str = arg2.split(":");
+ System.out.println("str:" + str[0]);
+ return new Data(Integer.parseInt(str[0]));
+
+ }
+
+ public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
+ String s = (String)arg2;
+ Integer val = Integer.parseInt(s);
+ System.out.println("data:" + val);
+ //InputNumberSpinner spinner = new InputNumberSpinner();
+ return val.toString();
+ }
+
+}
Show replies by date