JBoss Rich Faces SVN: r2597 - in trunk/samples/seamEAR: ear and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-29 20:35:48 -0400 (Wed, 29 Aug 2007)
New Revision: 2597
Added:
trunk/samples/seamEAR/ear/src/main/application/pageflows/
trunk/samples/seamEAR/ear/src/main/application/pageflows/pageflow.jpdl.xml
trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/Flow.java
trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/FlowBean.java
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/pages/Pageflow.jsp
Modified:
trunk/samples/seamEAR/ear/pom.xml
trunk/samples/seamEAR/pom.xml
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/pages.xml
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/web.xml
Log:
Append jpdl pageFlow sample
Modified: trunk/samples/seamEAR/ear/pom.xml
===================================================================
--- trunk/samples/seamEAR/ear/pom.xml 2007-08-30 00:26:18 UTC (rev 2596)
+++ trunk/samples/seamEAR/ear/pom.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -65,6 +65,13 @@
<systemPath>${seamHome}/lib/jboss-el.jar</systemPath>
<scope>system</scope>
</dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>3.2.1-GA</version>
+ <systemPath>${seamHome}/lib/jbpm-jpdl.jar</systemPath>
+ <scope>system</scope>
+ </dependency>
</dependencies>
<build>
<finalName>seamEAR</finalName>
@@ -97,6 +104,11 @@
<bundleDir>lib</bundleDir>
</jarModule>
<jarModule>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <bundleDir>lib</bundleDir>
+ </jarModule>
+ <jarModule>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
<includeInApplicationXml>
Added: trunk/samples/seamEAR/ear/src/main/application/pageflows/pageflow.jpdl.xml
===================================================================
--- trunk/samples/seamEAR/ear/src/main/application/pageflows/pageflow.jpdl.xml (rev 0)
+++ trunk/samples/seamEAR/ear/src/main/application/pageflows/pageflow.jpdl.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<pageflow-definition xmlns="http://jboss.com/products/seam/pageflow"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
+ name="pageflow">
+
+ <start-page view-id="/pages/Pageflow.jsp" name="pageflow"
+ redirect="yes">
+ <description>test</description>
+ <transition name="fillList" to="fillListDecision" />
+
+ </start-page>
+
+ <decision name="fillListDecision" expression="#{flow.fillList}">
+ <transition name="OK" to="pageflow" />
+ <transition name="NOT" to="pageflow" />
+ </decision>
+
+
+</pageflow-definition>
+
+
Property changes on: trunk/samples/seamEAR/ear/src/main/application/pageflows/pageflow.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/Flow.java
===================================================================
--- trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/Flow.java (rev 0)
+++ trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/Flow.java 2007-08-30 00:35:48 UTC (rev 2597)
@@ -0,0 +1,20 @@
+package org.richfaces.seam;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.Local;
+
+@Local
+public interface Flow {
+
+ public Date getTime();
+
+ /**
+ * @return the lista
+ */
+ public List<String> getLista();
+
+ public String fillList();
+
+}
\ No newline at end of file
Property changes on: trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/Flow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/FlowBean.java
===================================================================
--- trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/FlowBean.java (rev 0)
+++ trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/FlowBean.java 2007-08-30 00:35:48 UTC (rev 2597)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.seam;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.Init;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * @author asmirnov
+ *
+ */
+@Stateful
+@Name("flow")
+(a)Scope(ScopeType.SESSION)
+public class FlowBean implements Flow {
+
+ private List<String> _lista ;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.seam.Flow#getTime()
+ */
+ public Date getTime(){
+ return new Date(System.currentTimeMillis());
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.seam.Flow#getLista()
+ */
+ public List<String> getLista() {
+ return _lista;
+ }
+
+ /**
+ * @param lista the lista to set
+ */
+ public void setLista(List<String> lista) {
+ _lista = lista;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.seam.Flow#fillList()
+ */
+ public String fillList(){
+ getLista().add(getTime().toString());
+ return "FALSE";
+ }
+
+ @Init
+ public void init(){
+ setLista(new ArrayList<String>());
+ }
+
+ @Remove
+ public void destroy(){
+ setLista(null);
+ }
+}
Property changes on: trunk/samples/seamEAR/ejbs/src/main/java/org/richfaces/seam/FlowBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/samples/seamEAR/pom.xml
===================================================================
--- trunk/samples/seamEAR/pom.xml 2007-08-30 00:26:18 UTC (rev 2596)
+++ trunk/samples/seamEAR/pom.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -45,6 +45,21 @@
</plugins>
</pluginManagement>
</build>
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
<dependencyManagement>
<dependencies>
<dependency>
Modified: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2007-08-30 00:26:18 UTC (rev 2596)
+++ trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
- xmlns:core="http://jboss.com/products/seam/core"
- xmlns:persistence="http://jboss.com/products/seam/persistence"
- xmlns:drools="http://jboss.com/products/seam/drools"
- xmlns:bpm="http://jboss.com/products/seam/bpm"
- xmlns:security="http://jboss.com/products/seam/security"
- xmlns:mail="http://jboss.com/products/seam/mail"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation=
- "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:drools="http://jboss.com/products/seam/drools"
+ xmlns:bpm="http://jboss.com/products/seam/bpm"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:mail="http://jboss.com/products/seam/mail"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
@@ -16,37 +15,43 @@
http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
- <core:init debug="true" jndi-pattern="seamEAR/#{ejbName}/local"/>
-
- <core:manager concurrent-request-timeout="500"
- conversation-timeout="120000"
- conversation-id-parameter="cid"/>
-
- <persistence:managed-persistence-context name="entityManager"
- auto-create="true"
- persistence-unit-jndi-name="java:/seamEAREntityManagerFactory"/>
- <!--
- <persistence:entity-manager-factory name="seamEAREntityManagerFactory"
- persistence-unit-name="seamEAR"/>
- -->
+ <core:init debug="true" jndi-pattern="seamEAR/#{ejbName}/local" />
- <security:identity authenticate-method="#{authenticator.authenticate}"/>
-
- <event type="org.jboss.seam.notLoggedIn">
- <action expression="#{redirect.captureCurrentView}"/>
- </event>
- <event type="org.jboss.seam.postAuthenticate">
- <action expression="#{redirect.returnToCapturedView}"/>
- </event>
-
- <mail:mail-session host="localhost" port="2525" username="test" password="test" />
-
- <!-- For use with jBPM pageflow or process management -->
- <!--
- <bpm:jbpm>
- <bpm:process-definitions></bpm:process-definitions>
- <bpm:pageflow-definitions></bpm:pageflow-definitions>
- </bpm:jbpm>
- -->
-
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000" conversation-id-parameter="cid" />
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ persistence-unit-jndi-name="java:/seamEAREntityManagerFactory" />
+ <!--
+ <persistence:entity-manager-factory name="seamEAREntityManagerFactory"
+ persistence-unit-name="seamEAR"/>
+ -->
+
+ <security:identity
+ authenticate-method="#{authenticator.authenticate}" />
+
+ <event type="org.jboss.seam.notLoggedIn">
+ <action expression="#{redirect.captureCurrentView}" />
+ </event>
+ <event type="org.jboss.seam.postAuthenticate">
+ <action expression="#{redirect.returnToCapturedView}" />
+ </event>
+
+ <mail:mail-session host="localhost" port="2525" username="test"
+ password="test" />
+
+ <!-- For use with jBPM pageflow or process management -->
+ <!--
+ <bpm:jbpm>
+ <bpm:process-definitions></bpm:process-definitions>
+ <bpm:pageflow-definitions></bpm:pageflow-definitions>
+ </bpm:jbpm>
+ -->
+ <bpm:jbpm>
+ <bpm:pageflow-definitions>
+ <value>/pageflows/pageflow.jpdl.xml</value>
+ </bpm:pageflow-definitions>
+ </bpm:jbpm>
+
</components>
Modified: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/pages.xml 2007-08-30 00:26:18 UTC (rev 2596)
+++ trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/pages.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -14,6 +14,11 @@
</navigation>
</page>
+ <page view-id="/pages/Pageflow.jsp">
+ <begin-conversation join="true" flush-mode="MANUAL"
+ pageflow="pageflow" />
+ </page>
+
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
Modified: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/web.xml 2007-08-30 00:26:18 UTC (rev 2596)
+++ trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/web.xml 2007-08-30 00:35:48 UTC (rev 2597)
@@ -15,10 +15,14 @@
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
<!-- JSF -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
+ <param-value>.jsp</param-value>
</context-param>
<filter>
<filter-name>Seam Filter</filter-name>
Added: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/pages/Pageflow.jsp
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/pages/Pageflow.jsp (rev 0)
+++ trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/pages/Pageflow.jsp 2007-08-30 00:35:48 UTC (rev 2597)
@@ -0,0 +1,42 @@
+<%@ page contentType="text/html; charset=UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="r"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a"%>
+
+<html>
+<head><title>JBPM sample</title></head>
+<body>
+<f:view>
+ <h:form id="forma">
+ <h:panelGrid columns="2">
+ <h:outputText value="System.currentTimeMillis()"/>
+ <h:outputText id="time" value="#{flow.time}"/>
+ <a:commandButton value="add calling backing bean action"
+ action="#{flow.fillList}" reRender="tablica"/>
+ <a:commandButton value="add calling pageflow action"
+ action="fillList" reRender="tablica"/>
+ </h:panelGrid>
+
+
+ <r:dataTable id="tablica" width="100%"
+ rows="10"
+ onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
+ onRowMouseOut="this.style.backgroundColor=''"
+ cellpadding="0" cellspacing="0" var="v" rowKeyVar="rb"
+ value="#{flow.lista}">
+
+ <r:column>
+ <h:outputText value="#{v}"/>
+ </r:column>
+
+ </r:dataTable>
+
+ <r:datascroller id="scrollerTablica" for="tablica" maxPages="20"/>
+
+ </h:form>
+ notice how time changes when calling pageflow action
+</f:view>
+</body>
+</html>
Property changes on: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/pages/Pageflow.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 4 months
JBoss Rich Faces SVN: r2596 - in trunk/samples/richfaces-demo/src/main: resources/org/richfaces/demo/common and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-08-29 20:26:18 -0400 (Wed, 29 Aug 2007)
New Revision: 2596
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/ajax/error.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ajax/passed.gif
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
Log:
demo update. message has been added
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java 2007-08-30 00:08:45 UTC (rev 2595)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java 2007-08-30 00:26:18 UTC (rev 2596)
@@ -7,6 +7,9 @@
private java.lang.Integer screenWidth;
private java.lang.Integer screenHeight;
private String job;
+ private String address;
+ private String city;
+ private String zip;
private Date date;
private boolean pollEnabled;
@@ -71,5 +74,29 @@
public void setPollEnabled(boolean pollEnabled) {
this.pollEnabled = pollEnabled;
}
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
}
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 2007-08-30 00:08:45 UTC (rev 2595)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-30 00:26:18 UTC (rev 2596)
@@ -34,8 +34,8 @@
menuItem= richMenu, Menu Item, /images/ico_dropDownMenu.gif, /images/cn_MenuItem.gif, RichFacesComponentsLibrary.html#menuItem, jbossrichfaces/freezone/docs/tlddoc/rich/menuItem.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuItem.html, /richfaces/dropDownMenu.jsf
menuSeparator= richMenu, Menu Separator, /images/ico_dropDownMenu.gif, /images/cn_MenuSeparator.gif, RichFacesComponentsLibrary.html#menuSeparator, jbossrichfaces/freezone/docs/tlddoc/rich/menuSeparator.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuSeparator.html, /richfaces/dropDownMenu.jsf
calendar= richInputs, Calendar, /images/ico_common.gif, /images/cn_Calendar.gif, RichFacesComponentsLibrary.html#calendar, jbossrichfaces/freezone/docs/tlddoc/rich/calendar.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UICalendar.html, /richfaces/calendar.jsf
-message= richMisc, Message, /images/ico_common.gif, /images/cn_Message.gif, RichFacesComponentsLibrary.html#message, jbossrichfaces/freezone/docs/tlddoc/rich/message.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessage.html, /richfaces/comingSoon.jsf
-messages= richMisc, Messages, /images/ico_common.gif, /images/cn_Messages.gif, RichFacesComponentsLibrary.html#messages, jbossrichfaces/freezone/docs/tlddoc/rich/messages.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessages.html, /richfaces/comingSoon.jsf
+message= richMisc, Message, /images/ico_common.gif, /images/cn_Message.gif, RichFacesComponentsLibrary.html#message, jbossrichfaces/freezone/docs/tlddoc/rich/message.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessage.html, /richfaces/message.jsf
+messages= richMisc, Messages, /images/ico_common.gif, /images/cn_Messages.gif, RichFacesComponentsLibrary.html#messages, jbossrichfaces/freezone/docs/tlddoc/rich/messages.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessages.html, /richfaces/messages.jsf
virtualEarth= richMisc, Virtual Earth, /images/ico_VirtualEarth.gif, /images/cn_VirtualEarth.gif, RichFacesComponentsLibrary.html#virtualEarth, jbossrichfaces/freezone/docs/tlddoc/rich/virtualEarth.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIVirtualEarth.html, /richfaces/comingSoon.jsf
insert= richMisc, Insert, /images/ico_common.gif, /images/cn_insert.gif, RichFacesComponentsLibrary.html#insert, jbossrichfaces/freezone/docs/tlddoc/rich/insert.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInsert.html, /richfaces/insert.jsf
scrollableDataTable= richDataIterators, Scrollable Data Table, /images/ico_common.gif, /images/cn_ScrollableDataTable.gif, RichFacesComponentsLibrary.html#scrollableDataTable, jbossrichfaces/freezone/docs/tlddoc/rich/scrollableDataTable, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIscrollableDataTable.html, /richfaces/scrollableDataTable.jsf
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ajax/error.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/ajax/error.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ajax/passed.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/ajax/passed.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml 2007-08-30 00:26:18 UTC (rev 2596)
@@ -0,0 +1,89 @@
+<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;
+ }
+ </style>
+
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Form Validation. Using rich:message"/>
+ </f:facet>
+
+ <h:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText label="Name" id="name" required="true" value="#{userBean.name}">
+ <f:validateLength minimum="3" />
+ </h:inputText>
+ <rich:message for="name">
+ <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:message>
+
+ <h:outputText value="Job:" />
+ <h:inputText label="Job" id="job" required="true" value="#{userBean.job}">
+ <f:validateLength minimum="3" maximum="50" />
+ </h:inputText>
+ <rich:message for="job">
+ <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:message>
+
+
+
+ <h:outputText value="Address:" />
+ <h:inputText label="Address" id="address" required="true" value="#{userBean.address}">
+ <f:validateLength minimum="10" />
+ </h:inputText>
+ <rich:message for="address">
+ <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:message>
+
+ <h:outputText value="Zip:" />
+ <h:inputText label="Zip" id="zip" required="true" value="#{userBean.zip}">
+ <f:validateLength minimum="4" maximum="9" />
+ </h:inputText>
+ <rich:message for="zip">
+ <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:message>
+
+ <f:facet name="footer">
+ <a4j:commandButton value="Validate" />
+ </f:facet>
+
+
+ </h:panelGrid>
+ </h:form>
+ </rich:panel>
+
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml 2007-08-30 00:26:18 UTC (rev 2596)
@@ -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:message is an extention for standard h:message component. In addition to what the
+ standard conponent provides, rich:message:
+ <ul>
+ <li>does not required to be wraped with a4j:outputPanel to be rendered during the
+ Ajax requests</li>
+ <li>allows to have a "passed" or "failed" marker before the text label</li>
+ <li>has a predefined css class names for different kind of message severities</li>
+ </ul>
+ </p>
+ <p>The message marker is defined with facet. There are several facets names are available
+ to designate the marker for different kind of message severities. The following example
+ shows how the markers might be use to mark the "passed" and "failed" form fields.
+ Fill the form and click "Validate" button to see the entered data passes the
+ defined valudation rules.
+ </p>
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/message/examples/form.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/message/examples/form.xhtml"/>
+ </ui:include>
+
+ </div>
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/message.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/message.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/message.xhtml 2007-08-30 00:26:18 UTC (rev 2596)
@@ -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">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Rich Message</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/message/usage.xhtml"/>
+ </rich:tab>
+ <ui:include src="/templates/include/tagInfo.xhtml">
+ <ui:param name="path" value="rich/message"/>
+ </ui:include>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
17 years, 4 months
JBoss Rich Faces SVN: r2595 - trunk/ui/calendar/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 20:08:45 -0400 (Wed, 29 Aug 2007)
New Revision: 2595
Modified:
trunk/ui/calendar/src/main/config/component/listener.ent
Log:
tagHandler generation for CurrentDateChangeEvent is back on
Modified: trunk/ui/calendar/src/main/config/component/listener.ent
===================================================================
--- trunk/ui/calendar/src/main/config/component/listener.ent 2007-08-30 00:08:39 UTC (rev 2594)
+++ trunk/ui/calendar/src/main/config/component/listener.ent 2007-08-30 00:08:45 UTC (rev 2595)
@@ -9,7 +9,7 @@
<eventclass>
org.richfaces.event.CurrentDateChangeEvent
</eventclass>
- <taghandler generate="false">
+ <taghandler generate="true">
<classname>
org.richfaces.taglib.CurrentDateChangeListenerTagHandler
</classname>
17 years, 4 months
JBoss Rich Faces SVN: r2594 - trunk/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-29 20:08:39 -0400 (Wed, 29 Aug 2007)
New Revision: 2594
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java
Log:
fix http://jira.jboss.com/jira/browse/RF-258 issue
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java 2007-08-29 23:59:20 UTC (rev 2593)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java 2007-08-30 00:08:39 UTC (rev 2594)
@@ -36,126 +36,131 @@
import org.ajax4jsf.event.AjaxSingleEvent;
import org.ajax4jsf.event.AjaxSource;
-
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/06 16:23:21 $
*
*/
public abstract class AjaxActionComponent extends UICommand implements
- AjaxComponent, AjaxSource {
+ AjaxComponent, AjaxSource {
- public static final String FOCUS_DATA_ID = "_A4J.AJAX.focus";
+ public static final String FOCUS_DATA_ID = "_A4J.AJAX.focus";
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#broadcast(javax.faces.event.FacesEvent)
- */
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- // Hack - throw exception to AjaxViewRoot, to fix state of all iterable components.
- if (event instanceof AjaxSingleEvent) {
- throw new AjaxSingleException(getSingleComponent());
- }
- // perform default
- super.broadcast(event);
- if (event instanceof AjaxEvent) {
- FacesContext context = getFacesContext();
- // complete re-Render fields. AjaxEvent deliver before render
- // response.
- setupReRender(context);
- // Put data for send in response
- Object data = getData();
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if (null != data) {
- ajaxContext.setResponseData(data);
- }
- String focus = getFocus();
- if (null != focus) {
- // search for component in tree.
- // TODO - use more pourful search, as in h:outputLabel component.
- UIComponent focusComponent = findComponent(focus);
- if(null != focusComponent){
- focus = focusComponent.getClientId(context);
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponentBase#broadcast(javax.faces.event.FacesEvent)
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ // Hack - throw exception to AjaxViewRoot, to fix state of all iterable
+ // components.
+ if (event instanceof AjaxSingleEvent) {
+ throw new AjaxSingleException(getSingleComponent());
}
- ajaxContext.getResponseDataMap().put(FOCUS_DATA_ID, focus);
- }
+ // perform default
+ super.broadcast(event);
+ if (event instanceof AjaxEvent) {
+ FacesContext context = getFacesContext();
+ // complete re-Render fields. AjaxEvent deliver before render
+ // response.
+ setupReRender(context);
+ // Put data for send in response
+ Object data = getData();
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ if (null != data) {
+ ajaxContext.setResponseData(data);
+ }
+ String focus = getFocus();
+ if (null != focus) {
+ // search for component in tree.
+ // TODO - use more pourful search, as in h:outputLabel
+ // component.
+ UIComponent focusComponent = findComponent(focus);
+ if (null != focusComponent) {
+ focus = focusComponent.getClientId(context);
+ }
+ ajaxContext.getResponseDataMap().put(FOCUS_DATA_ID, focus);
+ }
+ }
}
- }
- /**
- * Template method with old signature, for backward compability.
- */
- protected void setupReRender() {
- }
+ /**
+ * Template method with old signature, for backward compability.
+ */
+ protected void setupReRender() {
+ }
- /**
- * Template methods for fill set of resions to render in subclasses.
- *
- * @param facesContext
- * TODO
- */
- protected void setupReRender(FacesContext facesContext) {
- AjaxContext.getCurrentInstance(facesContext).addRegionsFromComponent(
- this);
- setupReRender();
- }
+ /**
+ * Template methods for fill set of resions to render in subclasses.
+ *
+ * @param facesContext
+ * TODO
+ */
+ protected void setupReRender(FacesContext facesContext) {
+ AjaxContext.getCurrentInstance(facesContext).addRegionsFromComponent(
+ this);
+ setupReRender();
+ }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
- */
- public void queueEvent(FacesEvent event) {
- if (event instanceof ActionEvent && event.getComponent() == this) {
- if (isImmediate()) {
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else if (isBypassUpdates()) {
- event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
- } else {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
- }
- getParent().queueEvent(event);
- if(isAjaxSingle()){
- super.queueEvent(new AjaxSingleEvent(this));
- }
- } else {
- super.queueEvent(event);
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
+ */
+ public void queueEvent(FacesEvent event) {
+ if (event instanceof ActionEvent) {
+ if (event.getComponent() == this) {
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (isBypassUpdates()) {
+ event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+ // AjaxSingle component process own childrens in event processing.
+ if (isAjaxSingle()) {
+ super.queueEvent(new AjaxSingleEvent(this));
+ }
+ }
+ // UICommand set Phase ID for all ActionEvents - bypass it.
+ getParent().queueEvent(event);
+ } else {
+ super.queueEvent(event);
+ }
}
- }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxSource#addAjaxListener(org.ajax4jsf.framework.ajax.AjaxListener)
- */
- public void addAjaxListener(AjaxListener listener) {
- addFacesListener(listener);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxSource#addAjaxListener(org.ajax4jsf.framework.ajax.AjaxListener)
+ */
+ public void addAjaxListener(AjaxListener listener) {
+ addFacesListener(listener);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxSource#getAjaxListeners()
- */
- public AjaxListener[] getAjaxListeners() {
- AjaxListener al[] = (AjaxListener[]) getFacesListeners(AjaxListener.class);
- return (al);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxSource#getAjaxListeners()
+ */
+ public AjaxListener[] getAjaxListeners() {
+ AjaxListener al[] = (AjaxListener[]) getFacesListeners(AjaxListener.class);
+ return (al);
- }
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxSource#removeAjaxListener(org.ajax4jsf.framework.ajax.AjaxListener)
- */
- public void removeAjaxListener(AjaxListener listener) {
- removeFacesListener(listener);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxSource#removeAjaxListener(org.ajax4jsf.framework.ajax.AjaxListener)
+ */
+ public void removeAjaxListener(AjaxListener listener) {
+ removeFacesListener(listener);
- }
-
- protected UIComponent getSingleComponent(){
- return this;
- }
+ }
+ protected UIComponent getSingleComponent() {
+ return this;
+ }
+
}
17 years, 4 months
JBoss Rich Faces SVN: r2593 - trunk/samples/tabPanelDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 19:59:20 -0400 (Wed, 29 Aug 2007)
New Revision: 2593
Modified:
trunk/samples/tabPanelDemo/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-750
Modified: trunk/samples/tabPanelDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/tabPanelDemo/src/main/webapp/pages/index.jsp 2007-08-29 23:59:15 UTC (rev 2592)
+++ trunk/samples/tabPanelDemo/src/main/webapp/pages/index.jsp 2007-08-29 23:59:20 UTC (rev 2593)
@@ -9,7 +9,6 @@
<title></title>
<style type="text/css">
-
</style>
</head>
<body bgcolor="white">
@@ -29,12 +28,24 @@
<f:selectItem itemLabel="canon" itemValue="canon" />
<f:selectItem itemLabel="olympus" itemValue="olympus" />
<f:selectItem itemLabel="nikon" itemValue="nikon" />
+ <f:selectItem itemLabel="none" itemValue="none" />
</h:selectOneMenu>
-
- <h:commandLink value="apply" />
+
+ <h:commandLink value="switch" />
</h:form>
<h:form>
+ <h:selectOneMenu value="#{bean.disabledTabName}">
+ <f:selectItem itemLabel="canon" itemValue="canon" />
+ <f:selectItem itemLabel="olympus" itemValue="olympus" />
+ <f:selectItem itemLabel="nikon" itemValue="nikon" />
+ <f:selectItem itemLabel="none" itemValue="none" />
+ </h:selectOneMenu>
+
+ <h:commandLink value="disable" action="#{bean.disableTab}" />
+ </h:form>
+
+ <h:form>
<tabs:tabPanel valueChangeListener="#{bean.valueChanged}" headerSpacing="5px" immediate="false" tabClass="tabClass" activeTabClass="italic" width="100%" switchType="client" binding="#{bean.tabPanel}" selectedTab="#{bean.currentTab}" id="tab_panel" headerAlignment="left">
<f:valueChangeListener type="org.richfaces.TabChangeListener"/>
17 years, 4 months
JBoss Rich Faces SVN: r2592 - in trunk/ui/tabPanel: src/main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 19:59:15 -0400 (Wed, 29 Aug 2007)
New Revision: 2592
Added:
trunk/ui/tabPanel/src/test/java/org/richfaces/renderkit/TabsIteratorHelperTest.java
Removed:
trunk/ui/tabPanel/src/main/java/org/richfaces/component/TabsIterator.java
Modified:
trunk/ui/tabPanel/
trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-750
Property changes on: trunk/ui/tabPanel
___________________________________________________________________
Name: svn:ignore
- target
.settings
.classpath
.project
+ target
.settings
.classpath
.project
.clover
Deleted: trunk/ui/tabPanel/src/main/java/org/richfaces/component/TabsIterator.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/component/TabsIterator.java 2007-08-29 18:02:10 UTC (rev 2591)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/component/TabsIterator.java 2007-08-29 23:59:15 UTC (rev 2592)
@@ -1,117 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * 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.component;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * "sublist" iterator for iterate over child components instantiate from {@link UITab}
- *
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-class TabsIterator implements Iterator {
-
- static interface FilterCondition {
- public boolean isSuitable(UITab tab);
- }
-
- private FilterCondition filterCondition;
-
- /**
- *
- */
- private final UITabPanel tabsIterator;
-
- /**
- * Original component iterator for children
- */
- private Iterator _childs;
-
- /**
- * Next UITab in children.
- */
- private Object _next = null;
-
- public TabsIterator(UITabPanel tabPanel, FilterCondition filterCondition) {
- super();
-
- this.filterCondition = filterCondition;
-
- tabsIterator = tabPanel;
- _childs = tabsIterator.getChildren().iterator();
- _next = getNextTab();
- }
-
- /**
- * @param tabPanel TODO
- */
- public TabsIterator(UITabPanel tabPanel) {
- this(tabPanel, null);
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#hasNext()
- */
- public boolean hasNext() {
- return _next != null;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#next()
- */
- public Object next() {
- if (null == _next) {
- throw new NoSuchElementException();
- }
- Object next = _next;
- _next = getNextTab();
- return next;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#remove()
- */
- public void remove() {
- throw new UnsupportedOperationException("tabs Iterator not support remove operation");
-
- }
-
- /**
- * Find next {@link UITab} components in children
- * @return next tab
- */
- private Object getNextTab() {
- while (_childs.hasNext()) {
- Object element = _childs.next();
- if (element instanceof UITab) {
- UITab tab = (UITab) element;
- if (filterCondition == null || filterCondition.isSuitable(tab))
- {
- return tab;
- }
- }
- }
- return null;
- }
-}
\ No newline at end of file
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java 2007-08-29 18:02:10 UTC (rev 2591)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java 2007-08-29 23:59:15 UTC (rev 2592)
@@ -26,6 +26,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections.iterators.FilterIterator;
+
/**
* JSF component class
*/
@@ -39,20 +43,15 @@
protected Iterator getSwitchedFacetsAndChildren() {
final Object renderedValue = this.restoredRenderedValue;
- return new TabsIterator(this, new TabsIterator.FilterCondition() {
+ return new FilterIterator(getRenderedTabs(), new Predicate() {
- public boolean isSuitable(UITab tab) {
- if (CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault())) {
-
- return true;
- }
-
- Object name = tab.getName();
-
- return name != null && name.equals(renderedValue);
- }
-
- });
+ public boolean evaluate(Object object) {
+ UITab tab = (UITab) object;
+ return !tab.isDisabled() && (CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault())) ||
+ (renderedValue != null && renderedValue.equals(tab.getName()));
+ }
+
+ });
}
public Object convertSwitchValue(UIComponent component, Object object) {
@@ -120,14 +119,32 @@
this.restoredRenderedValue = getRenderedValue();
}
+ private static final Predicate RENDERED_TAB_PREDICATE = new Predicate() {
+
+ public boolean evaluate(Object object) {
+ if (object instanceof UITab) {
+ UITab tab = (UITab) object;
+
+ return tab.isRendered();
+ }
+
+ return false;
+ }
+
+ };
+
/**
- * Create iterator for all tabs in this component ( in future, can be added special attribute for tabs collection.
+ * Create iterator for all rendered tabs in this component
* {@link Iterator#next()} method will return tab model - {@link Tab}
*
* @return Iterator
*/
- public Iterator getTabs() {
- return new TabsIterator(this);
+ public Iterator getRenderedTabs() {
+ if (getChildCount() > 0) {
+ return new FilterIterator(getChildren().iterator(), RENDERED_TAB_PREDICATE);
+ } else {
+ return CollectionUtils.EMPTY_COLLECTION.iterator();
+ }
}
/**
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-08-29 18:02:10 UTC (rev 2591)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-08-29 23:59:15 UTC (rev 2592)
@@ -42,6 +42,7 @@
import org.richfaces.component.UITab;
import org.richfaces.component.UITabPanel;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.component.util.MessageUtil;
import org.richfaces.event.SwitchablePanelSwitchEvent;
@@ -69,11 +70,11 @@
UITab eventTab = null;
- for (Iterator tabsIterator = panel.getTabs();
+ for (Iterator tabsIterator = panel.getRenderedTabs();
tabsIterator.hasNext() && eventTab == null;) {
UITab tab = (UITab) tabsIterator.next();
- if (!tab.isRendered() || tab.isDisabled()) {
+ if (tab.isDisabled()) {
continue;
}
@@ -185,31 +186,6 @@
return getUtils().getValueAsString(context, tabPanel);
}
- public String getTabsCount(FacesContext context, UITabPanel tabPanel){
- int count = 0;
- String ret = "1";
- for (Iterator iter = tabPanel.getTabs(); iter.hasNext();){
- iter.next();
- count++;
- }
- //center tabs group
- ret = String.valueOf(count*2 - 1);
- return ret;
- }
-/*
- public void writeColgroups(FacesContext context, UITabPanel tabPanel) throws IOException{
- StringBuffer buff = new StringBuffer();
- if("left".equals(tabPanel.getHeaderAlignment())){
- buff.append("<colgroup/>").append("<colgroup span=\"" + getTabsCount(context, tabPanel) + "\"/>").append("<colgroup width=\"100%\"/>");
- } else if("center".equals(tabPanel.getHeaderAlignment())){
- buff.append("<colgroup width=\"33%\"/>").append("<colgroup width=\"34%\" span=\"" + getTabsCount(context, tabPanel) + "\"/>").append("<colgroup width=\"33%\"/>");
- } else {
- buff.append("<colgroup width=\"100%\"/>").append("<colgroup span=\"" + getTabsCount(context, tabPanel) + "\"/>").append("<colgroup/>");
- }
- context.getResponseWriter().write(buff.toString());
- //return null;
- }
-*/
private Object checkValue(Object value) {
if (value instanceof String) {
String s = (String) value;
@@ -224,75 +200,127 @@
return value;
}
+ protected static class TabsIteratorHelper {
+ private Iterator tabs;
+
+ private UITab namedTab = null;
+ private UITab firstApplicableTab = null;
+ private boolean fallback;
+
+ public TabsIteratorHelper(Iterator tabs, Object name) {
+ super();
+ this.tabs = tabs;
+
+ if (name != null) {
+ //findTabByName
+ while (tabs.hasNext()) {
+ UITab tab = nextTab();
+ if (name.equals(tab.getName())) {
+ this.namedTab = tab;
+ break;
+ }
+ }
+ }
+
+ if (namedTab == null) {
+ if (name != null) {
+ //tried but failed
+ fallback = true;
+ }
+
+ this.namedTab = findAnyTab();
+ } else if (namedTab.isDisabled()) {
+ UITab tab = findAnyTab();
+ if (this.namedTab != tab && tab != null && !tab.isDisabled()) {
+ fallback = true;
+ this.namedTab = tab;
+ } else {
+ //use disabled tab found by name
+ }
+ }
+ }
+
+ private UITab nextTab() {
+ UITab tab = (UITab) tabs.next();
+
+ if (firstApplicableTab == null) {
+ firstApplicableTab = tab;
+ } else if (firstApplicableTab.isDisabled() && !tab.isDisabled()) {
+ //more appropriate
+ firstApplicableTab = tab;
+ }
+
+ return tab;
+ }
+
+ public UITab getTab() {
+ return this.namedTab;
+ }
+
+ public boolean isFallback() {
+ return fallback;
+ }
+
+ private UITab findAnyTab() {
+ while ((firstApplicableTab == null || firstApplicableTab.isDisabled()) && tabs.hasNext()) {
+ nextTab();
+ }
+
+ return firstApplicableTab;
+ }
+ }
+
public void encodeTabs(FacesContext context, UITabPanel tabPanel) throws IOException {
ComponentVariables componentVariables = ComponentsVariableResolver.getVariables(this, tabPanel);
tabPanel.setRenderedValue(null);
Object checkedValue = checkValue(tabPanel.getValue());
- boolean useFirstRenderedTab = checkedValue == null;
UITabPanel pane = tabPanel;
- UITab firstRenderedTab = null;
UITab activeTab = null;
- for (Iterator iter = pane.getTabs(); iter.hasNext() && activeTab == null;)
- {
- UITab tab = (UITab) iter.next();
+ TabsIteratorHelper helper = new TabsIteratorHelper(pane.getRenderedTabs(), checkedValue);
+ activeTab = helper.getTab();
- if (tab.isRendered() && !tab.isDisabled()) {
- if (firstRenderedTab == null) {
- firstRenderedTab = tab;
- }
+ if (activeTab == null) {
+ Object label = MessageUtil.getLabel(context, tabPanel);
+ String message = label + ": tab panel has no enabled or rendered tabs!";
+ context.getExternalContext().log(message);
+ return ;
+ }
- if (useFirstRenderedTab) {
- activeTab = firstRenderedTab;
- } else if (checkedValue.equals(tab.getName())) {
- activeTab = tab;
- }
+ if (helper.isFallback()) {
+ Object label = MessageUtil.getLabel(context, tabPanel);
+ String message = label + ": tab panel [@selectedTab=" + checkedValue +
+ "] has no enabled or rendered tab with such name. Tab: " + activeTab.getName() +
+ " will be used instead!";
+ context.getExternalContext().log(message);
- } else {
- if (!useFirstRenderedTab) {
- if (checkedValue.equals(tab.getName())) {
- if (firstRenderedTab != null) {
- activeTab = firstRenderedTab;
- } else {
- useFirstRenderedTab = true;
- }
- }
- }
- }
- }
+ tabPanel.setRenderedValue(activeTab.getName());
+ } else {
+ tabPanel.setRenderedValue(null);
+ }
+
+ helper = null;
- if (activeTab == null) {
- throw new IllegalStateException("No active tabs!");
- } else {
- if (useFirstRenderedTab) {
- tabPanel.setRenderedValue(activeTab.getName());
- } else {
- tabPanel.setRenderedValue(null);
- }
- }
-
ArrayList tabs = new ArrayList();
boolean clientSide = UISwitchablePanel.CLIENT_METHOD.equals(pane.getSwitchType());
TabInfoCollector tabInfoCollector = getTabInfoCollector();
- for (Iterator iter = pane.getTabs(); iter.hasNext();) {
+ for (Iterator iter = pane.getRenderedTabs(); iter.hasNext();) {
UITab tab = (UITab) iter.next();
boolean active = activeTab == tab;
tab.setActive(active);
- if (tab.isRendered()) {
- if (!clientSide) {
- clientSide = UISwitchablePanel.CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault());
- }
+ if (!clientSide) {
+ clientSide = UISwitchablePanel.CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault());
+ }
- tab.encodeTab(context, active);
+ tab.encodeTab(context, active);
- if (!tab.isDisabled()) {
- tabs.add(tabInfoCollector.collectTabInfo(context, tab));
- }
+ if (!tab.isDisabled()) {
+ tabs.add(tabInfoCollector.collectTabInfo(context, tab));
}
}
Added: trunk/ui/tabPanel/src/test/java/org/richfaces/renderkit/TabsIteratorHelperTest.java
===================================================================
--- trunk/ui/tabPanel/src/test/java/org/richfaces/renderkit/TabsIteratorHelperTest.java (rev 0)
+++ trunk/ui/tabPanel/src/test/java/org/richfaces/renderkit/TabsIteratorHelperTest.java 2007-08-29 23:59:15 UTC (rev 2592)
@@ -0,0 +1,119 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * 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.renderkit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UITab;
+import org.richfaces.renderkit.TabPanelRendererBase.TabsIteratorHelper;
+
+public class TabsIteratorHelperTest extends AbstractAjax4JsfTestCase {
+
+ public TabsIteratorHelperTest(String name) {
+ super(name);
+ }
+
+ private List tabsList;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ tabsList = new ArrayList();
+
+ for (int i = 0; i < 3; i++) {
+ UITab tab = (UITab) application.createComponent(UITab.COMPONENT_TYPE);
+ tab.setName("tab" + i);
+ tabsList.add(tab);
+ }
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ tabsList = null;
+ }
+
+ public void testFindByName() throws Exception {
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), "tab2");
+ assertSame(tabsList.get(2), helper.getTab());
+ assertFalse(helper.isFallback());
+ }
+
+ public void testFindByName1() throws Exception {
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), "taba");
+ assertSame(tabsList.get(0), helper.getTab());
+ assertTrue(helper.isFallback());
+ }
+
+ public void testFindAnyTabDefault() throws Exception {
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), null);
+ assertSame(tabsList.get(0), helper.getTab());
+ assertFalse(helper.isFallback());
+ }
+
+ public void testFindAnyTab() throws Exception {
+ ((UITab) tabsList.get(0)).setDisabled(true);
+ ((UITab) tabsList.get(1)).setDisabled(true);
+
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), "taba");
+ assertSame(tabsList.get(2), helper.getTab());
+ assertTrue(helper.isFallback());
+ }
+
+ public void testFindAnyTabUnnamed() throws Exception {
+ ((UITab) tabsList.get(0)).setDisabled(true);
+
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), null);
+ assertSame(tabsList.get(1), helper.getTab());
+ assertFalse(helper.isFallback());
+ }
+
+ public void testFindAnyTabAllDisabled() throws Exception {
+ ((UITab) tabsList.get(0)).setDisabled(true);
+ ((UITab) tabsList.get(1)).setDisabled(true);
+ ((UITab) tabsList.get(2)).setDisabled(true);
+
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), null);
+ assertSame(tabsList.get(0), helper.getTab());
+ assertFalse(helper.isFallback());
+ }
+
+ public void testFindTabByNameDisabled() throws Exception {
+ ((UITab) tabsList.get(0)).setDisabled(true);
+ ((UITab) tabsList.get(1)).setDisabled(true);
+ ((UITab) tabsList.get(2)).setDisabled(true);
+
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), "tab1");
+ assertSame(tabsList.get(1), helper.getTab());
+ assertFalse(helper.isFallback());
+ }
+
+ public void testFindTabByNameBeforeDisabled() throws Exception {
+ ((UITab) tabsList.get(0)).setDisabled(true);
+ ((UITab) tabsList.get(2)).setDisabled(true);
+
+ TabsIteratorHelper helper = new TabsIteratorHelper(tabsList.iterator(), "tab2");
+ assertSame(tabsList.get(1), helper.getTab());
+ assertTrue(helper.isFallback());
+ }
+}
17 years, 4 months
JBoss Rich Faces SVN: r2591 - in trunk/test-applications/facelets/src/main: webapp/Calendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-29 14:02:10 -0400 (Wed, 29 Aug 2007)
New Revision: 2591
Modified:
trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-746
Modified: trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java 2007-08-29 18:02:02 UTC (rev 2590)
+++ trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java 2007-08-29 18:02:10 UTC (rev 2591)
@@ -74,6 +74,7 @@
}
public void setPattern(String pattern) {
+
this.pattern = pattern;
}
@@ -83,7 +84,7 @@
pattern = tPatern;
}
}
-
+
public CalendarBean() {
locale = Locale.US;
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-08-29 18:02:02 UTC (rev 2590)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-08-29 18:02:10 UTC (rev 2591)
@@ -27,120 +27,105 @@
<a4j:outputPanel ajaxRendered="true">
<h:messages showDetail="true" showSummary="true"/>
</a4j:outputPanel>
- <h:form>
+ <h:form>
+ <br />
+ <br />
+ <rich:calendar
+ id="calendar"
+ data="#{calendarDataModel}"
+ locale="#{calendarBean.locale}"
+ popup="#{calendarBean.popup}"
+ datePattern="#{calendarBean.pattern}"
+ weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
+ value="#{calendarBean.selectedDate}"
+ currentDate="#{calendarBean.currentDate}"
+ jointPoint="#{calendarBean.jointPoint}"
+ direction="#{calendarBean.direction}"
+ buttonLabel="PopUp"
+ enableManualInput="#{calendarBean.enableManualInput}"
+ showInput="#{calendarBean.showInput}"
+ boundaryDatesMode="#{calendarBean.boundary}">
+ <f:facet name="optionalHeader">
+ <h:outputText value="optionalHeader Facet" />
+ </f:facet>
+ <f:facet name="optionalFooter">
+ <h:outputText value="optionalFooter Facet" />
+ </f:facet>
+ <f:validator validatorId="org.richfaces.CalendarValidator" />
+
+ <h:panelGrid columns="2">
+ <f:verbatim><span style="padding: 2px;" >{day}</span></f:verbatim>
+
+ </h:panelGrid>
+ </rich:calendar>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Select Locale:" />
+ <h:selectOneRadio onchange="submit()" value="en/US" valueChangeListener="#{calendarBean.selectLocale}">
+ <f:selectItem itemLabel="US" itemValue="en/US"/>
+ <f:selectItem itemLabel="DE" itemValue="de/DE"/>
+ <f:selectItem itemLabel="FR" itemValue="fr/FR"/>
+ <f:selectItem itemLabel="RU" itemValue="ru/RU"/>
+ </h:selectOneRadio>
+ <h:outputText value="Popup Mode:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.popup}" onclick="submit()"/>
+ <h:outputText value="Custom day labels:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}" onclick="submit()"/>
+ <h:outputText value="Select Date Pattern:"/>
+ <h:selectOneMenu value="MMM d, yyyy" onchange="submit()" valueChangeListener="#{calendarBean.selectPattern}">
+ <f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy"/>
+ <f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
+ <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y"/>
+ <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy"/>
+ </h:selectOneMenu>
+ <h:inputText id="selectdate"/><h:commandButton type="button" value="Select Date" onclick="$(this.form.id+':calendar').component.selectDate(this.form[this.form.id+':selectdate'].value);"/>
+ <h:outputText value="Select Popup Joint Point:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.jointPoint}" valueChangeListener="#{calendarBean.selectJointPoint}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ </h:selectOneRadio>
+ <h:outputText value="Select Popup Direction:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.direction}" valueChangeListener="#{calendarBean.selectDirection}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ <f:selectItem itemLabel="auto" itemValue="auto"/>
+ </h:selectOneRadio>
+ <h:outputText value="BoundaryDatesMode:" />
+ <h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
+ <f:selectItem itemLabel="inactive" itemValue="inactive"/>
+ <f:selectItem itemLabel="select" itemValue="select"/>
+ <f:selectItem itemLabel="scroll" itemValue="scroll"/>
+ </h:selectOneRadio>
+ <h:outputText value="EnableManualInput:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{calendarBean.enableManualInput}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+ <h:outputText value="ShowInput:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{calendarBean.showInput}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+
+
- <rich:calendar id="calendar" data="#{calendarDataModel}"
- locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
- datePattern="#{calendarBean.pattern}"
- weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
- value="#{calendarBean.selectedDate}"
- currentDate="#{calendarBean.currentDate}"
- jointPoint="#{calendarBean.jointPoint}"
- direction="#{calendarBean.direction}" buttonLabel="PopUp"
- enableManualInput="#{calendarBean.enableManualInput}"
- showInput="#{calendarBean.showInput}"
- boundaryDatesMode="#{calendarBean.boundary}">
- <f:facet name="optionalHeader">
- <h:outputText value="optionalHeader Facet" />
- </f:facet>
- <f:facet name="optionalFooter">
- <h:outputText value="optionalFooter Facet" />
- </f:facet>
- <f:validator validatorId="org.richfaces.CalendarValidator" />
+ </h:panelGrid>
+
+ <h:outputText value="Current date: "/>
+ <h:outputText value="#{calendarBean.currentDateAsText}" />
+ <f:verbatim><br /></f:verbatim>
+ <h:outputText value="Selected date: "/>
+ <h:outputText value="#{calendarBean.selectedDate}" />
+ <f:verbatim><br /></f:verbatim>
+
+ <h:commandButton value="Submit"/>
+
+
+
+ </h:form>
- <h:panelGrid columns="2">
-
- <f:verbatim>
- <p style="padding: 2px;" class="largeText">{day}</p>
- </f:verbatim>
- <h:panelGrid>
- <h:outputText styleClass="smallText" value="{data.enLabel}" />
- <h:outputText styleClass="smallText" value="{data.frLabel}" />
- <h:outputText styleClass="smallText" value="{data.deLabel}" />
- </h:panelGrid>
- </h:panelGrid>
- </rich:calendar>
-
- <h:panelGrid columns="2">
- <h:outputText value="Select Locale:" />
- <h:selectOneRadio onchange="submit()" value="en/US"
- valueChangeListener="#{calendarBean.selectLocale}">
- <f:selectItem itemLabel="US" itemValue="en/US" />
- <f:selectItem itemLabel="DE" itemValue="de/DE" />
- <f:selectItem itemLabel="FR" itemValue="fr/FR" />
- <f:selectItem itemLabel="RU" itemValue="ru/RU" />
- </h:selectOneRadio>
- <h:outputText value="Popup Mode:" />
- <h:selectBooleanCheckbox value="#{calendarBean.popup}"
- onclick="submit()" />
- <h:outputText value="Custom day labels:" />
- <h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}"
- onclick="submit()" />
- <h:outputText value="Select Date Pattern:" />
- <h:selectOneMenu value="MMM d, yyyy" onchange="submit()" valueChangeListener="#{calendarBean.selectPattern}">
- <f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy" />
- <f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy" />
- <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
- <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy" />
- </h:selectOneMenu>
- <h:inputText id="selectdate" />
- <h:commandButton type="button" value="Select Date"
- onclick="$(this.form.id+':calendar').component.selectDate(this.form[this.form.id+':selectdate'].value);" />
- <h:outputText value="Select Popup Joint Point:" />
- <h:selectOneRadio onchange="submit()"
- value="#{calendarBean.jointPoint}"
- valueChangeListener="#{calendarBean.selectJointPoint}">
- <f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
- <f:selectItem itemLabel="top-right" itemValue="top-right" />
- <f:selectItem itemLabel="top-left" itemValue="top-left" />
- </h:selectOneRadio>
- <h:outputText value="Select Popup Direction:" />
- <h:selectOneRadio onchange="submit()"
- value="#{calendarBean.direction}"
- valueChangeListener="#{calendarBean.selectDirection}">
- <f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
- <f:selectItem itemLabel="top-right" itemValue="top-right" />
- <f:selectItem itemLabel="top-left" itemValue="top-left" />
- <f:selectItem itemLabel="auto" itemValue="auto" />
- </h:selectOneRadio>
- <h:outputText value="BoundaryDatesMode:" />
- <h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
- <f:selectItem itemLabel="inactive" itemValue="inactive" />
- <f:selectItem itemLabel="select" itemValue="select" />
- <f:selectItem itemLabel="scroll" itemValue="scroll" />
- </h:selectOneRadio>
- <h:outputText value="EnableManualInput:"></h:outputText>
- <h:selectBooleanCheckbox value="#{calendarBean.enableManualInput}"
- onclick="submit()">
- </h:selectBooleanCheckbox>
- <h:outputText value="ShowInput:"></h:outputText>
- <h:selectBooleanCheckbox value="#{calendarBean.showInput}"
- onclick="submit()">
- </h:selectBooleanCheckbox>
-
- <!-- <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>-->
-
- </h:panelGrid>
-
- <h:outputText value="Current date: " />
- <h:outputText value="#{calendarBean.currentDateAsText}" />
-
- <f:verbatim>
- <br />
- </f:verbatim>
-
- <h:outputText value="Selected date: " />
- <h:outputText value="#{calendarBean.selectedDate}" />
-
- <f:verbatim>
- <br />
- </f:verbatim>
-
- <h:commandButton value="Submit" />
- </h:form>
-
<h:form>
<h:commandLink value="Back" action="main"></h:commandLink>
</h:form>
17 years, 4 months
JBoss Rich Faces SVN: r2590 - trunk/test-applications/jsp/src/main/webapp/Calendar.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-29 14:02:02 -0400 (Wed, 29 Aug 2007)
New Revision: 2590
Modified:
trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
Log:
http://jira.jboss.com/jira/browse/RF-746
Modified: trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2007-08-29 17:55:07 UTC (rev 2589)
+++ trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2007-08-29 18:02:02 UTC (rev 2590)
@@ -28,6 +28,8 @@
<h:messages />
</a4j:outputPanel>
<h:form>
+ <br />
+ <br />
<rich:calendar
id="calendar"
data="#{calendarDataModel}"
@@ -52,7 +54,7 @@
<f:validator validatorId="org.richfaces.CalendarValidator" />
<h:panelGrid columns="2">
- <f:verbatim><p style="padding: 2px;" <%-- class="largeText"--%>>{day}</p></f:verbatim>
+ <f:verbatim><span style="padding: 2px;" <%-- class="largeText"--%>>{day}</span></f:verbatim>
<%-- h:panelGrid>
<h:outputText styleClass="smallText" value="{data.enLabel}" />
<h:outputText styleClass="smallText" value="{data.frLabel}" />
@@ -74,7 +76,6 @@
<h:outputText value="Custom day labels:" />
<h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}" onclick="submit()"/>
<h:outputText value="Select Date Pattern:"/>
-
<h:selectOneMenu value="MMM d, yyyy" onchange="submit()" valueChangeListener="#{calendarBean.selectPattern}">
<f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy"/>
<f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
@@ -125,11 +126,13 @@
<f:verbatim><br /></f:verbatim>
<h:commandButton value="Submit"/>
- </h:form>
- <h:form>
+
+
+
+ </h:form> <h:form>
<h:commandLink value="Back" action="main"></h:commandLink>
</h:form>
</f:subview>
</html>
-</f:view>
\ No newline at end of file
+</f:view>
17 years, 4 months
JBoss Rich Faces SVN: r2589 - trunk/framework/impl/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 13:55:07 -0400 (Wed, 29 Aug 2007)
New Revision: 2589
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
Log:
http://jira.jboss.com/jira/browse/RF-665
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-08-29 17:44:15 UTC (rev 2588)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-08-29 17:55:07 UTC (rev 2589)
@@ -139,8 +139,8 @@
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- Data dataToStore = new Data((byte[])resourceContext.getResourceData());
- if (dataToStore.headerBackgroundColor!=null && dataToStore.headerGradientColor!=null) {
+ Data dataToStore = (Data) restoreData(resourceContext);
+ if (dataToStore != null && dataToStore.headerBackgroundColor!=null && dataToStore.headerGradientColor!=null) {
Color baseColor = new Color(dataToStore.headerBackgroundColor.intValue());
Dimension dim =getDimensions(resourceContext);
Rectangle2D rect =
@@ -163,6 +163,17 @@
}
}
+ protected Object deserializeData(byte[] objectArray) {
+ Data data = new Data();
+ if (objectArray != null) {
+ Zipper2 zipper2 = new Zipper2(objectArray);
+ data.headerBackgroundColor = new Integer(zipper2.nextIntColor());
+ data.headerGradientColor = new Integer(zipper2.nextIntColor());
+ }
+
+ return data;
+ }
+
protected Object getDataToStore(FacesContext context, Object data) {
if (baseColor == null) {
return new Data(context).toByteArray();
@@ -176,17 +187,9 @@
}
protected static class Data implements Serializable {
- private static final String SEPARATOR = ".";
-
public Data() {
}
- public Data(byte[] data) {
- Zipper2 zipper2 = new Zipper2(data);
- headerBackgroundColor = new Integer(zipper2.nextIntColor());
- headerGradientColor = new Integer(zipper2.nextIntColor());
- }
-
protected Data(FacesContext context) {
this(context, Skin.headerBackgroundColor, "headerGradientColor");
}
@@ -229,9 +232,13 @@
protected Integer headerBackgroundColor;
protected Integer headerGradientColor;
public byte[] toByteArray() {
- byte[] ret = new byte[6];
- new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue());
- return ret;
+ if (headerBackgroundColor != null && headerGradientColor != null) {
+ byte[] ret = new byte[6];
+ new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue());
+ return ret;
+ } else {
+ return null;
+ }
}
}
17 years, 4 months
JBoss Rich Faces SVN: r2588 - trunk/test-applications/facelets/src/main/webapp/TogglePanel.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-29 13:44:15 -0400 (Wed, 29 Aug 2007)
New Revision: 2588
Modified:
trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-754
Modified: trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml 2007-08-29 17:44:09 UTC (rev 2587)
+++ trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml 2007-08-29 17:44:15 UTC (rev 2588)
@@ -198,7 +198,7 @@
<f:selectItem itemLabel="client" itemValue="client" />
<f:selectItem itemLabel="server" itemValue="server" />
<f:selectItem itemLabel="ajax" itemValue="ajax" />
- <a4j:support event="onclick" reRender="panle1,panel2"></a4j:support>
+ <a4j:support event="onclick" reRender="panel1,panel2"></a4j:support>
</h:selectOneRadio>
</h:panelGrid>
<h:commandLink value="Back" action="main"></h:commandLink>
17 years, 4 months