JBoss Rich Faces SVN: r12150 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-08 06:17:45 -0500 (Thu, 08 Jan 2009)
New Revision: 12150
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
Log:
RF-5541
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml 2009-01-08 11:17:45 UTC (rev 12150)
@@ -0,0 +1,20 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <a4j:commandButton id="componentId" value="Button"
+ reRender="#{autoTestBean.reRender}"
+ limitToList="#{autoTestBean.limitToList}"
+ bypassUpdates="#{autoTestBean.bypassUpdate}"
+ rendered="#{autoTestBean.rendered}"
+ >
+ </a4j:commandButton>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2009-01-08 10:55:18 UTC (rev 12149)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2009-01-08 11:17:45 UTC (rev 12150)
@@ -21,14 +21,24 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
public class AjaxCommandButtonTest extends SeleniumTestBase {
+
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testRendered();
+
+ }
- @Test
+ //@Test
public void testAjaxCommandButtonComponent(Template template) {
renderPage(template);
@@ -122,5 +132,11 @@
public String getTestUrl() {
return "pages/ajaxCommandButton/ajaxButtonTest.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/ajaxCommandButton/autoTestCommandButton.xhtml";
+ }
+
}
16 years, 11 months
JBoss Rich Faces SVN: r12149 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-08 05:55:18 -0500 (Thu, 08 Jan 2009)
New Revision: 12149
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/actionParam/autoTestActionParam.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
Log:
RF-5537
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/actionParam/autoTestActionParam.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/actionParam/autoTestActionParam.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/actionParam/autoTestActionParam.xhtml 2009-01-08 10:55:18 UTC (rev 12149)
@@ -0,0 +1,16 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <h:commandButton id="submit" value="Submit">
+ <a4j:actionparam name="param" value="param" assignTo="#{autoTestBean.value}" actionListener="#{autoTestBean.actionListener}" />
+ </h:commandButton>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2009-01-08 09:19:42 UTC (rev 12148)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2009-01-08 10:55:18 UTC (rev 12149)
@@ -22,6 +22,7 @@
import org.ajax4jsf.bean.A4JActionParam;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -32,7 +33,17 @@
static final String TEST_CONVERTER_FOR_PROPER_JAVA_TYPE = "/pages/actionParam/testConverterForProperJavaType.xhtml";
+
@Test
+ public void testActionListenerInCaseOfExternalValidationFailure(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testActionListener();
+
+ }
+
+ @Test
public void testConverterAttribute(Template template) {
renderPage(TEST_CONVERTER_ATTRIBUTE, template, null);
testConverter(getParentId());
@@ -126,6 +137,17 @@
AssertTextNotEquals(paramValueId, text, "Value should be changed after each submit");
}
+
+ @Override
+ public void sendAjax() {
+ String id = getParentId() + "autoTestForm:submit";
+ clickCommandAndWait(id);
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "/pages/actionParam/autoTestActionParam.xhtml";
+ }
@Override
public String getTestUrl() {
16 years, 11 months
JBoss Rich Faces SVN: r12148 - trunk/test-applications/jsp/src/main/webapp/CustomizePage.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2009-01-08 04:19:42 -0500 (Thu, 08 Jan 2009)
New Revision: 12148
Modified:
trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
Log:
stable state
Modified: trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2009-01-08 01:45:32 UTC (rev 12147)
+++ trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2009-01-08 09:19:42 UTC (rev 12148)
@@ -1,31 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
-<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<f:view>
- <head>
- </head>
- <body>
- <h:form>
- <a4j:queue />
- <a4j:queue />
- <h:commandButton action="#" value="submit" />
- <h:panelGrid columns="2">
- <h:outputLabel for="a4jLodID" value="a4j:log"></h:outputLabel>
- <h:selectBooleanCheckbox id="a4jLodID" value="#{option.log}"
- onchange="submit();"></h:selectBooleanCheckbox>
+<jsp:root version="2.1" xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
- <a4j:status id="a4jStatusID" startText="WORK!"
- startStyle="color: red;" stopText="a4j:status"></a4j:status>
- </h:panelGrid>
- <rich:calendar requestDelay="500" ignoreDupResponses="true"
- ajaxSingle="true" mode="ajax"></rich:calendar>
- </h:form>
- <h:form><a4j:log popup="false" rendered="#{option.log}"></a4j:log></h:form>
- </body>
-</f:view>
-</html>
+ <jsp:directive.page contentType="text/html;charset=UTF-8"
+ pageEncoding="UTF-8" />
+ <jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
+ <f:view>
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <body>
+
+ <h:form id="formID">
+
+ </h:form>
+
+ </body>
+ </html>
+
+ </f:view>
+</jsp:root>
16 years, 11 months
JBoss Rich Faces SVN: r12147 - in trunk: samples/beanValidatorSample and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-01-07 20:45:32 -0500 (Wed, 07 Jan 2009)
New Revision: 12147
Added:
trunk/samples/beanValidatorSample/src/main/java/org/richfaces/PageDescriptionBean.java
trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Pages.java
trunk/samples/beanValidatorSample/src/main/webapp/css/
trunk/samples/beanValidatorSample/src/main/webapp/css/grids-min.css
trunk/samples/beanValidatorSample/src/main/webapp/css/grids.css
trunk/samples/beanValidatorSample/src/main/webapp/css/reset-fonts-grids.css
trunk/samples/beanValidatorSample/src/main/webapp/img/
trunk/samples/beanValidatorSample/src/main/webapp/img/bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/btn.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/cal-next.png
trunk/samples/beanValidatorSample/src/main/webapp/img/cal-prev.png
trunk/samples/beanValidatorSample/src/main/webapp/img/cnt.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/dtpick.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.ad.jpg
trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bar.jpg
trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.title.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/header_line.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/input.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/sdb.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/spinner.gif
trunk/samples/beanValidatorSample/src/main/webapp/img/th.bg.gif
trunk/samples/beanValidatorSample/src/main/webapp/include/
trunk/samples/beanValidatorSample/src/main/webapp/include/pagesList.xhtml
trunk/samples/beanValidatorSample/src/main/webapp/layout/
trunk/samples/beanValidatorSample/src/main/webapp/layout/pageTemplate.xhtml
trunk/samples/beanValidatorSample/src/main/webapp/layout/template.xhtml
trunk/samples/beanValidatorSample/src/main/webapp/pages/ajaxValidation.xhtml
trunk/samples/beanValidatorSample/src/main/webapp/pages/textValidation.xhtml
trunk/samples/beanValidatorSample/src/main/webapp/src/
trunk/samples/beanValidatorSample/src/main/webapp/src/org/
trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/
trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/Bean.java
Removed:
trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Bean.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java
trunk/samples/beanValidatorSample/pom.xml
trunk/samples/beanValidatorSample/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml
trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java
Log:
Improve bean validation example.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -76,4 +76,8 @@
+ type, e);
}
}
+
+ ClassLoader getClassLoader() {
+ return loader;
+ }
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -124,37 +124,23 @@
return component;
}
- // /**
- // * @return the facets
- // */
- // public List<FacetEntry> getFacets() {
- // return facets;
- // }
- //
- // /**
- // * @param facets
- // * the facets to set
- // */
- // public void setFacets(List<FacetEntry> facets) {
- // this.facets = facets;
- // }
- //
- // /**
- // * @return the children
- // */
- // public List<TreeStructureNode> getChildren() {
- // return children;
- // }
- //
- // /**
- // * @param children
- // * the children to set
- // */
- // public void setChildren(List<TreeStructureNode> children) {
- // this.children = children;
- // }
+ /**
+ * @return the facets
+ */
+ public List<FacetEntry> getFacets() {
+ return facets;
+ }
+
/**
+ * @return the children
+ */
+ public List<TreeStructureNode> getChildren() {
+ return children;
+ }
+
+
+ /**
* @return the type
*/
public String getType() {
@@ -241,7 +227,7 @@
}
@SuppressWarnings("serial")
- private static final class FacetEntry implements Externalizable {
+ static final class FacetEntry implements Externalizable {
private String name;
private TreeStructureNode node;
Modified: trunk/samples/beanValidatorSample/pom.xml
===================================================================
--- trunk/samples/beanValidatorSample/pom.xml 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/samples/beanValidatorSample/pom.xml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -21,6 +21,25 @@
<target>1.5</target>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin
+ </artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/webapp/src</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
@@ -30,10 +49,23 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+ <!--
+ <dependency> <groupId>org.richfaces.ui</groupId>
+ <artifactId>beanValidator</artifactId>
+ <version>3.3.0-SNAPSHOT</version> </dependency>
+ -->
<dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>beanValidator</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.1.0.GA</version>
+ <exclusions>
+ <!--
+ <exclusion> <artifactId>hibernate-core</artifactId>
+ <groupId>org.hibernate</groupId> </exclusion> <exclusion>
+ <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId>
+ </exclusion>
+ -->
+ </exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -45,5 +77,10 @@
<artifactId>richfaces-ui</artifactId>
<version>3.3.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>com.uwyn</groupId>
+ <artifactId>jhighlight</artifactId>
+ <version>1.0</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Deleted: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Bean.java 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Bean.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -1,29 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-/**
- * @author $Autor$
- *
- */
-public class Bean {
-
-}
\ No newline at end of file
Added: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/PageDescriptionBean.java
===================================================================
--- trunk/samples/beanValidatorSample/src/main/java/org/richfaces/PageDescriptionBean.java (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/java/org/richfaces/PageDescriptionBean.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,64 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageDescriptionBean implements Comparable<PageDescriptionBean> {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+ public String navigate() {
+ return getPath();
+ }
+
+ public String getUrl(){
+ FacesContext context = FacesContext.getCurrentInstance();
+ String actionURL = context.getApplication().getViewHandler().getActionURL(context, getPath());
+ return context.getExternalContext().encodeActionURL(actionURL);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(PageDescriptionBean o) {
+ // compare paths
+ return getPath().compareToIgnoreCase(o.getPath());
+ }
+
+}
Property changes on: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/PageDescriptionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Pages.java
===================================================================
--- trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Pages.java (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Pages.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,128 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+
+public class Pages {
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private static final Pattern TITLE_PATTERN = Pattern.compile(
+ "<h1>(.*)</h1>", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
+
+ private List<PageDescriptionBean> _jspPages;
+
+ private String _path="/pages";
+
+ private List<PageDescriptionBean> _xhtmlPages;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getExternalContext()) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+
+ return _jspPages;
+ }
+
+ private ExternalContext getExternalContext() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ ExternalContext externalContext = null;
+ if (null != facesContext) {
+ externalContext = facesContext.getExternalContext();
+ }
+ return externalContext;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getExternalContext()) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set<String> resourcePaths = getExternalContext().getResourcePaths(
+ getPath());
+ for (Iterator<String> iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getExternalContext()
+ .getResourceAsStream(page);
+ if (null != pageInputStream) {
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head, 0, readed);
+ Matcher titleMatcher = TITLE_PATTERN
+ .matcher(headString);
+ if (titleMatcher.find()
+ && titleMatcher.group(1).length() > 0) {
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ throw new FacesException(
+ "can't read directory content", e);
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // ignore it.
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ Collections.sort(jspPages);
+ return jspPages;
+ }
+
+
+}
Property changes on: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Pages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/samples/beanValidatorSample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/WEB-INF/faces-config.xml 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/samples/beanValidatorSample/src/main/webapp/WEB-INF/faces-config.xml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -22,4 +22,9 @@
<managed-bean-class>org.richfaces.MinMaxBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>pages</managed-bean-name>
+ <managed-bean-class>org.richfaces.Pages</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
</faces-config>
Added: trunk/samples/beanValidatorSample/src/main/webapp/css/grids-min.css
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/css/grids-min.css (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/css/grids-min.css 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right!
;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.y!
ui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.
first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin!
-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}s .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb!
.yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-
gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/css/grids-min.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/css/grids.css
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/css/grids.css (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/css/grids.css 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,283 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+/*
+ Note: Throughout this file, the *property filter is used to
+ give a value to IE that other browsers do not see.
+*/
+
+/*
+ Section: General Rules
+*/
+
+ body {
+ text-align:center;
+ }
+
+ #ft {
+ clear:both;
+ }
+
+/*
+ Section: Page Width Rules (#doc, #doc2, #doc3, #doc4)
+*/
+
+ /*
+ Subsection: General
+ */
+
+ #doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
+ margin:auto;
+ text-align:left;
+ width:57.69em;*width:56.25em;
+ min-width:750px;
+ }
+ /*
+ Subsection: 950 Centered (doc2)
+ */
+ #doc2 {
+ width:73.076em;*width:71.25em;
+ }
+
+ /*
+ Subsection: 100% (doc3)
+ */
+ #doc3 {
+ /* Left and Right margins are not a structural part of Grids. Without them Grids
+ works fine, but content bleeds to the very edge of the document, which often
+ impairs readability and usability. They are
+ provided because they prevent the content from "bleeding" into the browser's chrome.*/
+ margin:auto 10px;
+ width:auto;
+ }
+
+ /*
+ Subsection: 974 Centered (doc4)
+ */
+ #doc4 {
+ width:74.923em;*width:73.05em;
+ }
+
+/*
+ Section: Preset Template Rules (.yui-t[1-6])
+*/
+
+ /*
+ Subsection: General
+ */
+
+ /* to preserve source-order independence for Gecko */
+ .yui-b{position:relative;}
+ .yui-b{_position:static;}
+ .yui-main .yui-b{position:static;}
+
+ .yui-main {width:100%;}
+
+ .yui-t1 .yui-main,
+ .yui-t2 .yui-main,
+ .yui-t3 .yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
+
+ .yui-t4 .yui-main,
+ .yui-t5 .yui-main,
+ .yui-t6 .yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
+
+ /*
+ Subsection: For Specific Template Presets
+ */
+
+ .yui-t1 .yui-b {float:left;width:12.30769em;*width:12.00em;}
+ .yui-t1 .yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}
+
+ .yui-t2 .yui-b {float:left;width:13.8461em;*width:13.50em;}
+ .yui-t2 .yui-main .yui-b {margin-left:14.8461em;*margin-left:14.55em;}
+
+ .yui-t3 .yui-b {float:left;width:23.0769em;*width:22.50em;}
+ .yui-t3 .yui-main .yui-b {margin-left:24.0769em;*margin-left:23.62em;}
+
+ .yui-t4 .yui-b {float:right;width:13.8456em;*width:13.50em;}
+ .yui-t4 .yui-main .yui-b {margin-right:14.8456em;*margin-right:14.55em;}
+
+ .yui-t5 .yui-b {float:right;width:18.4615em;*width:18.00em;}
+ .yui-t5 .yui-main .yui-b {margin-right:19.4615em;*margin-right:19.125em;}
+
+ .yui-t6 .yui-b {float:right;width:23.0769em;*width:22.50em;}
+ .yui-t6 .yui-main .yui-b {margin-right:24.0769em;*margin-right:23.62em;}
+
+ .yui-t7 .yui-main .yui-b {
+ display:block;margin:0 0 1em 0;
+ }
+ .yui-main .yui-b {float:none;width:auto;}
+
+/*
+ Section: Grids and Nesting Grids
+*/
+
+ /*
+ Subsection: Children generally take half the available space
+ */
+
+ .yui-gb .yui-u,
+ .yui-g .yui-gb .yui-u,
+ .yui-gb .yui-g,
+ .yui-gb .yui-gb,
+ .yui-gb .yui-gc,
+ .yui-gb .yui-gd,
+ .yui-gb .yui-ge,
+ .yui-gb .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gc .yui-g,
+ .yui-gd .yui-u {float:left;}
+
+ /*Float units (and sub grids) to the right */
+ .yui-g .yui-u,
+ .yui-g .yui-g,
+ .yui-g .yui-gb,
+ .yui-g .yui-gc,
+ .yui-g .yui-gd,
+ .yui-g .yui-ge,
+ .yui-g .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gd .yui-g,
+ .yui-g .yui-gc .yui-u,
+ .yui-ge .yui-u,
+ .yui-ge .yui-g,
+ .yui-gf .yui-g,
+ .yui-gf .yui-u{float:right;}
+
+ /*Float units (and sub grids) to the left */
+ .yui-g div.first,
+ .yui-gb div.first,
+ .yui-gc div.first,
+ .yui-gd div.first,
+ .yui-ge div.first,
+ .yui-gf div.first,
+ .yui-g .yui-gc div.first,
+ .yui-g .yui-ge div.first,
+ .yui-gc div.first div.first {float:left;}
+
+ .yui-g .yui-u,
+ .yui-g .yui-g,
+ .yui-g .yui-gb,
+ .yui-g .yui-gc,
+ .yui-g .yui-gd,
+ .yui-g .yui-ge,
+ .yui-g .yui-gf {width:49.1%;}
+
+ .yui-gb .yui-u,
+ .yui-g .yui-gb .yui-u,
+ .yui-gb .yui-g,
+ .yui-gb .yui-gb,
+ .yui-gb .yui-gc,
+ .yui-gb .yui-gd,
+ .yui-gb .yui-ge,
+ .yui-gb .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gc .yui-g,
+ .yui-gd .yui-u {width:32%;margin-left:1.99%;}
+
+ /* Give IE some extra breathing room for 1/3-based rounding issues */
+ .yui-gb .yui-u {*margin-left:1.9%;*width:31.9%;}
+
+ .yui-gc div.first,
+ .yui-gd .yui-u {width:66%;}
+ .yui-gd div.first {width:32%;}
+
+ .yui-ge div.first,
+ .yui-gf .yui-u{width:74.2%;}
+
+ .yui-ge .yui-u,
+ .yui-gf div.first {width:24%;}
+
+ .yui-g .yui-gb div.first,
+ .yui-gb div.first,
+ .yui-gc div.first,
+ .yui-gd div.first {margin-left:0;}
+
+ /*
+ Section: Deep Nesting
+ */
+ .yui-g .yui-g .yui-u,
+ .yui-gb .yui-g .yui-u,
+ .yui-gc .yui-g .yui-u,
+ .yui-gd .yui-g .yui-u,
+ .yui-ge .yui-g .yui-u,
+ .yui-gf .yui-g .yui-u {width:49%;*width:48.1%;*margin-left:0;}
+
+ .yui-g .yui-gb div.first,
+ .yui-gb .yui-gb div.first {*margin-right:0;*width:32%;_width:31.7%;}
+
+ .yui-g .yui-gc div.first,
+ .yui-gd .yui-g {width:66%;}
+
+ .yui-gb .yui-g div.first {*margin-right:4%;_margin-right:1.3%;}
+
+ .yui-gb .yui-gc div.first,
+ .yui-gb .yui-gd div.first {*margin-right:0;}
+
+ .yui-gb .yui-gb .yui-u,
+ .yui-gb .yui-gc .yui-u {*margin-left:1.8%;_margin-left:4%;}
+
+ .yui-g .yui-gb .yui-u {_margin-left:1.0%;}
+
+ .yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;}
+ .yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}
+
+ .yui-g .yui-gc .yui-u,
+ .yui-gb .yui-gc .yui-u {width:32%;_float:right;margin-right:0;_margin-left:0;}
+ .yui-gb .yui-gc div.first {width:66%;*float:left;*margin-left:0;}
+
+ .yui-gb .yui-ge .yui-u,
+ .yui-gb .yui-gf .yui-u {margin:0;}
+
+ .yui-gb .yui-gb .yui-u {_margin-left:.7%;}
+
+ .yui-gb .yui-g div.first,
+ .yui-gb .yui-gb div.first {*margin-left:0;}
+
+ .yui-gc .yui-g .yui-u,
+ .yui-gd .yui-g .yui-u {*width:48.1%;*margin-left:0;}s
+
+ .yui-gb .yui-gd div.first {width:32%;}
+ .yui-g .yui-gd div.first {_width:29.9%;}
+
+ .yui-ge .yui-g {width:24%;}
+ .yui-gf .yui-g {width:74.2%;}
+
+ .yui-gb .yui-ge div.yui-u,
+ .yui-gb .yui-gf div.yui-u {float:right;}
+ .yui-gb .yui-ge div.first,
+ .yui-gb .yui-gf div.first {float:left;}
+
+ /* Width Accommodation for Nested Contexts */
+ .yui-gb .yui-ge .yui-u,
+ .yui-gb .yui-gf div.first {*width:24%;_width:20%;}
+
+ /* Width Accommodation for Nested Contexts */
+ .yui-gb .yui-ge div.first,
+ .yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}
+
+ /* Patch for GD within GE */
+ .yui-ge div.first .yui-gd .yui-u {width:65%;}
+ .yui-ge div.first .yui-gd div.first {width:32%;}
+
+/*
+ Section: Clearing
+*/
+
+#bd:after,
+.yui-g:after,
+.yui-gb:after,
+.yui-gc:after,
+.yui-gd:after,
+.yui-ge:after,
+.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
+#bd,
+.yui-g,
+.yui-gb,
+.yui-gc,
+.yui-gd,
+.yui-ge,
+.yui-gf{zoom:1;}
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/css/grids.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/css/reset-fonts-grids.css
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/css/reset-fonts-grids.css (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/css/reset-fonts-grids.css 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right!
;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.y!
ui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.
first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin!
-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}s .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb!
.yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-
gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/css/reset-fonts-grids.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/cal-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/header_line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/spinner.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/beanValidatorSample/src/main/webapp/include/pagesList.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/include/pagesList.xhtml (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/include/pagesList.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <ui:composition>
+ <h:form>
+ <h:dataTable value="#{pages.xhtmlPages}" var="page">
+ <h:column>
+ <h:outputLink value="#{page.url}">
+ <h:outputText value="#{page.title}" escape="false"/>
+ </h:outputLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/include/pagesList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/layout/pageTemplate.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/layout/pageTemplate.xhtml (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/layout/pageTemplate.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="Title" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><!-- insert header here --></h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ </ui:define>
+</ui:composition>
+</html>
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/layout/pageTemplate.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/layout/template.xhtml (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/layout/template.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,48 @@
+<a:page xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ pageTitle="#{title}" format="xhtml">
+ <a:loadStyle src="/css/grids.css" />
+ <a:loadStyle src="resource://css/panel.xcss" />
+ <a:loadStyle src="resource://css/table.xcss" />
+ <div id="doc3" class="yui-t3 dr-pnl">
+ <div id="hd" class="dr-pnl-h">
+ <h1>RichFaces Validation components examples</h1>
+ <ui:insert name="header" /></div>
+ <div id="bd">
+ <div class="yui-b">
+ <!-- YOUR NAVIGATION GOES HERE -->
+ <ui:include src="/include/pagesList.xhtml" />
+ </div>
+ <div class="yui-main">
+ <div class="yui-b">
+ <!-- YOUR DATA GOES HERE -->
+ <rich:tabPanel switchType="ajax">
+ <rich:tab label="Usage">
+ <ui:insert name="content" />
+ </rich:tab>
+ <rich:tab label="Page Source">
+ <rich:insert src="#{facesContext.viewRoot.viewId}" highlight="xhtml"/>
+ </rich:tab>
+ <rich:tab label="Java Source" rendered="#{!empty javaBean}">
+ <rich:insert src="/src/#{javaBean}" highlight="java"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </div>
+ </div>
+ </div>
+ <div id="ft" class="dr-table-footer">
+ <div class="yui-ge dr-table-footercell">
+ <div class="yui-u first">
+ Built with RichFaces #{a4j.version}
+ </div>
+ <div class="yui-u" style="text-align:right">
+ © 2007 Exadel, Inc.
+ </div>
+ </div>
+ </div>
+ </div>
+</a:page>
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/layout/template.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/beanValidatorSample/src/main/webapp/pages/ajaxValidation.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/pages/ajaxValidation.xhtml (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/pages/ajaxValidation.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,32 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="<rich:ajaxValidator> usage" />
+ <ui:param name="javaBean" value="org/richfaces/Bean.java" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><rich:ajaxValidator> usage</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:form id="form">
+ <h:panelGrid columns="3">
+ <h:outputLabel for="text" value="Enter Id" />
+ <h:inputText id="text" value="#{bean.text}" label="Id">
+ <rich:ajaxValidator event="onkeyup" summary="Invalid Id"/>
+ </h:inputText>
+ <rich:message for="text" showDetail="true" showSummary="true" />
+ </h:panelGrid>
+ <h:commandButton value="Submit"></h:commandButton>
+ <rich:messages/>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/pages/ajaxValidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -3,16 +3,18 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
- xmlns:v="http://labs.jboss.com/jbossrichfaces/ui/beanValidator">
-<head>
-<title>Hibernate validator test</title>
-</head>
-<body>
-<h1>Using Hibernate validator annotations in the JSF beans</h1>
-<f:view>
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="Hibernate validator test" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1>Using Hibernate validator annotations in the JSF beans</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
<h:form id="form">
<rich:panel>
<f:facet name="header">
@@ -21,12 +23,12 @@
<h:panelGrid columns="3">
<h:outputLabel for="ltext" value="#{lengthBean.textDescription}" />
<h:inputText id="ltext" value="#{lengthBean.text}" label="3-letter text">
- <v:ajaxValidator event="onkeyup" summary="Invalid Id"/>
+ <rich:ajaxValidator event="onkeyup" summary="Invalid Id"/>
</h:inputText>
<rich:message for="ltext" showDetail="true" showSummary="true" />
<h:outputLabel for="mtext" value="#{minMaxBean.intDescription}" />
<h:inputText id="mtext" value="#{minMaxBean.intValue}" label="value">
- <v:ajaxValidator event="onkeyup" summary="Invalid value"/>
+ <rich:ajaxValidator event="onkeyup" summary="Invalid value"/>
</h:inputText>
<rich:message for="mtext" showDetail="true" showSummary="true" />
</h:panelGrid>
@@ -37,7 +39,7 @@
<h:form id="form1">
<h2>Input fields with label and message in the JSF dataTable.
Each field validated by AJAX on 'onblur' event</h2>
- <v:graphValidator value="#{data}">
+ <rich:graphValidator value="#{data}">
<rich:dataTable value="#{data.beans}" var="bean" id="table">
<f:facet name="header">
<h:outputText
@@ -50,7 +52,7 @@
</f:facet>
<h:outputLabel for="text" value="#{bean.textDescription}" />
<h:inputText id="text" value="#{bean.text}">
- <v:ajaxValidator event="onblur"
+ <rich:ajaxValidator event="onblur"
ajaxListener="#{data.ajaxListener}" summary="#{bean.textSummary}"/>
</h:inputText>
<rich:message for="text" showDetail="true" showSummary="true" />
@@ -61,7 +63,7 @@
</f:facet>
<h:outputLabel for="intValue" value="#{bean.intDescription}" />
<h:inputText id="intValue" value="#{bean.intValue}">
- <v:ajaxValidator event="onblur" summary="#{bean.intSummary}"/>
+ <rich:ajaxValidator event="onblur" summary="#{bean.intSummary}"/>
</h:inputText>
<rich:message for="intValue" showDetail="true" showSummary="true" />
</h:column>
@@ -72,7 +74,7 @@
</h:panelGroup>
</f:facet>
</rich:dataTable>
- </v:graphValidator>
+ </rich:graphValidator>
</h:form>
<h:form id="form2">
<h2>Input fields with label and message in the JSF dataTable.
@@ -90,7 +92,7 @@
</f:facet>
<h:outputLabel for="text" value="#{bean.textDescription}" />
<h:inputText id="text" value="#{bean.text}">
- <v:beanValidator summary="Invalid text"/>
+ <rich:beanValidator summary="Invalid text"/>
</h:inputText>
<rich:message for="text" />
</h:column>
@@ -100,7 +102,7 @@
</f:facet>
<h:outputLabel for="intValue" value="#{bean.intDescription}" />
<h:inputText id="intValue" value="#{bean.intValue}">
- <v:beanValidator summary="Invalid number"/>
+ <rich:beanValidator summary="Invalid number"/>
</h:inputText>
<rich:message for="intValue" />
</h:column>
@@ -114,6 +116,6 @@
</h:form>
<rich:messages />
-</f:view>
-</body>
+ </ui:define>
+</ui:composition>
</html>
Added: trunk/samples/beanValidatorSample/src/main/webapp/pages/textValidation.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/pages/textValidation.xhtml (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/pages/textValidation.xhtml 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,31 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="<rich:beanValidator> usage" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><rich:beanValidator> usage</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:form id="form">
+ <h:panelGrid columns="3">
+ <h:outputLabel for="text" value="Enter Id" />
+ <h:inputText id="text" value="#{bean.text}" label="Id">
+ <rich:beanValidator summary="Invalid Id"/>
+ </h:inputText>
+ <rich:message for="text" showDetail="true" showSummary="true" />
+ </h:panelGrid>
+ <h:commandButton value="Submit"></h:commandButton>
+ <rich:messages/>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/pages/textValidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/Bean.java (from rev 12145, trunk/samples/beanValidatorSample/src/main/java/org/richfaces/Bean.java)
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/Bean.java (rev 0)
+++ trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/Bean.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+
+/**
+ * JSF bean with text property validation.
+ */
+public class Bean {
+
+ /**
+ * Text property
+ */
+ private String text;
+
+ /**
+ * @return the text
+ */
+ @NotEmpty
+ @Length(max=5)
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/samples/beanValidatorSample/src/main/webapp/src/org/richfaces/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java 2009-01-08 00:26:52 UTC (rev 12146)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java 2009-01-08 01:45:32 UTC (rev 12147)
@@ -134,10 +134,11 @@
if (null != messages) {
context.renderResponse();
// send all validation messages.
+ String clientId = getClientId(context);
for (String msg : messages) {
// TODO - create Summary message ?
String summary = null != getSummary() ? getSummary() + msg : msg;
- context.addMessage(null, new FacesMessage(
+ context.addMessage(clientId, new FacesMessage(
FacesMessage.SEVERITY_ERROR, summary, msg));
}
}
16 years, 11 months
JBoss Rich Faces SVN: r12146 - trunk/framework/impl/src/main/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-01-07 19:26:52 -0500 (Wed, 07 Jan 2009)
New Revision: 12146
Modified:
trunk/framework/impl/src/main/java/org/richfaces/VersionBean.java
Log:
mark modification date
Modified: trunk/framework/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/VersionBean.java 2009-01-07 14:25:27 UTC (rev 12145)
+++ trunk/framework/impl/src/main/java/org/richfaces/VersionBean.java 2009-01-08 00:26:52 UTC (rev 12146)
@@ -34,7 +34,7 @@
public static final String PROJECT_NAME = "Jboss Richfaces";
/**
- * Revision version, must be auto modified by CVS
+ * Revision version, must be auto modified by CVS
*/
public static final String REVISION = "0-SNAPSHOT" ;
16 years, 11 months
JBoss Rich Faces SVN: r12145 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2009-01-07 09:25:27 -0500 (Wed, 07 Jan 2009)
New Revision: 12145
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4466 created
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-01-07 01:12:00 UTC (rev 12144)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-01-07 14:25:27 UTC (rev 12145)
@@ -224,7 +224,7 @@
case Event.KEY_RETURN :
this.setValue(true);
this.comboList.hideWithDelay();
- Event.stop(event);
+ Event.stop(event); // It is necessary for a cancelling of sending form at selecting item
break;
case Event.KEY_DOWN :
this.comboList.moveActiveItem(event);
16 years, 11 months
JBoss Rich Faces SVN: r12144 - in trunk/ui/beanValidator/src: test/java/org/richfaces/validator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-01-06 20:12:00 -0500 (Tue, 06 Jan 2009)
New Revision: 12144
Modified:
trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java
Log:
Append collection-like properties support.
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2009-01-06 19:45:51 UTC (rev 12143)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2009-01-07 01:12:00 UTC (rev 12144)
@@ -21,11 +21,14 @@
package org.richfaces.validator;
import java.beans.FeatureDescriptor;
+import java.util.Collection;
+import java.util.EmptyStackException;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import javax.el.ELContext;
@@ -128,7 +131,7 @@
String[] validationMessages = null;
if (null != target) {
ELContext elContext = context.getELContext();
- ValidationResolver validationResolver = new ValidationResolver(
+ ValidationResolver validationResolver = createValidationResolver(
elContext.getELResolver(), calculateLocale(context));
ELContextWrapper wrappedElContext = new ELContextWrapper(elContext,
validationResolver);
@@ -159,7 +162,7 @@
// Method for checking input parameters for prevent NPE
private void checkInputParameters(FacesContext context,
ValueExpression target) {
- if (null == context || null == target ) {
+ if (null == context || null == target) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
}
@@ -274,7 +277,7 @@
* This method determine ResourceBundle, used in current request @param
* locale - user locale @return ResourceBundle instance
*/
- private ResourceBundle getCurrentResourceBundle(Locale locale) {
+ protected ResourceBundle getCurrentResourceBundle(Locale locale) {
if (null == FacesContext.getCurrentInstance()
|| null == FacesContext.getCurrentInstance().getApplication()) {
throw new FacesException(FACES_CONTEXT_IS_NULL);
@@ -284,16 +287,17 @@
if (null == appBundle || null == locale) {
return null;
}
-
+
ResourceBundle bundle;
-
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+ ClassLoader classLoader = Thread.currentThread()
+ .getContextClassLoader();
if (classLoader != null) {
bundle = ResourceBundle.getBundle(appBundle, locale, classLoader);
} else {
bundle = ResourceBundle.getBundle(appBundle, locale);
}
-
+
return bundle;
}
@@ -304,13 +308,17 @@
* during validation process @return ClassValidator instance
*/
@SuppressWarnings("unchecked")
- private ClassValidator<? extends Object> createValidator(
+ protected ClassValidator<? extends Object> createValidator(
Class<? extends Object> beanClass, Locale locale) {
ResourceBundle bundle = getCurrentResourceBundle(locale);
return bundle == null ? new ClassValidator(beanClass)
: new ClassValidator(beanClass, bundle);
}
+
+ protected ValidationResolver createValidationResolver(ELResolver parent, Locale locale) {
+ return new ValidationResolver(parent,locale);
+ }
/**
* Wrapper class for a {@link ELResolver}. For a setValue method, perform
* validation instead of real assignment.
@@ -330,13 +338,16 @@
private String[] validationMessages = null;
private Locale locale = null;
-
+
+ private Stack<BasePropertyPair> valuesStack;
+
/**
* @param parent
*/
public ValidationResolver(ELResolver parent, Locale locale) {
this.parent = parent;
this.locale = locale;
+ this.valuesStack = new Stack<BasePropertyPair>();
}
public boolean isValid() {
@@ -388,7 +399,9 @@
* java.lang.Object, java.lang.Object)
*/
public Object getValue(ELContext context, Object base, Object property) {
- return parent.getValue(context, base, property);
+ Object value = parent.getValue(context, base, property);
+ valuesStack.push(new BasePropertyPair(base, property));
+ return value;
}
/**
@@ -416,15 +429,39 @@
Object value) {
if (null != base && null != property) {
context.setPropertyResolved(true);
- //https://jira.jboss.org/jira/browse/RF-4034
- //apache el looses locale information during value resolution,
- //so we use our own
- validationMessages = validate(base, property.toString(), value, locale);
- valid = null == validationMessages
- || 0 == validationMessages.length;
+ // For Arrays, Collection or Map use parent base and property.
+ BasePropertyPair basePropertyPair = lookupBeanProperty(new BasePropertyPair(
+ base, property));
+ base = basePropertyPair.getBase();
+ property = basePropertyPair.getProperty();
+ if (null != base && null != property) {
+ // https://jira.jboss.org/jira/browse/RF-4034
+ // apache el looses locale information during value
+ // resolution,
+ // so we use our own
+ validationMessages = validate(base, property.toString(),
+ value, locale);
+ valid = null == validationMessages
+ || 0 == validationMessages.length;
+
+ }
}
}
+ private BasePropertyPair lookupBeanProperty(BasePropertyPair pair) {
+ Object base = pair.getBase();
+ if (null != base
+ && (base instanceof Collection || base instanceof Map || base
+ .getClass().isArray())) {
+ try {
+ pair = lookupBeanProperty(valuesStack.pop());
+ } catch (EmptyStackException e) {
+ // Do nothing, this is a first item.
+ }
+ }
+ return pair;
+ }
+
/**
* @return the validationMessages
*/
@@ -435,6 +472,39 @@
}
/**
+ * @author asmirnov
+ *
+ */
+ static class BasePropertyPair {
+ private final Object base;
+ private final Object property;
+
+ /**
+ * @param base
+ * @param property
+ */
+ public BasePropertyPair(Object base, Object property) {
+ this.base = base;
+ this.property = property;
+ }
+
+ /**
+ * @return the base
+ */
+ public Object getBase() {
+ return base;
+ }
+
+ /**
+ * @return the property
+ */
+ public Object getProperty() {
+ return property;
+ }
+
+ }
+
+ /**
* Class for identify validator instance by locale
*
* @author amarkhel
Modified: trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
===================================================================
--- trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2009-01-06 19:45:51 UTC (rev 12143)
+++ trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2009-01-07 01:12:00 UTC (rev 12144)
@@ -20,12 +20,16 @@
*/
package org.richfaces.validator;
+import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.ResourceBundle;
+import org.ajax4jsf.el.ELContextWrapper;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;
+import org.richfaces.validator.BeanValidator.ValidationResolver;
public class BeanValidatorTest extends AbstractAjax4JsfTestCase {
@@ -78,4 +82,51 @@
assertNotNull(invalidValues);
assertEquals(1, invalidValues.length);
}
+
+ public void testValidateArray() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ InvalidValue[] invalidValues = beanValidator.validateBean(new ValidableBean(), "array", "",Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(2, invalidValues.length);
+ System.out.println(invalidValues[0].getMessage());
+ System.out.println(invalidValues[1].getMessage());
+ }
+
+ public void testValidateList() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ InvalidValue[] invalidValues = beanValidator.validateBean(new ValidableBean(), "list", "",Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(1, invalidValues.length);
+ System.out.println(invalidValues[0].getMessage());
+ }
+ public void testValidateMap() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ InvalidValue[] invalidValues = beanValidator.validateBean(new ValidableBean(), "map", "",Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(1, invalidValues.length);
+ System.out.println(invalidValues[0].getMessage());
+ }
+
+ public void testValidationResolver() throws Exception {
+ ValidableBean bean = new ValidableBean();
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ ValidationResolver validationResolver = beanValidator.createValidationResolver(facesContext.getELContext().getELResolver(), Locale.US);
+ Object list = validationResolver.getValue(elContext, bean, "list");
+ assertNotNull(list);
+ assertTrue(list instanceof List);
+ validationResolver.setValue(elContext, list, new Integer(0), "");
+ assertFalse(validationResolver.isValid());
+ assertEquals(1, validationResolver.getValidationMessages().length);
+ }
+ public void testValidationResolverMap() throws Exception {
+ ValidableBean bean = new ValidableBean();
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ ValidationResolver validationResolver = beanValidator.createValidationResolver(facesContext.getELContext().getELResolver(), Locale.US);
+ Object list = validationResolver.getValue(elContext, bean, "map");
+ assertNotNull(list);
+ assertTrue(list instanceof Map);
+ validationResolver.setValue(elContext, list, new Integer(0), "");
+ assertFalse(validationResolver.isValid());
+ assertEquals(1, validationResolver.getValidationMessages().length);
+ }
}
Modified: trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java
===================================================================
--- trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java 2009-01-06 19:45:51 UTC (rev 12143)
+++ trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java 2009-01-07 01:12:00 UTC (rev 12144)
@@ -20,9 +20,15 @@
*/
package org.richfaces.validator;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.hibernate.validator.Length;
import org.hibernate.validator.Max;
import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
/**
@@ -38,8 +44,60 @@
private String text;
private Object foo;
+
+ @NotEmpty
+ private List<String> list = new ArrayList<String>();
+
+ private String[] array = new String[1];
+
+ private Map<String, String> map = new HashMap<String, String>();
/**
+ * @return the list
+ */
+ public List<String> getList() {
+ return list;
+ }
+
+ /**
+ * @param list the list to set
+ */
+ public void setList(List<String> list) {
+ this.list = list;
+ }
+
+ /**
+ * @return the array
+ */
+ @NotEmpty
+ @Length(min=2,max=5)
+ public String[] getArray() {
+ return array;
+ }
+
+ /**
+ * @param array the array to set
+ */
+ public void setArray(String[] array) {
+ this.array = array;
+ }
+
+ /**
+ * @return the map
+ */
+ @Length(min=2,max=5)
+ public Map<String, String> getMap() {
+ return map;
+ }
+
+ /**
+ * @param map the map to set
+ */
+ public void setMap(Map<String, String> map) {
+ this.map = map;
+ }
+
+ /**
* @return the integerProperty
*/
public int getIntegerProperty() {
16 years, 11 months
JBoss Rich Faces SVN: r12143 - trunk/framework/test/src/test/java/org/ajax4jsf/application.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-01-06 14:45:51 -0500 (Tue, 06 Jan 2009)
New Revision: 12143
Modified:
trunk/framework/test/src/test/java/org/ajax4jsf/application/AjaxStateManagerTest.java
trunk/framework/test/src/test/java/org/ajax4jsf/application/ComponentLoaderTest.java
Log:
Fix stateManager tests.
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/application/AjaxStateManagerTest.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/application/AjaxStateManagerTest.java 2009-01-06 19:28:11 UTC (rev 12142)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/application/AjaxStateManagerTest.java 2009-01-06 19:45:51 UTC (rev 12143)
@@ -42,6 +42,7 @@
import javax.faces.render.RenderKitFactory;
import javax.faces.render.ResponseStateManager;
+import org.ajax4jsf.application.TreeStructureNode.FacetEntry;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.apache.shale.test.mock.MockRenderKit;
@@ -149,18 +150,17 @@
}
public void testTreeNodeApply() throws Exception {
- //FIXME
- /*
buildTestTree();
TreeStructureNode node = new TreeStructureNode();
- node.apply(facesContext, facesContext.getViewRoot(), new HashSet());
+ node.apply(facesContext, facesContext.getViewRoot(), new HashSet<String>());
assertEquals(2, node.getChildren().size());
assertEquals(1, node.getFacets().size());
- TreeStructureNode nodeA = (TreeStructureNode) node.getFacets().get(FACET_A);
+ FacetEntry nodeA = node.getFacets().get(0);
assertNotNull(nodeA);
- assertEquals(1, nodeA.getChildren().size());
- assertEquals(1, nodeA.getFacets().size());
- */
+ assertEquals(FACET_A, nodeA.getName());
+ assertEquals(1, nodeA.getNode().getChildren().size());
+ assertEquals(1, nodeA.getNode().getFacets().size());
+
}
public void testTreeNodeCheckUniqueId() throws Exception {
@@ -180,8 +180,6 @@
public void testTreeNodeSerialisation() throws Exception {
- //FIXME
- /*
buildTestTree();
TreeStructureNode node = new TreeStructureNode();
node.apply(facesContext, facesContext.getViewRoot(), new HashSet());
@@ -193,11 +191,11 @@
TreeStructureNode nodeIn = (TreeStructureNode) in.readObject();
assertEquals(2, nodeIn.getChildren().size());
assertEquals(1, nodeIn.getFacets().size());
- TreeStructureNode nodeA = (TreeStructureNode) nodeIn.getFacets().get(FACET_A);
+ FacetEntry nodeA = nodeIn.getFacets().get(0);
assertNotNull(nodeA);
- assertEquals(1, nodeA.getChildren().size());
- assertEquals(1, nodeA.getFacets().size());
- */
+ assertEquals(FACET_A, nodeA.getName());
+ assertEquals(1, nodeA.getNode().getChildren().size());
+ assertEquals(1, nodeA.getNode().getFacets().size());
}
/**
*
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/application/ComponentLoaderTest.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/application/ComponentLoaderTest.java 2009-01-06 19:28:11 UTC (rev 12142)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/application/ComponentLoaderTest.java 2009-01-06 19:45:51 UTC (rev 12143)
@@ -69,19 +69,8 @@
assertEquals(UIInput.class, input.getClass());
}
- /**
- * Test method for {@link org.ajax4jsf.application.ComponentsLoaderImpl#transform(java.lang.Object)}.
- */
- public void testTransform() {
- //FIXME
- /*
- Object componentClass = loader.transform(UIInput.class.getName());
- assertSame(UIInput.class, componentClass);
- */
- }
public void testGetLoader() throws Exception {
- //FIXME
- /*assertSame(classLoader,loader.getClassLoader());*/
+ assertSame(classLoader,loader.getClassLoader());
}
}
16 years, 11 months
JBoss Rich Faces SVN: r12142 - in trunk/ui/modal-panel/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-01-06 14:28:11 -0500 (Tue, 06 Jan 2009)
New Revision: 12142
Modified:
trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5588
Modified: trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2009-01-06 17:24:58 UTC (rev 12141)
+++ trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2009-01-06 19:28:11 UTC (rev 12142)
@@ -295,5 +295,10 @@
<description>Defines whether to trim or not elements inside modalPanel. Default value is "true"</description>
<defaultvalue>true</defaultvalue>
</property>
+
+ <property>
+ <name>domElementAttachment</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2009-01-06 17:24:58 UTC (rev 12141)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2009-01-06 19:28:11 UTC (rev 12142)
@@ -90,6 +90,9 @@
public abstract boolean isTrimOverlayedElements();
public abstract void setTrimOverlayedElements(boolean trim);
+ public abstract String getDomElementAttachment();
+ public abstract void setDomElementAttachment(String domElementAttachment);
+
public boolean getRendersChildren() {
return true;
}
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2009-01-06 17:24:58 UTC (rev 12141)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2009-01-06 19:28:11 UTC (rev 12142)
@@ -22,8 +22,10 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
import javax.faces.component.UIComponent;
@@ -94,11 +96,27 @@
return UIModalPanel.class;
}
+ private static final Set<String> ALLOWED_ATTACHMENT_OPTIONS = new HashSet<String>();
+ static {
+ ALLOWED_ATTACHMENT_OPTIONS.add("body");
+ ALLOWED_ATTACHMENT_OPTIONS.add("parent");
+ ALLOWED_ATTACHMENT_OPTIONS.add("form");
+ }
+
//TODO nick - add messages
public void checkOptions(FacesContext context, UIModalPanel panel) {
if (panel.isAutosized() && panel.isResizeable()) {
throw new IllegalArgumentException("Autosized modal panel can't be resizeable.");
}
+
+ String domElementAttachment = panel.getDomElementAttachment();
+ if (domElementAttachment != null && domElementAttachment.trim().length() != 0) {
+ if (!ALLOWED_ATTACHMENT_OPTIONS.contains(domElementAttachment)) {
+ throw new IllegalArgumentException("Value '" + domElementAttachment + "' of domElementAttachment attribute is illegal. " +
+ "Allowed values are: " + ALLOWED_ATTACHMENT_OPTIONS);
+ }
+ }
+
if (panel.getMinHeight() != -1) {
if (panel.getMinHeight() < sizeA) {
throw new IllegalArgumentException();
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-01-06 17:24:58 UTC (rev 12141)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-01-06 19:28:11 UTC (rev 12142)
@@ -224,7 +224,7 @@
this.borders = null;
setTimeout(function() {
- if (this.floatedToBody) {
+ if (this.domReattached) {
var element = this.id;
var parent = element.parentNode;
if (parent) {
@@ -487,11 +487,35 @@
this.preventFocus();
- if (!this.floatedToBody) {
+ if (!this.domReattached) {
this.parent = element.parentNode;
- this._saveInputValues(element);
- document.body.insertBefore(this.parent.removeChild(element), null);
- this.floatedToBody = true;
+
+ var domElementAttachment;
+ if (opts) {
+ domElementAttachment = opts.domElementAttachment;
+ }
+
+ if (!domElementAttachment) {
+ domElementAttachment = this.options.domElementAttachment;
+ }
+
+ var newParent;
+ if ('parent' == domElementAttachment) {
+ newParent = this.parent;
+ } else if ('form' == domElementAttachment) {
+ newParent = this._findForm(element) || document.body;
+ } else {
+ //default - body
+ newParent = document.body;
+ }
+
+ if (newParent != this.parent) {
+ this._saveInputValues(element);
+ newParent.insertBefore(this.parent.removeChild(element), null);
+ this.domReattached = true;
+ } else {
+ Element.show(this.parent);
+ }
}
var eCdiv = $(this.cdiv);
@@ -731,11 +755,20 @@
var element = $(this.id);
Element.hide(element);
- if (this.floatedToBody && this.parent) {
- this._saveInputValues(element);
- document.body.removeChild(element);
- this.parent.appendChild(element);
- this.floatedToBody = false;
+ if (this.parent) {
+ if (this.domReattached) {
+ this._saveInputValues(element);
+
+ var pNode = element.parentNode;
+ if (pNode) {
+ pNode.removeChild(element);
+ }
+ this.parent.appendChild(element);
+
+ this.domReattached = false;
+ } else {
+ Element.hide(this.parent);
+ }
}
var event = {};
@@ -889,13 +922,26 @@
return vetoes;
},
+ _findForm: function(elt) {
+ var target = elt;
+ while (target) {
+ if (!target.tagName /* document node doesn't have tagName */
+ || target.tagName.toLowerCase() != "form") {
+
+ target = target.parentNode;
+ } else {
+ break;
+ }
+ }
+
+ return target;
+ },
+
setStateInput: function(e) {
var target = Event.element(e);
if (e && target) {
// Concret input but not entire form is a target element for onsubmit in FF
- while (target && target.tagName.toLowerCase()!="form") {
- target = target.parentNode;
- }
+ target = this._findForm(target);
var input = document.createElement("input");
input.type = "hidden";
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2009-01-06 17:24:58 UTC (rev 12141)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2009-01-06 19:28:11 UTC (rev 12142)
@@ -192,7 +192,7 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="onhide" /></f:call>,
<f:call name="writeEventHandlerFunction"><f:parameter value="onbeforeshow"/></f:call>,
<f:call name="writeEventHandlerFunction"><f:parameter value="onbeforehide" /></f:call>,
-
+ domElementAttachment: "#{component.domElementAttachment}",
keepVisualState: #{component.keepVisualState},
showWhenRendered: #{component.showWhenRendered},
selectBehavior: "#{component.tridentIVEngineSelectBehavior}",
16 years, 11 months
JBoss Rich Faces SVN: r12141 - in trunk/test-applications/jsp/src/main: webapp/tTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-01-06 12:24:58 -0500 (Tue, 06 Jan 2009)
New Revision: 12141
Modified:
trunk/test-applications/jsp/src/main/java/tTree/TTree.java
trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
Log:
+ disableKeyboardNavigation attr for tree
Modified: trunk/test-applications/jsp/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTree.java 2009-01-06 17:22:12 UTC (rev 12140)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTree.java 2009-01-06 17:24:58 UTC (rev 12141)
@@ -25,6 +25,7 @@
private boolean showConnectingLines = false;
private boolean toggleOnClick = false;
private boolean useCustomIcons = false;
+ private boolean disableKeyboardNavigation = false;
private String reRenderCheck = "... waiting ...";
@@ -193,4 +194,12 @@
public void setUseCustomIcons(boolean useCustomIcons) {
this.useCustomIcons = useCustomIcons;
}
+
+ public boolean isDisableKeyboardNavigation() {
+ return disableKeyboardNavigation;
+ }
+
+ public void setDisableKeyboardNavigation(boolean disableKeyboardNavigation) {
+ this.disableKeyboardNavigation = disableKeyboardNavigation;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2009-01-06 17:22:12 UTC (rev 12140)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2009-01-06 17:24:58 UTC (rev 12141)
@@ -55,7 +55,8 @@
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
- onselected="#{event.onselected}">
+ onselected="#{event.onselected}"
+ disableKeyboardNavigation="#{tTree.disableKeyboardNavigation}">
<rich:treeNode type="input">
<h:outputText value="#{defTree} : " />
@@ -90,6 +91,10 @@
<h:outputText value="rendered:" />
<h:selectBooleanCheckbox value="#{tTree.rendered}"
onchange="submit();" />
+
+ <h:outputText value="disableKeyboardNavigation:" />
+ <h:selectBooleanCheckbox value="#{tTree.disableKeyboardNavigation}"
+ onchange="submit();" />
<h:outputText value="showConnectingLines:" />
<h:selectBooleanCheckbox value="#{tTree.showConnectingLines}"
16 years, 11 months