Author: ilya_shaikovsky
Date: 2008-07-31 06:01:33 -0400 (Thu, 31 Jul 2008)
New Revision: 9839
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Bean.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Config.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/LoginAction.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/RegisterAction.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/User.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/DayStatistics.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/example.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/loginResult.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/registerResult.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/usage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
Log:
validation demos chages
stateApi example draft
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Bean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Bean.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Bean.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,40 @@
+package org.richfaces.demo.stateApi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Bean {
+
+ private String name;
+
+ private String password;
+
+ private String confirmPassword;
+
+ private List<User> users = new ArrayList<User>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getConfirmPassword() {
+ return confirmPassword;
+ }
+
+ public void setConfirmPassword(String confirmPassword) {
+ this.confirmPassword = confirmPassword;
+ }
+
+}
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Config.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Config.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/Config.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,83 @@
+/**
+ *
+ */
+package org.richfaces.demo.stateApi;
+
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.States;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Config {
+
+ /**
+ * @return States
+ */
+ public States getStates() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ States states = new States();
+
+ // Registering new User State definition
+ states.setCurrentState("register"); // Name of the new state
+
+ // Text labels, properties and Labels for controls in "register" state
+ states.put("showConfirm", Boolean.TRUE); // confirm field rendering
+ states.put("link", "(To login)"); // Switch State link label
+ states.put("okBtn", "Register"); // Login/Register button label
+ states.put("stateTitle", "Register New User"); // Panel title
+
+ ExpressionFactory expressionFactory = facesContext.getApplication()
+ .getExpressionFactory();
+
+ // Define "registerbean" available under "bean" EL binding on the
page
+ ValueExpression beanExpression = expressionFactory
+ .createValueExpression(facesContext.getELContext(),
+ "#{registerbean}", Bean.class);
+ states.put("bean", beanExpression);
+
+ // Define "registeraction" available under "action" EL binding on
the
+ // page
+ beanExpression = expressionFactory.createValueExpression(facesContext
+ .getELContext(), "#{registeraction}", RegisterAction.class);
+ states.put("action", beanExpression);
+
+ // Define method expression inside registeraction binding for this state
+ MethodExpression methodExpression = expressionFactory.createMethodExpression(
+ facesContext.getELContext(), "#{registeraction.ok}",
+ String.class, new Class[] {});
+ states.put("ok", methodExpression);
+
+ // Outcome for switching to login state definition
+ states.setNavigation("switch", "login");
+
+ // Login Existent User State analogous definition
+ states.setCurrentState("login");
+ states.put("showConfirm", Boolean.FALSE);
+ states.put("link", "(To register)");
+ states.put("okBtn", "Login");
+ states.put("stateTitle", "Login Existent User");
+
+ beanExpression = expressionFactory.createValueExpression(facesContext
+ .getELContext(), "#{loginbean}", Bean.class);
+ states.put("bean", beanExpression);
+
+ beanExpression = expressionFactory.createValueExpression(facesContext
+ .getELContext(), "#{loginaction}", LoginAction.class);
+ states.put("action", beanExpression);
+
+ methodExpression = expressionFactory.createMethodExpression(
+ facesContext.getELContext(), "#{loginaction.ok}",
+ String.class, new Class[] {});
+ states.put("ok", methodExpression);
+
+ states.setNavigation("switch", "register");
+
+ return states;
+ }
+}
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/LoginAction.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/LoginAction.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/LoginAction.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,34 @@
+/**
+ *
+ */
+package org.richfaces.demo.stateApi;
+
+import javax.faces.event.ActionEvent;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class LoginAction
+{
+
+ private Bean bean;
+
+ public void listener(ActionEvent event) {
+ //fetching some data on login
+ }
+
+ public String ok() {
+ System.out.println("LoginAction.ok()");
+ return "loggedIn";
+ }
+
+ public Bean getBean() {
+ return bean;
+ }
+
+ public void setBean(Bean bean) {
+ this.bean = bean;
+ }
+
+}
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/RegisterAction.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/RegisterAction.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/RegisterAction.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,55 @@
+/**
+ *
+ */
+package org.richfaces.demo.stateApi;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+
+public class RegisterAction {
+ private Bean bean;
+
+ public void listener(ActionEvent event) {
+ //Check if the password fields are equals
+ if (bean.getConfirmPassword().equals(bean.getPassword())) {
+ FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(FacesContext.getCurrentInstance(),
null, "registered");
+ } else {
+ FacesContext.getCurrentInstance().addMessage(
+ event.getComponent().getClientId(
+ FacesContext.getCurrentInstance()),
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ "Different passwords entered",
+ "Different passwords entered"));
+ }
+ }
+
+ public String ok() {
+ if (FacesContext.getCurrentInstance().getMaximumSeverity()==null){
+ return "registered";
+ }else{
+ return null;
+ }
+ }
+
+ /**
+ * @return the bean
+ */
+ public Bean getBean() {
+ return bean;
+ }
+
+ /**
+ * @param bean
+ * the bean to set
+ */
+ public void setBean(Bean bean) {
+ this.bean = bean;
+ }
+
+}
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/User.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/User.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/stateApi/User.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,20 @@
+package org.richfaces.demo.stateApi;
+
+public class User {
+
+ private String name;
+ private String password;
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/DayStatistics.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/DayStatistics.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/DayStatistics.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package org.richfaces.demo.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotNull;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class DayStatistics {
+
+ public DayStatistics() {
+ dayPasstimes.add(new PassTime("Sport",0));
+ dayPasstimes.add(new PassTime("Entertainment",0));
+ dayPasstimes.add(new PassTime("Sleeping",0));
+ dayPasstimes.add(new PassTime("Games",0));
+ }
+
+ private List<PassTime> dayPasstimes = new ArrayList<PassTime>();
+
+ public List<PassTime> getDayPasstimes() {
+ return dayPasstimes;
+ }
+
+ public void setDayPasstimes(List<PassTime> dayPasstimes) {
+ this.dayPasstimes = dayPasstimes;
+ }
+
+ @NotNull
+ @Min(value=1,message="Please feel at list one entry")
+ @Max(value=24, message="Only 24h in a day!")
+ public Integer getTotalTime() {
+ Integer result = new Integer(0);
+ for (PassTime passtime : dayPasstimes) {
+ result+=passtime.getTime();
+ }
+ return result;
+ }
+
+}
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,36 @@
+package org.richfaces.demo.validation;
+
+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;
+
+public class PassTime {
+
+ public PassTime(String title, Integer time) {
+ setTitle(title);
+ setTime(time);
+ }
+
+ @NotEmpty
+ @Length(max=12, min=3)
+ private String title;
+ @NotNull
+ @Min(0)
+ @Max(12)
+ private Integer time;
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ public Integer getTime() {
+ return time;
+ }
+ public void setTime(Integer time) {
+ this.time = time;
+ }
+
+}
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-07-31
09:52:04 UTC (rev 9838)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-07-31
10:01:33 UTC (rev 9839)
@@ -87,3 +87,4 @@
ajaxValidator=richValidators, \t Ajax Validator,
\t\t/images/ico_ajaxValidator.gif, \t\t/images/cn_ajaxValidator.gif,
ArchitectureOverview.html\#ajaxValidator,
jbossrichfaces/freezone/docs/tlddoc/rich/ajaxValidator.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html,
\t\t\t\t\t/richfaces/ajaxValidator.jsf
beanValidator=richValidators, \t Bean Validator,
\t\t/images/ico_beanValidator.gif, \t\t/images/cn_beanValidator.gif,
ArchitectureOverview.html\#beanValidator,
jbossrichfaces/freezone/docs/tlddoc/rich/beanValidator.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html,
\t\t\t\t\t/richfaces/beanValidator.jsf
graphValidator=richValidators, \t Graph Validator,
\t\t/images/ico_graphValidator.gif, \t\t/images/cn_graphValidator.gif,
ArchitectureOverview.html\#graphValidator,
jbossrichfaces/freezone/docs/tlddoc/rich/graphValidator.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html,
\t\t\t\t\t/richfaces/graphValidator.jsf
+stateAPI=richMisc, \t State Manager API, \t\t/images/ico_stateAPI.gif,
\t\t/images/cn_stateAPI.gif, ArchitectureOverview.html\#stateAPI,
jbossrichfaces/freezone/docs/tlddoc/rich/graphValidator.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html,
\t\t\t\t\t/richfaces/stateAPI.jsf
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-07-31
09:52:04 UTC (rev 9838)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -7,6 +7,51 @@
<converter-class>org.richfaces.demo.listShuttle.Converter</converter-class>
</converter>
<managed-bean>
+ <managed-bean-name>loginbean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.stateApi.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>registerbean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.stateApi.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>loginaction</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.stateApi.LoginAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>bean</property-name>
+ <property-class>org.richfaces.demo.stateApi.Bean</property-class>
+ <value>#{loginbean}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>registeraction</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.stateApi.RegisterAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>bean</property-name>
+ <property-class>org.richfaces.demo.stateApi.Bean</property-class>
+ <value>#{registerbean}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>state</managed-bean-name>
+ <managed-bean-class>org.richfaces.ui.model.States</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>states</property-name>
+ <property-class>org.richfaces.ui.model.States</property-class>
+ <value>#{config.states}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>config</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.stateApi.Config</managed-bean-class>
+ <managed-bean-scope>none</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>skinBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.common.SkinBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
@@ -333,6 +378,21 @@
<managed-bean-class>org.richfaces.demo.validation.ValidationBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>dayStatistics</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.validation.DayStatistics</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>registerAction</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.stateApi.RegisterAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>loginAction</managed-bean-name>
+
<managed-bean-class>org.richfaces.demo.stateApi.LoginAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
@@ -366,6 +426,42 @@
<redirect/>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/richfaces/stateAPI/examples/simple.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>loggedIn</from-outcome>
+ <to-view-id>/richfaces/stateAPI/examples/loginResult.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>registered</from-outcome>
+
<to-view-id>/richfaces/stateAPI/examples/registerResult.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+
<from-view-id>/richfaces/stateAPI/examples/loginResult.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>logout</from-outcome>
+ <to-view-id>/richfaces/stateAPI/examples/simple.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+
<from-view-id>/richfaces/stateAPI/examples/registerResult.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>logout</from-outcome>
+ <to-view-id>/richfaces/stateAPI/examples/simple.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <application>
+
<navigation-handler>org.richfaces.ui.application.StateNavigationHandler</navigation-handler>
+ <el-resolver>org.richfaces.el.StateELResolver</el-resolver>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>en</supported-locale>
+ </locale-config>
+ </application>
+ <factory>
+
<application-factory>org.richfaces.ui.application.StateApplicationFactory</application-factory>
+ </factory>
<lifecycle>
<phase-listener>org.richfaces.treemodeladaptor.PostbackPhaseListener</phase-listener>
</lifecycle>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -7,6 +7,11 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components -
Ajax Validator</ui:define>
<ui:define name="body">
+ <style>
+ .rich-message-label{
+ color:red;
+ }
+ </style>
<ui:include src="/templates/include/tab-panel.xhtml" />
</ui:define>
</ui:composition>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -1,12 +1,27 @@
-<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">
-
-<p>
-Bean Validator Example
-</p>
-
+<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">
+
+ <h:form>
+ <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"/>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email"/>
+ <rich:message for="email" />
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}" id="age"/>
+ <rich:message for="age" />
+ </h:panelGrid>
+ <a4j:commandButton value="Submit"/>
+ </rich:panel>
+ </h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -7,6 +7,11 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components -
Bean Validator</ui:define>
<ui:define name="body">
+ <style>
+ .rich-message-label{
+ color:red;
+ }
+ </style>
<ui:include src="/templates/include/tab-panel.xhtml" />
</ui:define>
</ui:composition>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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">
+
+ <h:form>
+ <rich:graphValidator value="#{dayStatistics}">
+ <rich:dataTable value="#{dayStatistics.dayPasstimes}" var="pt"
id="table">
+ <rich:column>
+ <h:inputText value="#{pt.title}" >
+ <a4j:support reRender="out" event="onkeyup"/>
+ </h:inputText>
+ </rich:column>
+ <rich:column>
+ <rich:inputNumberSpinner minValue="0" maxValue="24"
+ value="#{pt.time}" id="time">
+ <rich:ajaxValidator event="onblur" />
+ </rich:inputNumberSpinner>
+ <rich:message for="time" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{pt.title}" id="out"/>
+ </rich:column>
+ </rich:dataTable>
+ </rich:graphValidator>
+ <h:commandButton value="Store my details" />
+ </h:form>
+</ui:composition>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -21,6 +21,19 @@
</ui:include>
</div>
</fieldset>
+ <p>
+ Description
+ </p>
+
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Title</legend>
+ <div class="sample-container" >
+ <ui:include
src="/richfaces/graphValidator/examples/additionalValidation.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/graphValidator/examples/additionalValidation.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
</ui:define>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -7,6 +7,11 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components -
Graph Validator</ui:define>
<ui:define name="body">
+ <style>
+ .rich-message-label{
+ color:red;
+ }
+ </style>
<ui:include src="/templates/include/tab-panel.xhtml" />
</ui:define>
</ui:composition>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/example.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/example.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/example.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -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: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">
+
+ <ui:composition>
+ <h:panelGroup id="wizard">
+ <h:form>
+ <a4j:include viewId="/richfaces/stateAPI/examples/simple.xhtml"/>
+ </h:form>
+ </h:panelGroup>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/loginResult.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/loginResult.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/loginResult.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+ <rich:panel>
+ <f:facet name="header">
+ Welcome!
+ </f:facet>
+ <h:outputText value="Successfully logged in as #{state.bean.name}"/>
+ <br/>
+ <a4j:commandLink value="logout" action="logout"/>
+ </rich:panel>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/registerResult.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/registerResult.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/registerResult.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+ <rich:panel>
+ <f:facet name="header">
+ Welcome!
+ </f:facet>
+ <h:outputText value="Successfully registered as #{state.bean.name}"/>
+ <br/>
+ <a4j:commandLink value="logout" action="logout"/>
+ </rich:panel>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/simple.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/examples/simple.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,40 @@
+<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">
+
+ <rich:panel id="panel">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="#{state.stateTitle}"/>
+ <a4j:commandLink action="switch" value="#{state.link}"
immediate="true" reRender="panel"/>
+ </h:panelGroup>
+ </f:facet>
+
+ <rich:message for="action"/>
+
+ <h:panelGrid columns="3">
+ <h:outputText value="username" />
+ <h:inputText value="#{state.bean.name}" id="name"
required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ </h:inputText>
+ <rich:message for="name" showSummary="false"/>
+ <h:outputText value="password" />
+
+ <h:inputSecret value="#{state.bean.password}" id="password"
required="true">
+ <f:validateLength minimum="5" maximum="12"/>
+ </h:inputSecret>
+ <rich:message for="password"/>
+ <h:outputText value="confirm" rendered="#{state.showConfirm}"
/>
+
+ <h:inputSecret value="#{state.bean.confirmPassword}"
+ rendered="#{state.showConfirm}" id="confirm"
required="true">
+ <f:validateLength minimum="5" maximum="12"/>
+ </h:inputSecret>
+ <rich:message for="confirm"/>
+ </h:panelGrid>
+ <a4j:commandButton actionListener="#{state.action.listener}"
action="#{state.ok}" value="#{state.okBtn}"
id="action"/>
+ </rich:panel>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/usage.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI/usage.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,29 @@
+<!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">
+ <style>
+ .rich-message-label{
+ color:red;
+ }
+ </style>
+ <p>
+ Description
+ </p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Title</legend>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/stateAPI/examples/example.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/stateAPI/examples/example.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/stateAPI.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -0,0 +1,13 @@
+<!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:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
State Manager</ui:define>
+ <ui:define name="body">
+ <ui:include src="/templates/include/tab-panel.xhtml"/>
+ </ui:define>
+</ui:composition>
+</html>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-07-31
09:52:04 UTC (rev 9838)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-07-31
10:01:33 UTC (rev 9839)
@@ -30,6 +30,19 @@
</ui:include>
</div>
</fieldset>
+ <p>
+ Description
+ </p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Mail Editor sample</legend>
+ <div class="sample-container">
+ <ui:include
src="/richfaces/suggestionBox/examples/mailWizard.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/suggestionBox/examples/mailWizard.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+
</ui:define>