Author: lfryc(a)redhat.com
Date: 2010-07-10 14:05:56 -0400 (Sat, 10 Jul 2010)
New Revision: 17811
Modified:
root/tests/metamer/trunk/pom.xml
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/commandlink/LinkBean.java
root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml
root/tests/metamer/trunk/src/main/webapp/commandLink/attributes.xhtml
root/tests/metamer/trunk/src/main/webapp/commandLink/dataTable.xhtml
root/tests/metamer/trunk/src/main/webapp/commandLink/plain.xhtml
root/tests/metamer/trunk/src/main/webapp/includes/header.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
Log:
JBQA-3172 * fixed page with data table
Modified: root/tests/metamer/trunk/pom.xml
===================================================================
--- root/tests/metamer/trunk/pom.xml 2010-07-10 18:05:04 UTC (rev 17810)
+++ root/tests/metamer/trunk/pom.xml 2010-07-10 18:05:56 UTC (rev 17811)
@@ -4,12 +4,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>examples</artifactId>
- <groupId>org.richfaces</groupId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>examples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.testapps</groupId>
<artifactId>testapp</artifactId>
<packaging>war</packaging>
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/commandlink/LinkBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/commandlink/LinkBean.java 2010-07-10
18:05:04 UTC (rev 17810)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/commandlink/LinkBean.java 2010-07-10
18:05:56 UTC (rev 17811)
@@ -23,10 +23,12 @@
package org.richfaces.testapp.commandlink;
import java.util.List;
+import java.util.Set;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.richfaces.testapp.model.People;
@@ -47,6 +49,7 @@
private String input2;
private String input3;
private People people;
+ private int id;
@PostConstruct
public void init() {
@@ -89,6 +92,14 @@
this.people.setPeople(people);
}
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
public void runTestDisabled() {
attrs = LinkAttributes.getInstanceTestDisabled();
}
@@ -99,9 +110,31 @@
return null;
}
- public void toUpperCaseActionListener (ActionEvent e) {
+ public void toUpperCaseActionListener(ActionEvent e) {
input3 = input.toUpperCase();
}
+ public String first6CharsNameAction() {
+ for (Person p : getPeople()) {
+ if (p.getId() == id) {
+ p.setUpperCaseName(p.getName().toUpperCase());
+ input = p.getName();
+ int endIndex = input.length() > 6 ? 6 : input.length();
+ input2 = (String) input.subSequence(0, endIndex);
+ p.setShortName(input2);
+ break;
+ }
+ }
+
+ return null;
+ }
+ public void toUpperCaseNameActionListener(ActionEvent e) {
+ for (Person p : getPeople()) {
+ if (p.getId() == id) {
+ p.setUpperCaseName(p.getName().toUpperCase());
+ break;
+ }
+ }
+ }
}
Modified: root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-10 18:05:04 UTC (rev
17810)
+++ root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-10 18:05:56 UTC (rev
17811)
@@ -22,6 +22,10 @@
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
+ <context-param>
+ <param-name>javax.faces.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
Modified: root/tests/metamer/trunk/src/main/webapp/commandLink/attributes.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/commandLink/attributes.xhtml 2010-07-10
18:05:04 UTC (rev 17810)
+++ root/tests/metamer/trunk/src/main/webapp/commandLink/attributes.xhtml 2010-07-10
18:05:56 UTC (rev 17811)
@@ -1,7 +1,9 @@
<ui:composition
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:rich="http://java.sun.com/jsf/composite/rich">
-
+
+ <h:outputStylesheet library="css" name="commandLink.css"
/>
+
<h:panelGrid id="attributes" columns="2">
<h:outputLabel id="disabledLabel" value="disabled"
for="disabledCheckbox" />
<h:selectBooleanCheckbox id="disabledCheckbox"
value="#{linkBean.attrs.disabled}">
@@ -10,12 +12,12 @@
<h:outputLabel id="renderedLabel" value="rendered"
for="renderedCheckbox" />
<h:selectBooleanCheckbox id="renderedCheckbox"
value="#{linkBean.attrs.rendered}">
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectBooleanCheckbox>
<h:outputLabel id="valueLabel" value="value"
for="valueInput" />
<h:inputText id="valueInput"
value="#{linkBean.attrs.value}">
- <a4j:ajax event="keyup" render="commandLink"
execute="@this" />
+ <a4j:ajax event="keyup" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="renderLabel" value="render"
for="renderSelect" />
@@ -29,12 +31,12 @@
<h:outputLabel id="focusLabel" value="focus"
for="focusInput" />
<h:inputText id="focusInput"
value="#{linkBean.attrs.focus}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="styleLabel" value="style"
for="styleInput" />
<h:inputText id="styleInput"
value="#{linkBean.attrs.style}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="styleClassLabel" value="styleClass"
for="styleClassSelect" />
@@ -43,7 +45,7 @@
<f:selectItem itemLabel="red" itemValue="red" />
<f:selectItem itemLabel="big" itemValue="big" />
<f:selectItem itemLabel="red + big" itemValue="red
big" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="langLabel" value="lang"
for="langSelect" />
@@ -52,7 +54,7 @@
<f:selectItem itemLabel="en" itemValue="en" />
<f:selectItem itemLabel="sk" itemValue="sk" />
<f:selectItem itemLabel="ru" itemValue="ru" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="hreflangLabel" value="hreflang"
for="hreflangSelect" />
@@ -61,7 +63,7 @@
<f:selectItem itemLabel="en" itemValue="en" />
<f:selectItem itemLabel="sk" itemValue="sk" />
<f:selectItem itemLabel="ru" itemValue="ru" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="charsetLabel" value="charset"
for="charsetSelect" />
@@ -70,7 +72,7 @@
<f:selectItem itemLabel="utf-8" itemValue="utf-8"
/>
<f:selectItem itemLabel="iso-8859-1"
itemValue="iso-8859-1" />
<f:selectItem itemLabel="iso-8859-2"
itemValue="iso-8859-2" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="dirLabel" value="dir"
for="dirSelect" />
@@ -78,7 +80,7 @@
<f:selectItem itemLabel="none" itemValue="" />
<f:selectItem itemLabel="ltr" itemValue="ltr" />
<f:selectItem itemLabel="rtl" itemValue="rtl" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="targetLabel" value="target"
for="targetSelect" />
@@ -86,7 +88,7 @@
<f:selectItem itemLabel="none" itemValue="" />
<f:selectItem itemLabel="_self" itemValue="_self"
/>
<f:selectItem itemLabel="_blank" itemValue="_blank"
/>
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="shapeLabel" value="shape"
for="shapeSelect" />
@@ -95,112 +97,112 @@
<f:selectItem itemLabel="rect" itemValue="rect" />
<f:selectItem itemLabel="circle" itemValue="circle"
/>
<f:selectItem itemLabel="poly" itemValue="poly" />
- <a4j:ajax even="change" render="commandLink"
execute="@this" />
+ <a4j:ajax even="change" render="panel"
execute="@this" />
</h:selectOneRadio>
<h:outputLabel id="typeLabel" value="type"
for="typeInput" />
<h:inputText id="typeInput"
value="#{linkBean.attrs.type}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="titleLabel" value="title"
for="titleInput" />
<h:inputText id="titleInput"
value="#{linkBean.attrs.title}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="accesskeyLabel" value="accesskey"
for="accesskeyInput" />
<h:inputText id="accesskeyInput"
value="#{linkBean.attrs.accesskey}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="coordsLabel" value="coords"
for="coordsInput" />
<h:inputText id="coordsInput"
value="#{linkBean.attrs.coords}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="relLabel" value="rel"
for="relInput" />
<h:inputText id="relInput"
value="#{linkBean.attrs.rel}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="revLabel" value="rev"
for="revInput" />
<h:inputText id="revInput"
value="#{linkBean.attrs.rev}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="tabindexLabel" value="tabindex"
for="tabindexInput" />
<h:inputText id="tabindexInput"
value="#{linkBean.attrs.tabindex}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onbeforedomupdateLabel"
value="onbeforedomupdate" for="onbeforedomupdateInput" />
<h:inputText id="onbeforedomupdateInput"
value="#{linkBean.attrs.onbeforedomupdate}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onblurLabel" value="onblur"
for="onblurInput" />
<h:inputText id="onblurInput"
value="#{linkBean.attrs.onblur}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onclickLabel" value="onclick"
for="onclickInput" />
<h:inputText id="onclickInput"
value="#{linkBean.attrs.onclick}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="oncompleteLabel" value="oncomplete"
for="oncompleteInput" />
<h:inputText id="oncompleteInput"
value="#{linkBean.attrs.oncomplete}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="ondblclickLabel" value="ondblclick"
for="ondblclickInput" />
<h:inputText id="ondblclickInput"
value="#{linkBean.attrs.ondblclick}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onfocusLabel" value="onfocus"
for="onfocusInput" />
<h:inputText id="onfocusInput"
value="#{linkBean.attrs.onfocus}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onkeydownLabel" value="onkeydown"
for="onkeydownInput" />
<h:inputText id="onkeydownInput"
value="#{linkBean.attrs.onkeydown}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onkeypressLabel" value="onkeypress"
for="onkeypressInput" />
<h:inputText id="onkeypressInput"
value="#{linkBean.attrs.onkeypress}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onkeyupLabel" value="onkeyup"
for="onkeyupInput" />
<h:inputText id="onkeyupInput"
value="#{linkBean.attrs.onkeyup}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onmousedownLabel" value="onmousedown"
for="onmousedownInput" />
<h:inputText id="onmousedownInput"
value="#{linkBean.attrs.onmousedown}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onmousemoveLabel" value="onmousemove"
for="onmousemoveInput" />
<h:inputText id="onmousemoveInput"
value="#{linkBean.attrs.onmousemove}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onmouseoutLabel" value="onmouseout"
for="onmouseoutInput" />
<h:inputText id="onmouseoutInput"
value="#{linkBean.attrs.onmouseout}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onmouseoverLabel" value="onmouseover"
for="onmouseoverInput" />
<h:inputText id="onmouseoverInput"
value="#{linkBean.attrs.onmouseover}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
<h:outputLabel id="onmouseupLabel" value="onmouseup"
for="onmouseupInput" />
<h:inputText id="onmouseupInput"
value="#{linkBean.attrs.onmouseup}">
- <a4j:ajax event="blur" render="commandLink"
execute="@this" />
+ <a4j:ajax event="blur" render="panel"
execute="@this" />
</h:inputText>
</h:panelGrid>
Modified: root/tests/metamer/trunk/src/main/webapp/commandLink/dataTable.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/commandLink/dataTable.xhtml 2010-07-10
18:05:04 UTC (rev 17810)
+++ root/tests/metamer/trunk/src/main/webapp/commandLink/dataTable.xhtml 2010-07-10
18:05:56 UTC (rev 17811)
@@ -3,7 +3,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://java.sun.com/jsf/composite/rich">
<h:panelGrid id="panel">
- <h:dataTable id="linkDataTable" value="#{linkBean.people}"
var="person">
+ <h:dataTable id="linkDataTable" value="#{linkBean.people}"
var="person" >
<f:facet name="header">
<h:outputText value="List of famous people" />
</f:facet>
@@ -15,12 +15,12 @@
<h:inputText id="input" value="#{person.name}"
style="width: 200px;" />
</h:column>
- <h:column>
+ <h:column id="commandLink">
<f:facet name="header">
<h:outputText value="Update" />
</f:facet>
- <a4j:commandLink id="commandLink"
action="#{linkBean.first6CharsAction}"
- actionListener="#{linkBean.toUpperCaseActionListener}"
disabled="#{linkBean.attrs.disabled}"
+ <a4j:commandLink id="commandLinka"
action="#{linkBean.first6CharsNameAction}"
+ actionListener="#{linkBean.toUpperCaseNameActionListener}"
disabled="#{linkBean.attrs.disabled}"
value="#{linkBean.attrs.value}"
style="#{linkBean.attrs.style}"
styleClass="#{linkBean.attrs.styleClass}"
lang="#{linkBean.attrs.lang}"
title="#{linkBean.attrs.title}"
dir="#{linkBean.attrs.dir}" hreflang="#{linkBean.attrs.hreflang}"
@@ -36,7 +36,10 @@
bypassUpdates="#{linkBean.attrs.bypassUpdates}"
charset="#{linkBean.attrs.charset}"
rendered="#{linkBean.attrs.rendered}"
target="#{linkBean.attrs.target}"
coords="#{linkBean.attrs.coords}"
rel="#{linkBean.attrs.rel}" rev="#{linkBean.attrs.rev}"
- shape="#{linkBean.attrs.shape}"
tabindex="#{linkBean.attrs.tabindex}" type="#{linkBean.attrs.type}"
/>
+ shape="#{linkBean.attrs.shape}"
tabindex="#{linkBean.attrs.tabindex}"
type="#{linkBean.attrs.type}">
+
+ <f:setPropertyActionListener target="#{linkBean.id}"
value="#{person.id}"/>
+ </a4j:commandLink>
</h:column>
<h:column>
@@ -52,14 +55,14 @@
</f:facet>
<h:outputText id="output2" value="#{person.name}"
/>
</h:column>
-
+
<h:column>
<f:facet name="header">
<h:outputText value="action (first 6 chars)" />
</f:facet>
<h:outputText id="output3"
value="#{person.shortName}" />
</h:column>
-
+
<h:column>
<f:facet name="header">
<h:outputText value="action listener (upper case)"
/>
@@ -74,6 +77,7 @@
</h:dataTable>
</h:panelGrid>
+
+ <a4j:commandButton value="Rerender" render="panel" />
-
</ui:composition>
\ No newline at end of file
Modified: root/tests/metamer/trunk/src/main/webapp/commandLink/plain.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/commandLink/plain.xhtml 2010-07-10 18:05:04
UTC (rev 17810)
+++ root/tests/metamer/trunk/src/main/webapp/commandLink/plain.xhtml 2010-07-10 18:05:56
UTC (rev 17811)
@@ -2,8 +2,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://java.sun.com/jsf/composite/rich">
- <h:outputStylesheet library="css" name="commandLink.css"
/>
-
<h:panelGrid id="panel" columns="2">
<h:inputText id="input" value="#{linkBean.input}" />
Modified: root/tests/metamer/trunk/src/main/webapp/includes/header.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/includes/header.xhtml 2010-07-10 18:05:04 UTC
(rev 17810)
+++ root/tests/metamer/trunk/src/main/webapp/includes/header.xhtml 2010-07-10 18:05:56 UTC
(rev 17811)
@@ -18,7 +18,7 @@
<h:panelGrid columns="2" style="width: 120px;">
<h:outputLabel id="a4jLogLabel"
for="a4jLogCheckbox" value="a4j:log" />
<h:selectBooleanCheckbox id="a4jLogCheckbox"
value="#{richBean.log}">
-<!-- <a4j:ajax event="change"
execute="@this" render="a4jLog"/>-->
+ <a4j:ajax event="change" execute="@this"
render="a4jLog"/>
</h:selectBooleanCheckbox>
<h:outputLabel id="a4jStatusLabel" for="a4jStatus"
value="a4j:status" />
<a4j:status id="a4jStatus">
Modified: root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:05:04
UTC (rev 17810)
+++ root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:05:56
UTC (rev 17811)
@@ -6,6 +6,8 @@
<h:head>
<title>Testing Application</title>
+ <meta http-equiv="content-type" content="text/html;
charset=UTF-8" />
+
</h:head>
<h:body>
@@ -13,7 +15,7 @@
<div class="header"><ui:include
src="/includes/header.xhtml" /></div>
- <div class="content"><rich:messages id="msgs" />
<h:form id="contentForm" >
+ <div class="content"><rich:messages id="msgs" />
<h:form id="contentForm">
<a4j:outputPanel id="testsPanel"
rendered="#{richBean.reTests}" layout="block">
<ui:include src="#{richBean.testsPage}" />
@@ -32,8 +34,8 @@
</h:form></div>
- <!-- <div class="log"><a4j:log id="a4jLog"
style="width: 800px; height: 300px;" popup="false"
level="ALL"-->
- <!-- rendered="#{richBean.log}" /></div>-->
+ <div class="log"><a4j:log id="a4jLog" style="width:
800px; height: 300px;" popup="false" level="ALL"
+ rendered="#{richBean.log}" /></div>
<div class="footer"><ui:insert name="footer">
RichFaces #{a4j.version}</ui:insert></div>