Author: ilya_shaikovsky
Date: 2007-08-31 08:17:16 -0400 (Fri, 31 Aug 2007)
New Revision: 2649
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataGrid/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml
Log:
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml 2007-08-31
12:17:16 UTC (rev 2649)
@@ -0,0 +1,63 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <style type="text/css">
+ .rich-message-marker img {
+ padding-right:7px;
+ }
+ .rich-message-label {
+ color:red;
+ }
+ .top{
+ vertical-align:top;
+ }
+ </style>
+
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Form Validation. Using rich:messages"/>
+ </f:facet>
+
+ <h:form>
+ <h:panelGrid columns="2" columnClasses="top">
+ <h:panelGrid columns="2">
+ <h:outputText value="Name:" />
+ <h:inputText label="Name" id="name" required="true"
value="#{userBean.name}">
+ <f:validateLength minimum="3" />
+ </h:inputText>
+ <h:outputText value="Job:" />
+ <h:inputText label="Job" id="job" required="true"
value="#{userBean.job}">
+ <f:validateLength minimum="3" maximum="50" />
+ </h:inputText>
+ <h:outputText value="Address:" />
+ <h:inputText label="Address" id="address"
required="true" value="#{userBean.address}">
+ <f:validateLength minimum="10" />
+ </h:inputText>
+ <h:outputText value="Zip:" />
+ <h:inputText label="Zip" id="zip" required="true"
value="#{userBean.zip}">
+ <f:validateLength minimum="4" maximum="9" />
+ </h:inputText>
+ <f:facet name="footer">
+ <a4j:commandButton value="Validate" />
+ </f:facet>
+ </h:panelGrid>
+ <rich:messages passedLabel="Data is allowed to be stored."
layout="list">
+ <f:facet name="header">
+ <h:outputText value="Entered Data Status:"></h:outputText>
+ </f:facet>
+ <f:facet name="passedMarker">
+ <h:graphicImage value="/images/ajax/passed.gif" />
+ </f:facet>
+ <f:facet name="errorMarker">
+ <h:graphicImage value="/images/ajax/error.gif" />
+ </f:facet>
+ </rich:messages>
+ </h:panelGrid>
+ </h:form>
+ </rich:panel>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml 2007-08-31
12:17:16 UTC (rev 2649)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+ <p>rich:messages is an extension for a standard h:messages component. In
addition to what the
+ standard component provides, rich:messages:
+ <ul>
+ <li>does not require to be wrapped with a4j:outputPanel in order to be rendered
during the
+ Ajax requests</li>
+ <li>allows to have one "passed" or a few "failed" markers
before the text labels</li>
+ <li>has a predefined css class names for different kinds of messages
severities</li>
+ </ul>
+ </p>
+ <p>The message markers is defined with a facets. There are several facets names
available
+ to design the marker for different kind of messages severities. The following example
+ shows how the markers might be used to mark the "passed" and
"failed" form fields.
+ Fill the form and click "Validate" button to see the entered data passing
the
+ defined validation rules.
+ </p>
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/messages/examples/form.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/messages/examples/form.xhtml"/>
+ </ui:include>
+
+ </div>
+ </ui:define>
+
+ </ui:composition>
+</html>