Author: ppitonak(a)redhat.com
Date: 2010-07-26 10:07:40 -0400 (Mon, 26 Jul 2010)
New Revision: 18238
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/simple.xhtml
root/tests/metamer/trunk/application/src/main/webapp/resources/css/richJQuery.css
Modified:
root/tests/metamer/trunk/application/pom.xml
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
root/tests/metamer/trunk/application/src/main/webapp/index.xhtml
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css
root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
Log:
* index page refactored
* added ui:debug to application
* added component rich:jQuery
* added dependency on ui-misc to pom.xml
Modified: root/tests/metamer/trunk/application/pom.xml
===================================================================
--- root/tests/metamer/trunk/application/pom.xml 2010-07-26 13:07:40 UTC (rev 18237)
+++ root/tests/metamer/trunk/application/pom.xml 2010-07-26 14:07:40 UTC (rev 18238)
@@ -46,26 +46,20 @@
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>annotations</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.richfaces.ui.iteration</groupId>
- <artifactId>richfaces-ui-iteration-api</artifactId>
+ <artifactId>richfaces-ui-iteration-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.iteration</groupId>
- <artifactId>richfaces-ui-iteration-ui</artifactId>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.iteration</groupId>
- <artifactId>richfaces-ui-iteration-impl</artifactId>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
-
<dependency>
- <groupId>org.richfaces.ui.output</groupId>
- <artifactId>richfaces-ui-output-ui</artifactId>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
</dependency>
<!-- Java Server Faces 2 -->
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-07-26
13:07:40 UTC (rev 18237)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-07-26
14:07:40 UTC (rev 18238)
@@ -108,6 +108,7 @@
components.put("richDataTable", "Rich Data Table");
components.put("richExtendedDataTable", "Rich Extended Data
Table");
components.put("richFunctions", "Rich Functions");
+ components.put("richJQuery", "Rich jQuery");
components.put("richList", "Rich List");
components.put("richPanel", "Rich Panel");
}
@@ -228,6 +229,36 @@
this.components = components;
}
+ public List<String> getRichComponents() {
+ List<String> richComponents = new ArrayList<String>();
+ for (String aComponent : components.keySet()) {
+ if (aComponent.startsWith("rich")) {
+ richComponents.add(aComponent);
+ }
+ }
+ return richComponents;
+ }
+
+ public List<String> getA4JComponents() {
+ List<String> a4jComponents = new ArrayList<String>();
+ for (String aComponent : components.keySet()) {
+ if (aComponent.startsWith("a4j")) {
+ a4jComponents.add(aComponent);
+ }
+ }
+ return a4jComponents;
+ }
+
+ public List<String> getOtherComponents() {
+ List<String> otherComponents = new ArrayList<String>();
+ for (String aComponent : components.keySet()) {
+ if (!aComponent.startsWith("rich") &&
!aComponent.startsWith("a4j")) {
+ otherComponents.add(aComponent);
+ }
+ }
+ return otherComponents;
+ }
+
public String getContainer() {
return container;
}
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java 2010-07-26
14:07:40 UTC (rev 18238)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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 java.util.UUID;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIJQuery;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:jQuery.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>,
Nick Belaevski
+ * @version $Revision$
+ */
+@ManagedBean(name = "richJQueryBean")
+@ViewScoped
+public class RichJQueryBean implements Serializable {
+
+ private static final long serialVersionUID = 111475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private List<String> componentsDataList;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ componentsDataList = new ArrayList<String>();
+ addComponent();
+
+ attributes = Attributes.getUIComponentAttributes(UIJQuery.class, getClass());
+
+ attributes.setAttribute("event", "click");
+ attributes.setAttribute("name", "bubu");
+ attributes.setAttribute("query", "alert('immediate
attachment')");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("selector", "#jQueryTestButton");
+ attributes.setAttribute("timing", "immediate");
+
+ // TODO must be tested in other way
+ attributes.remove("name");
+
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<String> getComponentsDataList() {
+ return componentsDataList;
+ }
+
+ public void addComponent() {
+ componentsDataList.add(UUID.randomUUID().toString());
+ }
+}
Property changes on:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/list.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/list.xhtml 2010-07-26
14:07:40 UTC (rev 18238)
@@ -0,0 +1,17 @@
+<!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:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core">
+
+<h:head>
+ <title>Rich jQuery</title>
+ <meta http-equiv="Content-Type" content="text/xhtml;
charset=UTF-8" />
+ <h:outputStylesheet library="css" name="list.css" />
+</h:head>
+
+<h:body>
+
+ <h:link outcome="simple" value="Simple"
styleClass="link"/>
+ <div class="description">Simple page that contains
<b>rich:jQuery</b> and inputs for all its attributes.</div>
+
+</h:body>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richJQuery/simple.xhtml 2010-07-26
14:07:40 UTC (rev 18238)
@@ -0,0 +1,71 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp"
xmlns:misc="http://richfaces.org/misc">
+
+ <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>
+ <h:outputStylesheet library="css"
name="richJQuery.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <fieldset id="simpleJQueryFieldset">
+ <legend>jQuery (settings below)</legend>
+
+ <input id="jQueryTestButton" type="button"
value="Click here"/>
+
+ <input id="rebindOneClickButton" type="button"
onclick="rebindOneClickEvent(); return false;" value="Re-enable one-typed
click handler"/>
+
+ <misc:jQuery id="jQuery"
+
attachType="#{richJQueryBean.attributes['attachType'].value}"
+
event="#{richJQueryBean.attributes['event'].value}"
+
query="#{richJQueryBean.attributes['query'].value}"
+
rendered="#{richJQueryBean.attributes['rendered'].value}"
+
selector="#{richJQueryBean.attributes['selector'].value}"
+
timing="#{richJQueryBean.attributes['timing'].value}"
+ />
+
+ <misc:jQuery id="rebindJQuery" event="click"
name="rebindOneClickEvent" selector="#jQueryTestButton"
query="alert('one attachType rebound event')" attachType="one"
/>
+ </fieldset>
+
+ <br/>
+
+ <fieldset id="dataTestingFieldset">
+ <legend>testing data</legend>
+
+ <h:panelGroup id="liveTestGroup">
+ <ui:repeat id="liveTestRepeat"
value="#{richJQueryBean.componentsDataList}" var="data">
+ <h:panelGroup styleClass="liveTestComponent"
layout="block" id="liveTestComponent">
+ #{data}
+ </h:panelGroup>
+ </ui:repeat>
+ </h:panelGroup>
+
+ <misc:jQuery id="liveTestJQuery"
selector="#liveTestGroup .liveTestComponent" attachType="live"
event="click" query="alert(jQuery(this).text())" />
+
+ <br/>
+
+ <h:commandButton id="addComponentButton" value="Add
component for live test" action="#{richJQueryBean.addComponent}">
+ <a4j:ajax render=":liveTestGroup"/>
+ </h:commandButton>
+
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ta:attributes value="#{richJQueryBean.attributes}"
id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: root/tests/metamer/trunk/application/src/main/webapp/index.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/index.xhtml 2010-07-26 13:07:40
UTC (rev 18237)
+++ root/tests/metamer/trunk/application/src/main/webapp/index.xhtml 2010-07-26 14:07:40
UTC (rev 18238)
@@ -1,5 +1,6 @@
<!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:c="http://java.sun.com/jsp/jstl/core">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:a4j="http://richfaces.org/a4j">
<h:head>
<title>Metamer: RichFaces Testing Application</title>
@@ -9,13 +10,36 @@
</h:head>
<h:body>
- <h1>Metamer: RichFaces Testing Application</h1>
+ <h1>Metamer: RichFaces Testing Application</h1>
<h:form id="linksForm">
- <h:panelGrid id="attributes">
- <c:forEach items="#{richBean.components}"
var="entry">
- <h:link outcome="/components/#{entry.key}/list"
value="#{entry.value}" styleClass="link"/>
- </c:forEach>
+ <h:panelGrid id="components" columns="3"
columnClasses="valign-top,valign-top,valign-top">
+ <h:panelGroup id="a4jComponents" layout="block"
style="width: 300px;">
+ <ul>
+ <a4j:repeat value="#{richBean.a4JComponents}"
var="comp">
+ <li><h:link
outcome="/components/#{comp}/list"
value="#{richBean.components[comp]}"
styleClass="link"/></li>
+ </a4j:repeat>
+ </ul>
+ </h:panelGroup>
+
+ <h:panelGroup id="richComponents" layout="block"
style="width: 300px;">
+ <ul>
+ <a4j:repeat value="#{richBean.richComponents}"
var="comp">
+ <li><h:link
outcome="/components/#{comp}/list"
value="#{richBean.components[comp]}"
styleClass="link"/></li>
+ </a4j:repeat>
+ </ul>
+ </h:panelGroup>
+
+ <h:panelGroup id="otherComponents" layout="block"
style="width: 300px;">
+ <ul>
+ <a4j:repeat value="#{richBean.otherComponents}"
var="comp">
+ <li><h:link
outcome="/components/#{comp}/list"
value="#{richBean.components[comp]}"
styleClass="link"/></li>
+ </a4j:repeat>
+ </ul>
+ </h:panelGroup>
</h:panelGrid>
+
+ <hr style="width: 900px; margin-left: 0px;"/>
+ #{a4j.version}
</h:form>
</h:body>
</html>
\ No newline at end of file
Modified: root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css 2010-07-26
13:07:40 UTC (rev 18237)
+++
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css 2010-07-26
14:07:40 UTC (rev 18238)
@@ -22,4 +22,8 @@
a img {
border: 0px;
+}
+
+.valign-top {
+ vertical-align: top;
}
\ No newline at end of file
Added: root/tests/metamer/trunk/application/src/main/webapp/resources/css/richJQuery.css
===================================================================
Modified: root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-07-26
13:07:40 UTC (rev 18237)
+++ root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-07-26
14:07:40 UTC (rev 18238)
@@ -12,18 +12,22 @@
</h:graphicImage>
</h:panelGrid>
- <h:panelGrid columns="2" width="180px">
- <h:outputLabel id="a4jLogLabel" for="a4jLogCheckbox"
value="Display log" />
+ <h:panelGrid columns="2" width="230px">
+ <h:outputText id="a4jLogLabel" value="Display log"
/>
<h:selectBooleanCheckbox id="a4jLogCheckbox"
value="#{richBean.log}">
<a4j:ajax event="change" execute="@this"
render="a4jLogPanel" />
</h:selectBooleanCheckbox>
- <h:outputLabel id="a4jStatusLabel" for="a4jStatus"
value="Status" />
+ <h:outputText id="a4jStatusLabel" value="Status"
/>
<a4j:status id="a4jStatus">
<f:facet name="start">
<h:outputText value="WORKING" style="color:
red;" />
</f:facet>
</a4j:status>
+
+ <h:outputText id="showUiDebugLabel" value="Show
ui:debug" />
+ <h:outputText id="showUiDebug" value="Ctrl+Shift+L"
/>
+ <ui:debug hotkey="L" />
</h:panelGrid>
<h:panelGrid columns="2">