[richfaces-svn-commits] JBoss Rich Faces SVN: r18752 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 5 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Aug 18 08:40:01 EDT 2010


Author: ppitonak at redhat.com
Date: 2010-08-18 08:40:00 -0400 (Wed, 18 Aug 2010)
New Revision: 18752

Added:
   modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
   modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/
   modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/facets.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/simple.xhtml
Modified:
   modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
   modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
Log:
* added 2 new pages for rich:inplaceInput
* added rich:inplaceInput to rich:dataTable, rich:extendedDataTable, h:dataTable and rich:subTable



Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-18 12:22:19 UTC (rev 18751)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-18 12:40:00 UTC (rev 18752)
@@ -114,6 +114,7 @@
         components.put("richDataTable", "Rich Data Table");
         components.put("richExtendedDataTable", "Rich Extended Data Table");
         components.put("richFunctions", "Rich Functions");
+        components.put("richInplaceInput", "Rich Inplace Input");
         components.put("richJQuery", "Rich jQuery");
         components.put("richList", "Rich List");
         components.put("richPanel", "Rich Panel");

Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java	2010-08-18 12:40:00 UTC (rev 18752)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.component.UIInplaceInput;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inplaceInput.
+ *
+ * @author <a href="mailto:ppitonak at redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+ at ManagedBean(name = "richInplaceInputBean")
+ at SessionScoped
+public class RichInplaceInputBean implements Serializable {
+
+    private static final long serialVersionUID = -1L;
+    private static Logger logger;
+    private Attributes attributes;
+
+    /**
+     * Initializes the managed bean.
+     */
+    @PostConstruct
+    public void init() {
+        logger = LoggerFactory.getLogger(getClass());
+        logger.debug("initializing bean " + getClass().getName());
+
+        attributes = Attributes.getUIComponentAttributes(UIInplaceInput.class, getClass());
+
+        attributes.setAttribute("defaultLabel", "Click here to edit");
+        attributes.setAttribute("editEvent", "click");
+        attributes.setAttribute("rendered", true);
+        attributes.setAttribute("value", "RichFaces 4");
+
+    }
+
+    public Attributes getAttributes() {
+        return attributes;
+    }
+
+    public void setAttributes(Attributes attributes) {
+        this.attributes = attributes;
+    }
+}


Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
___________________________________________________________________
Name: svn:keywords
   + Revision

Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml	2010-08-18 12:22:19 UTC (rev 18751)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -113,10 +113,11 @@
                     <f:facet name="header">
                         <h:outputText id="columnHeaderName" value="Name" />
                         <br/>
-                        <h:outputText id="columnHeaderNameComponent" value="h:inplaceInput" />
+                        <h:outputText id="columnHeaderNameComponent" value="rich:inplaceInput" />
                     </f:facet>
 
-                    <h:outputText value="#{record.name}" />
+                    <rich:inplaceInput id="nameInput" value="#{record.name}" defaultLabel="Click here to edit"/>
+
                     <f:facet name="footer">
                         <h:outputText id="columnFooterState" value="Name" />
                     </f:facet>

Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml	2010-08-18 12:22:19 UTC (rev 18751)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -101,10 +101,11 @@
                     <f:facet name="header">
                         <h:outputText id="columnHeaderName" value="Name" />
                         <br/>
-                        <h:outputText id="columnHeaderNameComponent" value="h:inplaceInput" />
+                        <h:outputText id="columnHeaderNameComponent" value="rich:inplaceInput" />
                     </f:facet>
 
-                    <h:outputText value="#{record.name}" />
+                    <rich:inplaceInput id="nameInput" value="#{record.name}" defaultLabel="Click here to edit"/>
+
                     <f:facet name="footer">
                         <h:outputText id="columnFooterState" value="Name" />
                     </f:facet>

Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml	2010-08-18 12:22:19 UTC (rev 18751)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -101,10 +101,11 @@
                     <f:facet name="header">
                         <h:outputText id="columnHeaderName" value="Name" />
                         <br/>
-                        <h:outputText id="columnHeaderNameComponent" value="h:inplaceInput" />
+                        <h:outputText id="columnHeaderNameComponent" value="rich:inplaceInput" />
                     </f:facet>
 
-                    <h:outputText value="#{record.name}" />
+                    <rich:inplaceInput id="nameInput" value="#{record.name}" defaultLabel="Click here to edit"/>
+                    
                     <f:facet name="footer">
                         <h:outputText id="columnFooterState" value="Name" />
                     </f:facet>

Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/facets.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/facets.xhtml	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/facets.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -0,0 +1,85 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+      xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+    <ui:composition template="/templates/template.xhtml">
+
+        <ui:define name="head">
+            <f:metadata>
+                <f:viewParam name="templates" value="#{templateBean.templates}">
+                    <f:converter converterId="templatesListConverter" />
+                </f:viewParam>
+            </f:metadata>
+        </ui:define>
+
+        <ui:define name="outOfTemplateBefore">
+        </ui:define>
+
+        <ui:define name="component">
+            <rich:inplaceInput id="inplaceInput"
+                               converter="#{richInplaceInputBean.attributes['converter'].value}"
+                               converterMessage="#{richInplaceInputBean.attributes['converterMessage'].value}"
+                               defaultLabel="#{richInplaceInputBean.attributes['defaultLabel'].value}"
+                               editEvent="#{richInplaceInputBean.attributes['editEvent'].value}"
+                               immediate="#{richInplaceInputBean.attributes['immediate'].value}"
+                               localValue="#{richInplaceInputBean.attributes['localValue'].value}"
+                               localValueSet="#{richInplaceInputBean.attributes['localValueSet'].value}"
+                               rendered="#{richInplaceInputBean.attributes['rendered'].value}"
+                               required="#{richInplaceInputBean.attributes['required'].value}"
+                               requiredMessage="#{richInplaceInputBean.attributes['requiredMessage'].value}"
+                               showControls="#{richInplaceInputBean.attributes['showControls'].value}"
+                               state="#{richInplaceInputBean.attributes['state'].value}"
+                               submittedValue="#{richInplaceInputBean.attributes['submittedValue'].value}"
+                               tabIndex="#{richInplaceInputBean.attributes['tabIndex'].value}"
+                               valid="#{richInplaceInputBean.attributes['valid'].value}"
+                               validator="#{richInplaceInputBean.attributes['validator'].value}"
+                               validatorMessage="#{richInplaceInputBean.attributes['validatorMessage'].value}"
+                               validators="#{richInplaceInputBean.attributes['validators'].value}"
+                               value="#{richInplaceInputBean.attributes['value'].value}"
+                               valueChangeListener="#{richInplaceInputBean.attributes['valueChangeListener'].value}"
+                               valueChangeListeners="#{richInplaceInputBean.attributes['valueChangeListeners'].value}"
+                               >
+                <f:facet name="controls">
+                    <button onmousedown="#{rich:component('inplaceInput')}.save();" type="button">Save</button>
+                    <button onmousedown="#{rich:component('inplaceInput')}.cancel();" type="button">Cancel</button>
+                </f:facet>
+
+                <ui:remove>
+                    <a4j:ajax id="inplaceInputAjax" event="change" render="output"/>
+                </ui:remove>
+            </rich:inplaceInput>
+
+            <br/><br/>
+
+            output: <h:outputText id="output" value="#{richInplaceInputBean.attributes['value'].value}"/>
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            <metamer:attributes value="#{richInplaceInputBean.attributes}" id="attributes" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file

Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -0,0 +1,45 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+    <ui:composition template="/templates/list.xhtml">
+
+        <ui:define name="pageTitle">Rich Inplace Input</ui:define>
+
+        <ui:define name="links">
+
+            <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+                Simple page that contains <b>rich:inplaceInput</b> and input boxes for all its attributes.
+            </metamer:testPageLink>
+
+            <metamer:testPageLink id="facets" outcome="facets" value="Facets">
+                Simple page that contains <b>rich:inplaceInput</b> with defined facets and input boxes for all its attributes.
+            </metamer:testPageLink>
+
+        </ui:define>
+
+    </ui:composition>
+
+</html>

Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/simple.xhtml	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/simple.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -0,0 +1,80 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+      xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+    <ui:composition template="/templates/template.xhtml">
+
+        <ui:define name="head">
+            <f:metadata>
+                <f:viewParam name="templates" value="#{templateBean.templates}">
+                    <f:converter converterId="templatesListConverter" />
+                </f:viewParam>
+            </f:metadata>
+        </ui:define>
+
+        <ui:define name="outOfTemplateBefore">
+        </ui:define>
+
+        <ui:define name="component">
+            <rich:inplaceInput id="inplaceInput"
+                               converter="#{richInplaceInputBean.attributes['converter'].value}"
+                               converterMessage="#{richInplaceInputBean.attributes['converterMessage'].value}"
+                               defaultLabel="#{richInplaceInputBean.attributes['defaultLabel'].value}"
+                               editEvent="#{richInplaceInputBean.attributes['editEvent'].value}"
+                               immediate="#{richInplaceInputBean.attributes['immediate'].value}"
+                               localValue="#{richInplaceInputBean.attributes['localValue'].value}"
+                               localValueSet="#{richInplaceInputBean.attributes['localValueSet'].value}"
+                               rendered="#{richInplaceInputBean.attributes['rendered'].value}"
+                               required="#{richInplaceInputBean.attributes['required'].value}"
+                               requiredMessage="#{richInplaceInputBean.attributes['requiredMessage'].value}"
+                               showControls="#{richInplaceInputBean.attributes['showControls'].value}"
+                               state="#{richInplaceInputBean.attributes['state'].value}"
+                               submittedValue="#{richInplaceInputBean.attributes['submittedValue'].value}"
+                               tabIndex="#{richInplaceInputBean.attributes['tabIndex'].value}"
+                               valid="#{richInplaceInputBean.attributes['valid'].value}"
+                               validator="#{richInplaceInputBean.attributes['validator'].value}"
+                               validatorMessage="#{richInplaceInputBean.attributes['validatorMessage'].value}"
+                               validators="#{richInplaceInputBean.attributes['validators'].value}"
+                               value="#{richInplaceInputBean.attributes['value'].value}"
+                               valueChangeListener="#{richInplaceInputBean.attributes['valueChangeListener'].value}"
+                               valueChangeListeners="#{richInplaceInputBean.attributes['valueChangeListeners'].value}"
+                               >
+                <ui:remove>
+                    <a4j:ajax id="inplaceInputAjax" event="change" render="output"/>
+                </ui:remove>
+            </rich:inplaceInput>
+
+            <br/><br/>
+
+            output: <h:outputText id="output" value="#{richInplaceInputBean.attributes['value'].value}"/>
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            <metamer:attributes value="#{richInplaceInputBean.attributes}" id="attributes" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file

Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml	2010-08-18 12:22:19 UTC (rev 18751)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml	2010-08-18 12:40:00 UTC (rev 18752)
@@ -23,7 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
-      xmlns:rich="http://richfaces.org/rich">
+      xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
 
     <ui:composition template="/templates/template.xhtml">
 
@@ -55,7 +55,7 @@
                         <rich:column>
                             <h:outputText id="columnHeaderName" value="Name" />
                             <br/>
-                            <h:outputText id="columnHeaderNameComponent" value="h:inplaceInput" />
+                            <h:outputText id="columnHeaderNameComponent" value="rich:inplaceInput" />
                         </rich:column>
                         <rich:column>
                             <h:outputText id="columnHeaderTitle" value="Title" />
@@ -118,7 +118,7 @@
                         <h:outputText value="#{item.sex}" />
                     </rich:column>
                     <rich:column>
-                        <h:outputText value="#{item.name}" />
+                        <rich:inplaceInput id="nameInput" value="#{item.name}" defaultLabel="Click here to edit"/>
                     </rich:column>
                     <rich:column>
                         <h:outputText value="#{item.title}" />



More information about the richfaces-svn-commits mailing list