Author: ppitonak(a)redhat.com
Date: 2011-04-11 08:14:47 -0400 (Mon, 11 Apr 2011)
New Revision: 22405
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
https://issues.jboss.org/browse/RFPL-1239
new sample for rich:message added
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 2011-04-11
04:14:31 UTC (rev 22404)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-04-11
12:14:47 UTC (rev 22405)
@@ -146,6 +146,7 @@
components.put("richMenuGroup", "Rich Menu Group");
components.put("richMenuItem", "Rich Menu Item");
components.put("richMenuSeparator", "Rich Menu Separator");
+ components.put("richMessage", "Rich Message");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
components.put("richPanelMenuGroup", "Rich Panel Menu
Group");
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java 2011-04-11
12:14:47 UTC (rev 22405)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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 javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIRichMessage;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple bean for rich:message component example.
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMessageBean")
+@ViewScoped
+public class RichMessageBean {
+
+ private static Logger logger;
+ private Attributes attributes;
+ private String simpleInput1;
+ private String simpleInput2;
+
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.info("initializing bean " + getClass().getName());
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIRichMessage.class, getClass());
+
+ // to get working this component example correctly is required that for
+ // property has been initialized
+ attributes.setAttribute("for", "simpleInput1");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("showSummary", true);
+ attributes.setAttribute("ajaxRendered", true); // make sense for
a4j:commandButton submit
+
+ // workaround for missing attribute def from rich.taglib.xml
+ // to get it in list of attrs in metamer
+ attributes.setAttribute("childCount", 0);
+ attributes.setAttribute("children", null);
+ attributes.setAttribute("dir", null); // direction
+ attributes.setAttribute("facets", null);
+ attributes.setAttribute("family", null);
+ attributes.setAttribute("lang", null);
+ attributes.setAttribute("onclick", null);
+ attributes.setAttribute("ondblclick", null);
+ attributes.setAttribute("onkeydown", null);
+ attributes.setAttribute("onkeypress", null);
+ attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onmousedown", null);
+ attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmouseout", null);
+ attributes.setAttribute("onmouseover", null);
+ attributes.setAttribute("onmouseup", null);
+ // attributes.setAttribute("parent", null);
+ attributes.setAttribute("rendererType", null);
+ attributes.setAttribute("rendersChildren", null);
+ attributes.setAttribute("style", null);
+ attributes.setAttribute("styleClass", null);
+ attributes.setAttribute("title", null);
+
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public String getSimpleInput2() {
+ return simpleInput2;
+ }
+
+ public void setSimpleInput2(String simpleInput2) {
+ this.simpleInput2 = simpleInput2;
+ }
+
+ public String getSimpleInput1() {
+ return simpleInput1;
+ }
+
+ public void setSimpleInput1(String simpleInput1) {
+ this.simpleInput1 = simpleInput1;
+ }
+}
Property changes on:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
___________________________________________________________________
Added: svn:keywords
+ Revision
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml 2011-04-11
12:14:47 UTC (rev 22405)
@@ -0,0 +1,158 @@
+<?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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
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">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:message id="simpleInputMsg"
+
ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+
for="#{richMessageBean.attributes['for'].value}"
+
keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+
rendered="#{richMessageBean.attributes['rendered'].value}"
+
showDetail="#{richMessageBean.attributes['showDetail'].value}"
+
showSummary="#{richMessageBean.attributes['showSummary'].value}"
+
childCount="#{richMessageBean.attributes['childCount'].value}"
+
children="#{richMessageBean.attributes['children'].value}"
+
dir="#{richMessageBean.attributes['dir'].value}"
+
facets="#{richMessageBean.attributes['facets'].value}"
+
family="#{richMessageBean.attributes['family'].value}"
+
lang="#{richMessageBean.attributes['lang'].value}"
+
onclick="#{richMessageBean.attributes['onclick'].value}"
+
ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+
onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+
onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+
onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+
onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+
onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+
onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+
onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+
onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+
rendererType="#{richMessageBean.attributes['rendererType'].value}"
+
rendersChildren="#{richMessageBean.attributes['rendersChildren'].value}"
+
style="#{richMessageBean.attributes['style'].value}"
+
styleClass="#{richMessageBean.attributes['styleClass'].value}"
+
title="#{richMessageBean.attributes['title'].value}"
+ />
+ <!-- ajax input, kombinacia a4j a input -->
+ <h:panelGrid columns="3">
+ <h:outputLabel for="simpleInput1" value="Simple Input
1" />
+ <h:inputText id="simpleInput1"
value="#{richMessageBean.simpleInput1}" label="Input 1" >
+ <f:validateLength maximum="5" minimum="2"
/>
+ </h:inputText>
+ <rich:message id="simpleInputMsg1"
+
ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput1"
+
keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+
rendered="#{richMessageBean.attributes['rendered'].value}"
+
showDetail="#{richMessageBean.attributes['showDetail'].value}"
+
showSummary="#{richMessageBean.attributes['showSummary'].value}"
+
childCount="#{richMessageBean.attributes['childCount'].value}"
+
children="#{richMessageBean.attributes['children'].value}"
+
dir="#{richMessageBean.attributes['dir'].value}"
+
facets="#{richMessageBean.attributes['facets'].value}"
+
family="#{richMessageBean.attributes['family'].value}"
+
lang="#{richMessageBean.attributes['lang'].value}"
+
onclick="#{richMessageBean.attributes['onclick'].value}"
+
ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+
onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+
onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+
onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+
onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+
onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+
onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+
onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+
onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+
rendererType="#{richMessageBean.attributes['rendererType'].value}"
+
rendersChildren="#{richMessageBean.attributes['rendersChildren'].value}"
+
styleClass="#{richMessageBean.attributes['styleClass'].value}"
+
style="#{richMessageBean.attributes['style'].value}"
+
title="#{richMessageBean.attributes['title'].value}"
+ />
+ </h:panelGrid>
+
+ <h:panelGrid columns="3">
+ <h:outputLabel for="simpleInput2" value="Simple Input
2" />
+ <h:inputText id="simpleInput2"
value="#{richMessageBean.simpleInput2}" label="Input 2" >
+ <f:validateLength maximum="5" minimum="2"
/>
+ </h:inputText>
+ <rich:message id="simpleInputMsg2"
+
ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput2"
+
keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+
rendered="#{richMessageBean.attributes['rendered'].value}"
+
showDetail="#{richMessageBean.attributes['showDetail'].value}"
+
showSummary="#{richMessageBean.attributes['showSummary'].value}"
+
childCount="#{richMessageBean.attributes['childCount'].value}"
+
children="#{richMessageBean.attributes['children'].value}"
+
dir="#{richMessageBean.attributes['dir'].value}"
+
facets="#{richMessageBean.attributes['facets'].value}"
+
family="#{richMessageBean.attributes['family'].value}"
+
lang="#{richMessageBean.attributes['lang'].value}"
+
onclick="#{richMessageBean.attributes['onclick'].value}"
+
ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+
onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+
onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+
onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+
onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+
onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+
onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+
onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+
onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+
rendererType="#{richMessageBean.attributes['rendererType'].value}"
+
rendersChildren="#{richMessageBean.attributes['rendersChildren'].value}"
+
styleClass="#{richMessageBean.attributes['styleClass'].value}"
+
style="#{richMessageBean.attributes['style'].value}"
+
title="#{richMessageBean.attributes['title'].value}"
+ />
+ </h:panelGrid>
+
+ <br/>
+
+ <h:commandButton id="hButton" value="h:commandButton"
style="margin-right: 10px;"/>
+ <a4j:commandButton id="a4jButton"
value="a4j:commandButton"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richMessageBean.attributes}"
id="attributes"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml 2011-04-11
12:14:47 UTC (rev 22405)
@@ -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-2011, 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 Message</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="jsfValidator"
outcome="jsfValidator" value="Simple JSF Validation">
+ Page containing inputs with simple JSF validators and
<b>rich:message</b>s.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>