JBoss Rich Faces SVN: r14962 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-07-17 15:10:15 -0400 (Fri, 17 Jul 2009)
New Revision: 14962
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml
Log:
RF-7530:rich:graphValidator component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2009-07-17 18:46:55 UTC (rev 14961)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2009-07-17 19:10:15 UTC (rev 14962)
@@ -80,13 +80,12 @@
...
HtmlgraphValidator mygraphValidator= new HtmlgraphValidator();
...]]></programlisting>
-
-
</section>
- <para> The<emphasis role="bold">
- <property><rich:graphValidator></property>
- </emphasis>component behaves basically the same way as the <emphasis role="bold">
+<section>
+ <title>Details of usage</title>
+ <para>
+ The<emphasis role="bold"><property><rich:graphValidator></property></emphasis>component behaves basically the same way as the <emphasis role="bold">
<property><rich:beanValidator></property>
</emphasis> The deference between these two components is that in order to
validate some input data with a <emphasis role="bold">
@@ -113,8 +112,7 @@
<rich:message for="email" />
</h:panelGrid>
</rich:graphValidator>
-...
-]]></programlisting>
+...]]></programlisting>
<para>The data validation can be also performed using Hibernate Validator, the same way as
it is done with <emphasis role="bold">
@@ -164,14 +162,14 @@
</imageobject>
</mediaobject>
</figure>
-
-
<para> The figure above shows that the entered data was revalidated after all fields were completed, and the data did not pass revalidation since the total sum was incorrect. </para>
- <section>
+</section>
+
+ <section>
<title>Relevant Resources Links</title>
- <para><ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/graphValidator.jsf?c=...">
- On RichFaces LiveDemo page </ulink> you can see an example of <emphasis role="bold"><property><rich:graphValidator></property>
- </emphasis> usage and sources for the given example. </para>
+ <para>
+ Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/graphValidator.jsf?c=...">GraphValidator page</ulink> at RichFaces LiveDemo for examples of component usage and their sources.
+ </para>
</section>
</section>
15 years, 2 months
JBoss Rich Faces SVN: r14961 - branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-07-17 14:46:55 -0400 (Fri, 17 Jul 2009)
New Revision: 14961
Modified:
branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
Log:
RF-3902
Modified: branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2009-07-17 17:46:10 UTC (rev 14960)
+++ branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2009-07-17 18:46:55 UTC (rev 14961)
@@ -101,6 +101,8 @@
private int reqRowsCount = -1;
+ private transient boolean keepSaved;
+
private String scrollPos;
private SortListener sortListener;
@@ -366,7 +368,7 @@
setFirst(e.getFirst());
reqRowsCount = e.getRows();
-
+ keepSaved = true;
getFacesContext().renderResponse();
}
@@ -527,4 +529,9 @@
public void setRowKeyConverter(Converter rowKeyConverter) {
super.setRowKeyConverter(rowKeyConverter);
}
+
+ @Override
+ protected boolean keepSaved(FacesContext context) {
+ return keepSaved || super.keepSaved(context);
+ }
}
15 years, 2 months
JBoss Rich Faces SVN: r14960 - in branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-07-17 13:46:10 -0400 (Fri, 17 Jul 2009)
New Revision: 14960
Modified:
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
Fix RF-7510
Modified: branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2009-07-17 17:32:45 UTC (rev 14959)
+++ branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2009-07-17 17:46:10 UTC (rev 14960)
@@ -91,16 +91,17 @@
UIComponent component = iterator.next();
if (component instanceof org.richfaces.component.UIColumn) {
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
- FilterField filterField = column.getFilterField();
- if (filterField != null) {
- filterFields.add(filterField);
+ if(column.isRendered()){
+ FilterField filterField = column.getFilterField();
+ if (filterField != null) {
+ filterFields.add(filterField);
+ }
+ SortField2 sortField = column.getSortField();
+ if (sortField != null) {
+ sortFieldsMap.put(component.getId(), sortField);
+ }
}
- SortField2 sortField = column.getSortField();
- if (sortField != null) {
- sortFieldsMap.put(component.getId(), sortField);
- }
}
-
}
List<SortField2> sortFields = new LinkedList<SortField2>();
Collection<Object> sortPriority = getSortPriority();
Modified: branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-07-17 17:32:45 UTC (rev 14959)
+++ branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-07-17 17:46:10 UTC (rev 14960)
@@ -543,35 +543,37 @@
UIComponent child = iterator.next();
if (child instanceof org.richfaces.component.UIColumn) {
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) child;
- child.setId(child.getId());
- if (sortColumnId != null) {
- String columnClientId = child.getClientId(context);
- if (sortColumnId.equals(columnClientId)) {
- String id = child.getId();
- Collection<Object> sortPriority = table.getSortPriority();
- if (isSingleSortMode) {
- sortPriority.clear();
+ if(column.isRendered()){
+ child.setId(child.getId());
+ if (sortColumnId != null) {
+ String columnClientId = child.getClientId(context);
+ if (sortColumnId.equals(columnClientId)) {
+ String id = child.getId();
+ Collection<Object> sortPriority = table.getSortPriority();
+ if (isSingleSortMode) {
+ sortPriority.clear();
+ }
+ if(!sortPriority.contains(id)) {
+ sortPriority.add(id);
+ }
+ column.toggleSortOrder();
+ } else if(isSingleSortMode){
+ column.setSortOrder(Ordering.UNSORTED);
}
- if(!sortPriority.contains(id)) {
- sortPriority.add(id);
+
+ RequestContext requestContext = RequestContext.getInstance(context);
+ requestContext.setAttribute(columnClientId + SORT_DIV, Boolean.TRUE);
+ }
+ UIInput filterValueInput = (UIInput)child.getFacet(FILTER_INPUT_FACET_NAME);
+ if (null != filterValueInput) {
+ filterValueInput.setId(filterValueInput.getId());
+ filterValueInput.decode(context);
+ Object submittedValue = filterValueInput.getSubmittedValue();
+ if (null != submittedValue) {
+ column.setFilterValue(filterValueInput.getSubmittedValue().toString());
}
- column.toggleSortOrder();
- } else if(isSingleSortMode){
- column.setSortOrder(Ordering.UNSORTED);
}
-
- RequestContext requestContext = RequestContext.getInstance(context);
- requestContext.setAttribute(columnClientId + SORT_DIV, Boolean.TRUE);
- }
- UIInput filterValueInput = (UIInput)child.getFacet(FILTER_INPUT_FACET_NAME);
- if (null != filterValueInput) {
- filterValueInput.setId(filterValueInput.getId());
- filterValueInput.decode(context);
- Object submittedValue = filterValueInput.getSubmittedValue();
- if (null != submittedValue) {
- column.setFilterValue(filterValueInput.getSubmittedValue().toString());
- }
- }
+ }
}
}
15 years, 2 months
JBoss Rich Faces SVN: r14959 - in branches/community/3.3.X: framework/impl/src/main/java/org/ajax4jsf/webapp/nekko and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-07-17 13:32:45 -0400 (Fri, 17 Jul 2009)
New Revision: 14959
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/ParsingStateManager.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyParser.java
branches/community/3.3.X/ui/layout/src/main/java/org/richfaces/renderkit/html/LayoutRenderer.java
Log:
Fix RF-7457
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java 2009-07-17 16:18:34 UTC (rev 14958)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java 2009-07-17 17:32:45 UTC (rev 14959)
@@ -132,11 +132,18 @@
if (log.isDebugEnabled()) {
log.debug("Found <title> element");
}
- } else if (context.getLastMatched() == stateManager.BASE) {
+ } else if (context.getLastMatched() == stateManager.META) {
context.send();
haveHead = true;
haveHtml = true;
if (log.isDebugEnabled()) {
+ log.debug("Found <meta> element");
+ }
+ }else if (context.getLastMatched() == stateManager.BASE) {
+ context.send();
+ haveHead = true;
+ haveHtml = true;
+ if (log.isDebugEnabled()) {
log.debug("Found <base> element");
}
} else {
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/ParsingStateManager.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/ParsingStateManager.java 2009-07-17 16:18:34 UTC (rev 14958)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/io/parser/ParsingStateManager.java 2009-07-17 17:32:45 UTC (rev 14959)
@@ -99,6 +99,8 @@
ParserState BASE = new KeywordState("base",ELEMENT);
+ ParserState META = new KeywordState("meta",ELEMENT);
+
// Html content
ParserState HTML = new KeywordState("tml",ELEMENT);
@@ -111,7 +113,7 @@
// Inicialize parsing states
DOCUMENT.nextStates = new ParserState[]{LT,DOCUMENT};
// after < possible ! & / or start element
- LT.nextStates = new ParserState[]{EXCLAM,PISTART,CLOSINGELEMENT,H,TITLE,BASE,ELEMENT,DOCUMENT};
+ LT.nextStates = new ParserState[]{EXCLAM,PISTART,CLOSINGELEMENT,H,META,TITLE,BASE,ELEMENT,DOCUMENT};
//
EXCLAM.nextStates = new ParserState[]{COMMENTSTART,CDATASTART,DOCTYPESTART,DOCUMENT};
// doctype declaration
@@ -156,6 +158,7 @@
H.nextStates = new ParserState[]{HEAD,HTML,ENDELEMENT,INELEMENT,ELEMENT,LT,DOCUMENT};
HEAD.nextStates = new ParserState[]{HEAD,ENDELEMENT,INELEMENT,ELEMENT};
HTML.nextStates = new ParserState[]{HTML,ENDELEMENT,INELEMENT,ELEMENT};
+ META.nextStates = new ParserState[]{META,ENDELEMENT,INELEMENT,ELEMENT};
TITLE.nextStates = new ParserState[]{TITLE,ENDELEMENT,INELEMENT,ELEMENT};
BASE.nextStates = new ParserState[]{BASE,ENDELEMENT,INELEMENT,ELEMENT};
}
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2009-07-17 16:18:34 UTC (rev 14958)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2009-07-17 17:32:45 UTC (rev 14959)
@@ -358,6 +358,7 @@
} else if (haveHead) {
// <title> or <base> in the head
if (!("title".equalsIgnoreCase(element.rawname) || "base"
+ .equalsIgnoreCase(element.rawname) || "meta"
.equalsIgnoreCase(element.rawname))) {
insertResources(element.prefix, element.uri);
}
@@ -506,6 +507,7 @@
if (haveHead) {
// <title> or <base> in the head
if (!("title".equalsIgnoreCase(name.rawname) || "base"
+ .equalsIgnoreCase(name.rawname) || "meta"
.equalsIgnoreCase(name.rawname))) {
insertResources(name.prefix, name.uri);
}
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyParser.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyParser.java 2009-07-17 16:18:34 UTC (rev 14958)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyParser.java 2009-07-17 17:32:45 UTC (rev 14959)
@@ -232,6 +232,7 @@
if (child instanceof Element) {
String nodeName = ((Element) child).getNodeName();
if (!("title".equalsIgnoreCase(nodeName) || "base"
+ .equalsIgnoreCase(nodeName) || "meta"
.equalsIgnoreCase(nodeName))) {
break;
}
Modified: branches/community/3.3.X/ui/layout/src/main/java/org/richfaces/renderkit/html/LayoutRenderer.java
===================================================================
--- branches/community/3.3.X/ui/layout/src/main/java/org/richfaces/renderkit/html/LayoutRenderer.java 2009-07-17 16:18:34 UTC (rev 14958)
+++ branches/community/3.3.X/ui/layout/src/main/java/org/richfaces/renderkit/html/LayoutRenderer.java 2009-07-17 17:32:45 UTC (rev 14959)
@@ -70,7 +70,7 @@
}
// line separator.
writer.startElement(HTML.DIV_ELEM, layout);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: block; height: 0; clear: both; visibility: hidden;", null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: block; height: 0;lineHeight:0px;fontSize:0px; clear: both; visibility: hidden;", null);
writer.writeText(".", null);
writer.endElement(HTML.DIV_ELEM);
if (null != structure.getBottom()) {
15 years, 2 months
JBoss Rich Faces SVN: r14958 - in root: docs/trunk and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-17 12:18:34 -0400 (Fri, 17 Jul 2009)
New Revision: 14958
Modified:
root/cdk/trunk/pom.xml
root/docs/trunk/pom.xml
root/examples/trunk/pom.xml
root/framework/trunk/version-matrix/pom.xml
root/ui/trunk/version-matrix/pom.xml
Log:
- distributionManagement added
- added "components" profile in examples
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2009-07-17 15:52:00 UTC (rev 14957)
+++ root/cdk/trunk/pom.xml 2009-07-17 16:18:34 UTC (rev 14958)
@@ -11,6 +11,24 @@
<packaging>pom</packaging>
<name>JSF components development kit</name>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
<modules>
<module>plugins</module>
<module>archetypes</module>
Modified: root/docs/trunk/pom.xml
===================================================================
--- root/docs/trunk/pom.xml 2009-07-17 15:52:00 UTC (rev 14957)
+++ root/docs/trunk/pom.xml 2009-07-17 16:18:34 UTC (rev 14958)
@@ -16,6 +16,24 @@
<docs.translation>en</docs.translation>
</properties>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
<repositories>
<repository>
<id>repository.jboss.org</id>
Modified: root/examples/trunk/pom.xml
===================================================================
--- root/examples/trunk/pom.xml 2009-07-17 15:52:00 UTC (rev 14957)
+++ root/examples/trunk/pom.xml 2009-07-17 16:18:34 UTC (rev 14958)
@@ -11,6 +11,24 @@
<packaging>pom</packaging>
<name>richfaces components examples</name>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
<dependencies>
<dependency>
<groupId>org.richfaces.framework</groupId>
@@ -70,11 +88,19 @@
</dependencies>
<modules>
- <module>components</module>
<module>richfaces-demo</module>
<module>photoalbum</module>
</modules>
+ <profiles>
+ <profile>
+ <id>components</id>
+ <modules>
+ <module>components</module>
+ </modules>
+ </profile>
+ </profiles>
+
<build>
<plugins>
<plugin>
Modified: root/framework/trunk/version-matrix/pom.xml
===================================================================
--- root/framework/trunk/version-matrix/pom.xml 2009-07-17 15:52:00 UTC (rev 14957)
+++ root/framework/trunk/version-matrix/pom.xml 2009-07-17 16:18:34 UTC (rev 14958)
@@ -17,6 +17,25 @@
<packaging>pom</packaging>
<name>JSF ajax framework version matrix</name>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
+
<repositories>
<repository>
<releases />
Modified: root/ui/trunk/version-matrix/pom.xml
===================================================================
--- root/ui/trunk/version-matrix/pom.xml 2009-07-17 15:52:00 UTC (rev 14957)
+++ root/ui/trunk/version-matrix/pom.xml 2009-07-17 16:18:34 UTC (rev 14958)
@@ -16,6 +16,24 @@
<name>richfaces ui components version matrix</name>
<packaging>pom</packaging>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
<repositories>
<repository>
<id>repository.jboss.org</id>
15 years, 2 months
JBoss Rich Faces SVN: r14957 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-07-17 11:52:00 -0400 (Fri, 17 Jul 2009)
New Revision: 14957
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
Log:
RF-7529:rich:ajaxValidator component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2009-07-17 15:14:51 UTC (rev 14956)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2009-07-17 15:52:00 UTC (rev 14957)
@@ -105,17 +105,25 @@
<programlisting role="XML"><![CDATA[...
<rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name" required="true">
- <f:validateLength minimum="3" maximum="12"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
- <rich:message for="name" />
- </h:panelGrid>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name" required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:ajaxValidator event="onblur"/>
+ </h:inputText>
+ <rich:message for="name" />
+
+ <h:outputText value="Age:" />
+ <h:inputText value="#{userBean.age}" id="age" required="true">
+ <f:convertNumber integerOnly="true"/>
+ <f:validateLongRange minimum="18" maximum="99"/>
+ <rich:ajaxValidator event="onblur"/>
+ </h:inputText>
+ <rich:message for="age"/>
+ </h:panelGrid>
</rich:panel>
...]]></programlisting>
@@ -152,7 +160,8 @@
the data to be validated. A reference on Hibernate
Validator can be found <ulink
url="http://www.hibernate.org/hib_docs/validator/reference/en/html_single/"
- >in Hibernated documentation</ulink>.</para>
+ >in Hibernated documentation</ulink>.
+ </para>
</listitem>
</itemizedlist>
@@ -161,16 +170,28 @@
<programlisting role="XML"><![CDATA[...
<rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name" required="true">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="name" />
- </h:panelGrid>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name" required="true">
+ <rich:ajaxValidator event="onblur" />
+ </h:inputText>
+ <rich:message for="name" />
+
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email">
+ <rich:ajaxValidator event="onblur" />
+ </h:inputText>
+ <rich:message for="email" />
+
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}" id="age">
+ <rich:ajaxValidator event="onblur" />
+ </h:inputText>
+ <rich:message for="age" />
+ </h:panelGrid>
</rich:panel>
...]]></programlisting>
@@ -178,39 +199,40 @@
<para>Here is the source code of the managed bean.</para>
- <programlisting role="JAVA"><![CDATA[...
-package org.richfaces.demo.validation;
+ <programlisting role="JAVA"><![CDATA[package org.richfaces.demo.validation;
-import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.Email;
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;
+import org.hibernate.validator.Pattern;
public class ValidationBean {
- @NotEmpty
- @Length(min=3,max=12)
- private String name;
- @Email (message="wrong email format")
- @NotEmpty
- private String email;
-
- public ValidationBean() {
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
-}
-...]]></programlisting>
+ private String progressString="Fill the form please";
+
+ @NotEmpty
+ @Pattern(regex=".*[^\\s].*", message="This string contain only spaces")
+ @Length(min=3,max=12)
+ private String name;
+ @Email
+ @NotEmpty
+ private String email;
+
+ @NotNull
+ @Min(18)
+ @Max(100)
+ private Integer age;
+
+ public ValidationBean() {
+ }
+ /* Corresponding Getters and Setters */
+
+}]]></programlisting>
+
<para>By default the Hibernate Validator generates an error message in 10
language, though you can redefine the messages that are displayed to a
user when validation fails. In the shows example it was done by adding
@@ -231,12 +253,9 @@
</section>
<section>
<title>Relevant Resources Links</title>
- <para><ulink
- url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxValidator.jsf?c=a..."
- > On RichFaces LiveDemo page </ulink> you can see an example of <emphasis
- role="bold">
- <property><rich:ajaxValidator></property>
- </emphasis> usage and sources for the given example. </para>
+ <para>
+ Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxValidator.jsf?c=a...">AjaxValidator page</ulink> at RichFaces LiveDemo for examples of component usage and their sources.
+ </para>
</section>
</section>
15 years, 2 months