Author: ppitonak(a)redhat.com
Date: 2010-11-03 11:01:37 -0400 (Wed, 03 Nov 2010)
New Revision: 19914
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/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/RF-9246
* added 1 page for rich:select
* added rich:select 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-11-03
14:27:36 UTC (rev 19913)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03
15:01:37 UTC (rev 19914)
@@ -133,6 +133,7 @@
components.put("richPanel", "Rich Panel");
components.put("richPopupPanel", "Rich Popup Panel");
components.put("richProgressBar", "Rich Progress Bar");
+ components.put("richSelect", "Rich Select");
components.put("richSubTable", "Rich Subtable");
components.put("richSubTableToggleControl", "Rich Subtable Toggle
Control");
components.put("richTab", "Rich Tab");
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java 2010-11-03
15:01:37 UTC (rev 19914)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+import org.richfaces.component.UISelect;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:select.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richSelectBean")
+@SessionScoped
+public class RichSelectBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals;
+ private List<SelectItem> capitalsOptions = null;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ capitalsOptions = new ArrayList<SelectItem>();
+ for (Capital capital : capitals) {
+ capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
+ }
+
+ attributes = Attributes.getUIComponentAttributes(UISelect.class, getClass(),
false);
+
+ attributes.setAttribute("defaultLabel", "Click here to
edit");
+ attributes.setAttribute("rendered", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("validator");
+
+ attributes.remove("valueChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+
+ public List<SelectItem> getCapitalsOptions() {
+ return capitalsOptions;
+ }
+
+ public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
+ this.capitalsOptions = capitalsOptions;
+ }
+
+ public void listener(ValueChangeEvent event) {
+ RichBean.logToPage("* value changed: " + event.getOldValue() + "
-> " + event.getNewValue());
+ }
+}
Property changes on:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.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-11-03
14:27:36 UTC (rev 19913)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -128,10 +128,14 @@
<f:facet name="header">
<h:outputText id="columnHeaderTitle"
value="Title" />
<br/>
- <h:outputText id="columnHeaderTitleComponent"
value="rich:inplaceSelect" />
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:select" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:select id="title"
value="#{record.title}">
+ <f:selectItems
value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change"
render="@this"/>
+ </rich:select>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle"
value="Title" />
</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-11-03
14:27:36 UTC (rev 19913)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -106,7 +106,7 @@
<h:outputText id="columnHeaderNameComponent"
value="h:outputText" />
</f:facet>
- <h:outputText value="#{record.name}" />
+ <h:outputText id="name" value="#{record.name}"
/>
<f:facet name="footer">
<h:outputText id="columnFooterState"
value="Name" />
</f:facet>
@@ -116,10 +116,14 @@
<f:facet name="header">
<h:outputText id="columnHeaderTitle"
value="Title" />
<br/>
- <h:outputText id="columnHeaderTitleComponent"
value="rich:inplaceSelect" />
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:select" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:select id="title"
value="#{record.title}">
+ <f:selectItems
value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change"
render="@this"/>
+ </rich:select>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle"
value="Title" />
</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-11-03
14:27:36 UTC (rev 19913)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -58,6 +58,11 @@
width: 150px !important;
}
+ .rf-edt-c-columnTitle {
+ width: 210px !important;
+ text-align: center;
+ }
+
.rf-edt-c-columnSmoker {
text-align: center;
width: 150px !important;
@@ -69,7 +74,13 @@
.rf-edt-c-columnNumberOfKids {
width: 150px !important;
+ text-align: center;
+ vertical-align: middle;
}
+
+ .rf-sel-fld {
+ width: 180px !important;
+ }
</style>
</ui:define>
@@ -150,12 +161,29 @@
<h:outputText id="columnHeaderNameComponent"
value="h:outputText" />
</f:facet>
- <h:outputText value="#{record.name}" />
+ <h:outputText id="name" value="#{record.name}"
/>
<f:facet name="footer">
<h:outputText id="columnFooterState"
value="Name" />
</f:facet>
</rich:column>
+ <rich:column id="columnTitle"
sortBy="#{record.title}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:select" />
+ </f:facet>
+
+ <rich:select id="title"
value="#{record.title}">
+ <f:selectItems
value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change"
render="@this"/>
+ </rich:select>
+
+ <f:facet name="footer">
+ <h:outputText id="columnFooterTitle"
value="Title" />
+ </f:facet>
+ </rich:column>
+
<rich:column id="columnSmoker"
sortBy="#{record.smoker}">
<f:facet name="header">
<h:outputText id="columnHeaderSmoker"
value="Smoker" />
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -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 Select</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page that contains <b>rich:select</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/richSelect/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -0,0 +1,102 @@
+<?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: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">
+
+ <!--
+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:select id="inplaceSelect"
+
converterMessage="#{richSelectBean.attributes['converterMessage'].value}"
+
defaultLabel="#{richSelectBean.attributes['defaultLabel'].value}"
+
enableManualInput="#{richSelectBean.attributes['editManualInput'].value}"
+
immediate="#{richSelectBean.attributes['immediate'].value}"
+
itemClass="#{richSelectBean.attributes['itemClass'].value}"
+
listClass="#{richSelectBean.attributes['listClass'].value}"
+
listHeight="#{richSelectBean.attributes['listHeight'].value}"
+
listWidth="#{richSelectBean.attributes['listWidth'].value}"
+
onblur="#{richSelectBean.attributes['onblur'].value}"
+
onchange="#{richSelectBean.attributes['onchange'].value}"
+
onclick="#{richSelectBean.attributes['onclick'].value}"
+
ondblclick="#{richSelectBean.attributes['ondblclick'].value}"
+
onfocus="#{richSelectBean.attributes['onfocus'].value}"
+
onkeydown="#{richSelectBean.attributes['onkeydown'].value}"
+
onkeypress="#{richSelectBean.attributes['onkeypress'].value}"
+
onkeyup="#{richSelectBean.attributes['onkeyup'].value}"
+
onlistclick="#{richSelectBean.attributes['onlistclick'].value}"
+
onlistdblclick="#{richSelectBean.attributes['onlistdblclick'].value}"
+
onlistkeydown="#{richSelectBean.attributes['onlistkeydown'].value}"
+
onlistkeypress="#{richSelectBean.attributes['onlistkeypress'].value}"
+
onlistkeyup="#{richSelectBean.attributes['onlistkeyup'].value}"
+
onlistmousedown="#{richSelectBean.attributes['onlistmousedown'].value}"
+
onlistmousemove="#{richSelectBean.attributes['onlistmousemove'].value}"
+
onlistmouseout="#{richSelectBean.attributes['onlistmouseout'].value}"
+
onlistmouseover="#{richSelectBean.attributes['onlistmouseover'].value}"
+
onlistmouseup="#{richSelectBean.attributes['onlistmouseup'].value}"
+
onmousedown="#{richSelectBean.attributes['onmousedown'].value}"
+
onmousemove="#{richSelectBean.attributes['onmousemove'].value}"
+
onmouseout="#{richSelectBean.attributes['onmouseout'].value}"
+
onmouseover="#{richSelectBean.attributes['onmouseover'].value}"
+
onmouseup="#{richSelectBean.attributes['onmouseup'].value}"
+
onselect="#{richSelectBean.attributes['onselect'].value}"
+
rendered="#{richSelectBean.attributes['rendered'].value}"
+
required="#{richSelectBean.attributes['required'].value}"
+
requiredMessage="#{richSelectBean.attributes['requiredMessage'].value}"
+
selectFirst="#{richSelectBean.attributes['selectFirst'].value}"
+
selectItemClass="#{richSelectBean.attributes['selectItemClass'].value}"
+
showButton="#{richSelectBean.attributes['showButton'].value}"
+
validatorMessage="#{richSelectBean.attributes['validatorMessage'].value}"
+
value="#{richSelectBean.attributes['value'].value}"
+ valueChangeListener="#{richSelectBean.listener}"
+ >
+
+ <f:selectItems value="#{richSelectBean.capitalsOptions}"
/>
+ <a4j:ajax event="change" render="output"/>
+
+ </rich:select>
+
+ <br/><br/>
+
+ output: <h:outputText id="output"
value="#{richSelectBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSelectBean.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-11-03
14:27:36 UTC (rev 19913)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-11-03
15:01:37 UTC (rev 19914)
@@ -122,7 +122,10 @@
<h:outputText id="name"
value="#{item.name}" />
</rich:column>
<rich:column id="columnTitle">
- <h:outputText value="#{item.title}" />
+ <rich:select id="title"
value="#{item.title}">
+ <f:selectItems
value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change"
render="@this"/>
+ </rich:select>
</rich:column>
<rich:column id="columnSmoker">
<h:selectBooleanCheckbox id="smokerCheckbox"
value="#{item.smoker}">