Author: ayanul
Date: 2008-03-30 10:00:46 -0400 (Sun, 30 Mar 2008)
New Revision: 7426
Added:
trunk/test-applications/jsp/src/main/java/util/converter/InplaceInputConverter.java
Modified:
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
Log:
+add converter
Added:
trunk/test-applications/jsp/src/main/java/util/converter/InplaceInputConverter.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/converter/InplaceInputConverter.java
(rev 0)
+++
trunk/test-applications/jsp/src/main/java/util/converter/InplaceInputConverter.java 2008-03-30
14:00:46 UTC (rev 7426)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package util.converter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * @author AYanul
+ *
+ */
+public class InplaceInputConverter implements Converter{
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.String)
+ */
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return value.toUpperCase();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ // TODO Auto-generated method stub
+ return (String) value;
+ }
+
+}
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-03-30
13:37:19 UTC (rev 7425)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-03-30
14:00:46 UTC (rev 7426)
@@ -8,6 +8,9 @@
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
<rich:inplaceInput
+ valueChangeListener="#{inplaceInput.valueChangeListener}"
+ converter="inplaceInputConverter"
+ converterMessage="Can't convert"
inputWidth="#{inplaceInput.inputWidth}"
maxInputWidth="#{inplaceInput.maxInputWidth}"
minInputWidth="#{inplaceInput.minInputWidth}"
@@ -33,8 +36,8 @@
</h:panelGrid>
<h:panelGrid columns="2">
<h:outputText value="value"></h:outputText>
- <h:inputText id="inplaceInputValueID"
value="#{inplaceInput.value}" onchange="submit();">
- </h:inputText>
+ <h:outputText id="inplaceInputValueID"
value="#{inplaceInput.value}" >
+ </h:outputText>
<h:outputText value="defaultLabel"></h:outputText>
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
===================================================================
---
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-03-30
13:37:19 UTC (rev 7425)
+++
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-03-30
14:00:46 UTC (rev 7426)
@@ -18,4 +18,8 @@
<converter-id>dataConverter</converter-id>
<converter-class>util.converter.DataConverter</converter-class>
</converter>
+ <converter>
+ <converter-id>inplaceInputConverter</converter-id>
+ <converter-class>util.converter.InplaceInputConverter</converter-class>
+ </converter>
</faces-config>
Show replies by date