Author: Alex.Kolonitsky
Date: 2009-07-08 08:42:12 -0400 (Wed, 08 Jul 2009)
New Revision: 14852
Added:
branches/community/3.3.X/samples/pickList-sample/src/main/java/org/richfaces/rf7472.java
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/pages/RF-7472.jsp
Modified:
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml
Log:
PickList: converter is called too much times.
https://jira.jboss.org/jira/browse/RF-7472
Added:
branches/community/3.3.X/samples/pickList-sample/src/main/java/org/richfaces/rf7472.java
===================================================================
---
branches/community/3.3.X/samples/pickList-sample/src/main/java/org/richfaces/rf7472.java
(rev 0)
+++
branches/community/3.3.X/samples/pickList-sample/src/main/java/org/richfaces/rf7472.java 2009-07-08
12:42:12 UTC (rev 14852)
@@ -0,0 +1,65 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces;
+
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+public class rf7472 {
+
+ private List<String> value;
+
+ public Converter getConvert() {
+ return new Converter() {
+ public Object getAsObject(FacesContext context,
+ UIComponent component, String newValue)
+ throws ConverterException {
+
+ System.out.println("***> toObject ** " + newValue);
+// new Exception().printStackTrace();
+
+ return newValue;
+ }
+
+ public String getAsString(FacesContext context,
+ UIComponent component, Object value)
+ throws ConverterException {
+
+ System.out.println("***> toString ** " + value.toString());
+// new Exception().printStackTrace();
+
+ return value.toString();
+ }
+ };
+ }
+
+ public List<String> getValue() {
+ return value;
+ }
+
+ public void setValue(List<String> value) {
+ this.value = value;
+ }
+}
Modified:
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-07-08
12:41:15 UTC (rev 14851)
+++
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-07-08
12:42:12 UTC (rev 14852)
@@ -8,6 +8,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>rf7472</managed-bean-name>
+ <managed-bean-class>org.richfaces.rf7472</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>skinBean</managed-bean-name>
<managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Added: branches/community/3.3.X/samples/pickList-sample/src/main/webapp/pages/RF-7472.jsp
===================================================================
--- branches/community/3.3.X/samples/pickList-sample/src/main/webapp/pages/RF-7472.jsp
(rev 0)
+++
branches/community/3.3.X/samples/pickList-sample/src/main/webapp/pages/RF-7472.jsp 2009-07-08
12:42:12 UTC (rev 14852)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/pickList"
prefix="rich"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<f:view>
+ <html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title><h:outputText value="PickList" /></title>
+ </head>
+ <body>
+ <h:form>
+ <rich:pickList value="#{rf7472.value}"
converter="#{rf7472.convert}">
+ <f:selectItem itemLabel="item-1" itemValue="item-1"
/>
+ <f:selectItem itemLabel="item-2" itemValue="item-2"
/>
+ </rich:pickList>
+ <h:commandButton value="submit();" />
+ </h:form>
+ </body>
+ </html>
+</f:view>
\ No newline at end of file