Author: ppitonak(a)redhat.com
Date: 2010-10-04 10:30:28 -0400 (Mon, 04 Oct 2010)
New Revision: 19425
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/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/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
Log:
https://jira.jboss.org/browse/RFPL-857
* added one page for rich:inputNumberSpinner
* added spinner to h:dataTable, rich:dataTable, rich:extendedDataTable 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-10-04
13:28:04 UTC (rev 19424)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-10-04
14:30:28 UTC (rev 19425)
@@ -124,6 +124,7 @@
components.put("richFunctions", "Rich Functions");
components.put("richInplaceInput", "Rich Inplace Input");
components.put("richInputNumberSlider", "Rich Input Number
Slider");
+ components.put("richInputNumberSpinner", "Rich Input Number
Spinner");
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/RichInputNumberSpinnerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java 2010-10-04
14:30:28 UTC (rev 19425)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.ViewScoped;
+
+import org.richfaces.component.html.HtmlInputNumberSpinner;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inputNumberSpinner.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richInputNumberSpinnerBean")
+@ViewScoped
+public class RichInputNumberSpinnerBean 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(HtmlInputNumberSpinner.class,
getClass());
+
+ attributes.setAttribute("enableManualInput", true);
+ attributes.setAttribute("maxValue", 100);
+ attributes.setAttribute("minValue", 0);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("step", 1);
+
+ // TODO has to be tested in another way
+ attributes.remove("validator");
+ }
+
+ 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/RichInputNumberSpinnerBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-10-04
13:28:04 UTC (rev 19424)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -173,7 +173,10 @@
<h:outputText id="columnHeaderNumberOfKidsComponent"
value="rich:inputNumberSpinner" />
</f:facet>
- <h:outputText value="#{record.numberOfKids}" />
+ <rich:inputNumberSpinner id="spinner"
value="#{record.numberOfKids}" maxValue="5">
+ <a4j:ajax/>
+ </rich:inputNumberSpinner>
+
<f:facet name="footer">
<h:outputText id="columnFooterNumberOfKids"
value="Number of Kids" />
</f:facet>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml 2010-10-04
13:28:04 UTC (rev 19424)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -159,7 +159,9 @@
<h:outputText id="columnHeaderNumberOfKidsComponent"
value="rich:inputNumberSpinner" />
</f:facet>
- <h:outputText value="#{record.numberOfKids}" />
+ <rich:inputNumberSpinner id="spinner"
value="#{record.numberOfKids}" maxValue="5">
+ <a4j:ajax/>
+ </rich:inputNumberSpinner>
<f:facet name="footer">
<h:outputText id="columnFooterNumberOfKids"
value="Number of Kids" />
</f:facet>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2010-10-04
13:28:04 UTC (rev 19424)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -159,7 +159,10 @@
<h:outputText id="columnHeaderNumberOfKidsComponent"
value="rich:inputNumberSpinner" />
</f:facet>
- <h:outputText value="#{record.numberOfKids}" />
+ <rich:inputNumberSpinner id="spinner"
value="#{record.numberOfKids}" maxValue="5">
+ <a4j:ajax/>
+ </rich:inputNumberSpinner>
+
<f:facet name="footer">
<h:outputText id="columnFooterNumberOfKids"
value="Number of Kids" />
</f:facet>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/list.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Input Number
Spinner</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Page containing <b>rich:inputNumberSpinner</b> and input
boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSpinner/simple.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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: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"
xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+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.
+ -->
+
+ <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:inputNumberSpinner id="spinner"
+
accesskey="#{richInputNumberSpinnerBean.attributes['accesskey'].value}"
+
converter="#{richInputNumberSpinnerBean.attributes['converter'].value}"
+
converterMessage="#{richInputNumberSpinnerBean.attributes['converterMessage'].value}"
+
cycled="#{richInputNumberSpinnerBean.attributes['cycled'].value}"
+
disabled="#{richInputNumberSpinnerBean.attributes['disabled'].value}"
+
enableManualInput="#{richInputNumberSpinnerBean.attributes['enableManualInput'].value}"
+
immediate="#{richInputNumberSpinnerBean.attributes['immediate'].value}"
+
inputClass="#{richInputNumberSpinnerBean.attributes['inputClass'].value}"
+
inputSize="#{richInputNumberSpinnerBean.attributes['inputSize'].value}"
+
localValue="#{richInputNumberSpinnerBean.attributes['localValue'].value}"
+
localValueSet="#{richInputNumberSpinnerBean.attributes['localValueSet'].value}"
+
maxValue="#{richInputNumberSpinnerBean.attributes['maxValue'].value}"
+
minValue="#{richInputNumberSpinnerBean.attributes['minValue'].value}"
+
onblur="#{richInputNumberSpinnerBean.attributes['onblur'].value}"
+
onchange="#{richInputNumberSpinnerBean.attributes['onchange'].value}"
+
onclick="#{richInputNumberSpinnerBean.attributes['onclick'].value}"
+
ondblclick="#{richInputNumberSpinnerBean.attributes['ondblclick'].value}"
+
ondownclick="#{richInputNumberSpinnerBean.attributes['ondownclick'].value}"
+
onfocus="#{richInputNumberSpinnerBean.attributes['onfocus'].value}"
+
oninputclick="#{richInputNumberSpinnerBean.attributes['oninputclick'].value}"
+
oninputdblclick="#{richInputNumberSpinnerBean.attributes['oninputdblclick'].value}"
+
oninputkeydown="#{richInputNumberSpinnerBean.attributes['oninputkeydown'].value}"
+
oninputkeypress="#{richInputNumberSpinnerBean.attributes['oninputkeypress'].value}"
+
oninputkeyup="#{richInputNumberSpinnerBean.attributes['oninputkeyup'].value}"
+
oninputmousedown="#{richInputNumberSpinnerBean.attributes['oninputmousedown'].value}"
+
oninputmousemove="#{richInputNumberSpinnerBean.attributes['oninputmousemove'].value}"
+
oninputmouseout="#{richInputNumberSpinnerBean.attributes['oninputmouseout'].value}"
+
oninputmouseover="#{richInputNumberSpinnerBean.attributes['oninputmouseover'].value}"
+
oninputmouseup="#{richInputNumberSpinnerBean.attributes['oninputmouseup'].value}"
+
onmousedown="#{richInputNumberSpinnerBean.attributes['onmousedown'].value}"
+
onmousemove="#{richInputNumberSpinnerBean.attributes['onmousemove'].value}"
+
onmouseout="#{richInputNumberSpinnerBean.attributes['onmouseout'].value}"
+
onmouseover="#{richInputNumberSpinnerBean.attributes['onmouseover'].value}"
+
onmouseup="#{richInputNumberSpinnerBean.attributes['onmouseup'].value}"
+
onselect="#{richInputNumberSpinnerBean.attributes['onselect'].value}"
+
onupclick="#{richInputNumberSpinnerBean.attributes['onupclick'].value}"
+
rendered="#{richInputNumberSpinnerBean.attributes['rendered'].value}"
+
required="#{richInputNumberSpinnerBean.attributes['required'].value}"
+
requiredMessage="#{richInputNumberSpinnerBean.attributes['requiredMessage'].value}"
+
step="#{richInputNumberSpinnerBean.attributes['step'].value}"
+
style="#{richInputNumberSpinnerBean.attributes['style'].value}"
+
styleClass="#{richInputNumberSpinnerBean.attributes['styleClass'].value}"
+
submittedValue="#{richInputNumberSpinnerBean.attributes['submittedValue'].value}"
+
tabindex="#{richInputNumberSpinnerBean.attributes['tabindex'].value}"
+
valid="#{richInputNumberSpinnerBean.attributes['valid'].value}"
+
validatorMessage="#{richInputNumberSpinnerBean.attributes['validatorMessage'].value}"
+
validators="#{richInputNumberSpinnerBean.attributes['validators'].value}"
+
value="#{richInputNumberSpinnerBean.attributes['value'].value}"
+
valueChangeListener="#{richInputNumberSpinnerBean.attributes['valueChangeListener'].value}"
+
valueChangeListeners="#{richInputNumberSpinnerBean.attributes['valueChangeListeners'].value}">
+
+ <a4j:ajax render="output"/>
+
+ </rich:inputNumberSpinner>
+
+ <br/><br/>
+
+ output: <h:outputText id="output"
value="#{richInputNumberSpinnerBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes
value="#{richInputNumberSpinnerBean.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/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-10-04
13:28:04 UTC (rev 19424)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-10-04
14:30:28 UTC (rev 19425)
@@ -133,7 +133,9 @@
<h:outputText value="#{item.favoriteColor}" />
</rich:column>
<rich:column>
- <h:outputText value="#{item.numberOfKids}" />
+ <rich:inputNumberSpinner id="spinner"
value="#{item.numberOfKids}" maxValue="5">
+ <a4j:ajax/>
+ </rich:inputNumberSpinner>
</rich:column>
<f:facet name="footer">
<h:outputText value="Total of #{list[0].sex ==
'MALE' ? 'men' : 'women'}: #{list.size()}" />