[richfaces-svn-commits] JBoss Rich Faces SVN: r2332 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/wizard and 3 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Aug 17 20:55:27 EDT 2007
Author: SergeySmirnov
Date: 2007-08-17 20:55:26 -0400 (Fri, 17 Aug 2007)
New Revision: 2332
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/wizard/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/wizard/Profile.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/finalStep.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wizard.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep1.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep2.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/wizard/Profile.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/wizard/Profile.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/wizard/Profile.java 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,33 @@
+package org.richfaces.demo.wizard;
+
+public class Profile {
+ private String firstName;
+ private String lastName;
+ private String company;
+ private String notes;
+
+ public String getCompany() {
+ return company;
+ }
+ public void setCompany(String company) {
+ this.company = company;
+ }
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ public String getNotes() {
+ return notes;
+ }
+ public void setNotes(String notes) {
+ this.notes = notes;
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/finalStep.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/finalStep.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/finalStep.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,22 @@
+<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:panelGrid columns="2" columnClasses="wfcol1">
+ <h:outputText value="First Name:" />
+ <h:outputText value="#{profile.firstName}"/>
+ <h:outputText value="Last Name:" />
+ <h:outputText value="#{profile.lastName}"/>
+ <h:outputText value="Company:" />
+ <h:outputText value="#{profile.company}"/>
+ <h:outputText value="Notes:" />
+ <h:outputText value="#{profile.notes}"/>
+
+
+ </h:panelGrid>
+ <a4j:commandButton value="<<Previous" immediate="true" action="previous"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wizard.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wizard.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wizard.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,37 @@
+<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">
+ .col1 { vertical-align:top; }
+ .col2 { vertical-align:top; width:450px; }
+ .wizard { width:400px; }
+ .wform td { vertical-align:top; }
+ .wfcol1 { width:60px; vertical-align:top; }
+ .wfcol2 { vertical-align:top; }
+ .wfcol3 { vertical-align:top; }
+ .s1row td { height:30px; }
+ .rich-message { color:red; }
+ </style>
+
+ <h:panelGrid width="100%" columns="2" columnClasses="col1,col2">
+ <f:verbatim>
+ Additional explanation will be here.
+
+ </f:verbatim>
+ <a4j:keepAlive beanName="profile" />
+ <rich:panel styleClass="wizard">
+ <f:facet name="header">
+ <h:outputText value="Using a4j:include for Wizard-like behaviour" />
+ </f:facet>
+ <h:form>
+ <a4j:include viewId="/richfaces/include/examples/wstep1.xhtml" />
+ </h:form>
+ </rich:panel>
+
+ </h:panelGrid>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep1.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep1.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep1.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,24 @@
+<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:panelGrid rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
+ <h:outputText value="First Name:" />
+ <h:inputText id="fn" value="#{profile.firstName}" label="First Name" required="true" />
+ <rich:message for="fn" />
+
+ <h:outputText value="Last Name:" />
+ <h:inputText id="ln" value="#{profile.lastName}" label="Last Name" required="true" />
+ <rich:message for="ln" />
+
+ <h:outputText value="Company:" />
+ <h:inputText id="comp" value="#{profile.company}" label="Company" required="true" />
+ <rich:message for="comp"/>
+
+ </h:panelGrid>
+ <a4j:commandButton value="Next >>" action="next"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep2.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep2.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/examples/wstep2.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,18 @@
+<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:panelGrid columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
+ <h:outputText value="Notes:" />
+ <h:inputTextarea cols="20" rows="4" id="notes" value="#{profile.notes}" label="Notes" required="true" />
+ <rich:message for="notes" />
+
+
+ </h:panelGrid>
+ <a4j:commandButton value="<<Previous" immediate="true" action="previous"/>
+ <a4j:commandButton value="Next >>" action="next"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include/usage.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,47 @@
+<!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>a4j:include functionality is equal to the facelets' ui:include functionality, plus, enables the
+ partial page navigation in Ajax mode. The standard JSF navigation rules are used to define the
+ navigation between the view.
+ </p>
+ <p>
+ <b>viewId</b> attribute specify the view id of the page that will be included. It should be
+ the full context-relative path of the resource in order to use as from-view and to-view in the
+ JSF navigation cases. The following demo shows the example of three-steps wizard created
+ using a4j:include:
+ </p>
+
+ <div class="sample-container">
+ <ui:include src="/richfaces/include/examples/wizard.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/include/examples/wizard.xhtml"/>
+ <ui:param name="openlabel" value="View Page Source" />
+ </ui:include>
+
+ </div>
+
+ <p>
+ The Ajax command component (button, link, jsFunction, etc) should be located inside the
+ a4j:include in order to having a partial navigation. When the navigation
+ performs, the part of the component tree content is replaced with the content of view given
+ by navigation rule.
+ </p>
+ <p> The content of the a4j:include is not isolated from the whole view. You can point to the other
+ parts of of the view with reRender if you want to update them while you navigate inside the
+ a4j:include.
+ </p>
+
+
+ </ui:define>
+
+</ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/include.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/include.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/include.xhtml 2007-08-18 00:55:26 UTC (rev 2332)
@@ -0,0 +1,17 @@
+<!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 - Include</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/include/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
More information about the richfaces-svn-commits
mailing list