JBoss Rich Faces SVN: r9864 - trunk/test-applications/facelets/src/main/webapp/DataGrid.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-08-01 10:54:54 -0400 (Fri, 01 Aug 2008)
New Revision: 9864
Modified:
trunk/test-applications/facelets/src/main/webapp/DataGrid/DataGridProperty.xhtml
Log:
Delete "border" duplicate attribute from page
Modified: trunk/test-applications/facelets/src/main/webapp/DataGrid/DataGridProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DataGrid/DataGridProperty.xhtml 2008-08-01 13:48:58 UTC (rev 9863)
+++ trunk/test-applications/facelets/src/main/webapp/DataGrid/DataGridProperty.xhtml 2008-08-01 14:54:54 UTC (rev 9864)
@@ -31,9 +31,6 @@
<h:outputText value="first: " />
<h:inputText onchange="submit();" value="#{dataGrid.first}" />
- <h:outputText value="border: " />
- <h:inputText onchange="submit();" value="#{dataGrid.border}" />
-
<h:outputText value="cellspacing: " />
<h:inputText onchange="submit();" value="#{dataGrid.cellspacing}" />
16 years, 4 months
JBoss Rich Faces SVN: r9863 - trunk/test-applications/facelets/src/main/webapp/HotKey.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-08-01 09:48:58 -0400 (Fri, 01 Aug 2008)
New Revision: 9863
Modified:
trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
Log:
Add onclick="return false;" for two commandButtons
Modified: trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml 2008-08-01 13:48:26 UTC (rev 9862)
+++ trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml 2008-08-01 13:48:58 UTC (rev 9863)
@@ -62,8 +62,8 @@
<rich:hotKey id="jsID" timing="onregistercall" />
<h:panelGrid columns="2">
- <h:commandButton id="jsAddCCID" value="add hotkey: alt+z"></h:commandButton>
- <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z"></h:commandButton>
+ <h:commandButton id="jsAddCCID" value="add hotkey: alt+z" onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z" onclick="return false;"></h:commandButton>
<rich:componentControl disableDefault="true" attachTo="jsAddCCID" for="jsID" event="onclick" operation="add">
<f:param name="key" value="alt+z" />
16 years, 4 months
JBoss Rich Faces SVN: r9862 - trunk/test-applications/jsp/src/main/webapp/HotKey.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-08-01 09:48:26 -0400 (Fri, 01 Aug 2008)
New Revision: 9862
Modified:
trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
Log:
Add onclick="return false" attribute for two commandButtons
Modified: trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-08-01 13:28:16 UTC (rev 9861)
+++ trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-08-01 13:48:26 UTC (rev 9862)
@@ -73,8 +73,8 @@
<rich:hotKey id="jsID" timing="onregistercall" />
<h:panelGrid columns="2">
- <h:commandButton id="jsAddCCID" value="add hotkey: alt+z"></h:commandButton>
- <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z"></h:commandButton>
+ <h:commandButton id="jsAddCCID" value="add hotkey: alt+z" onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z" onclick="return false;"></h:commandButton>
<rich:componentControl disableDefault="true" attachTo="jsAddCCID" for="jsID" event="onclick" operation="add">
<f:param name="key" value="alt+z" />
16 years, 4 months
JBoss Rich Faces SVN: r9861 - in trunk/test-applications/seleniumTest/src: main/webapp/WEB-INF and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-08-01 09:28:16 -0400 (Fri, 01 Aug 2008)
New Revision: 9861
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/modalPanel/
trunk/test-applications/seleniumTest/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ModalPanelTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
Add rich:modalPanel selenium test
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-08-01 13:28:16 UTC (rev 9861)
@@ -0,0 +1,89 @@
+/*
+ * ModalPanelTestBean.java Date created: 30.07.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.bean;
+
+/**
+ * rich:modalPannel component test bean
+ * @author Alexandr Levkovsky
+ *
+ */
+public class ModalPanelTestBean {
+
+ private Boolean rendered = true;
+ private Boolean showWhenRendered = false;
+ private Boolean moveable = true;
+ private Boolean resizeable = true;
+ /**
+ * @return the rendered
+ */
+ public Boolean getRendered() {
+ return rendered;
+ }
+ /**
+ * @param rendered the rendered to set
+ */
+ public void setRendered(Boolean rendered) {
+ this.rendered = rendered;
+ }
+ /**
+ * @return the showWhenRendered
+ */
+ public Boolean getShowWhenRendered() {
+ return showWhenRendered;
+ }
+ /**
+ * @param showWhenRendered the showWhenRendered to set
+ */
+ public void setShowWhenRendered(Boolean showWhenRendered) {
+ this.showWhenRendered = showWhenRendered;
+ }
+ /**
+ * @return the moveable
+ */
+ public Boolean getMoveable() {
+ return moveable;
+ }
+ /**
+ * @param moveable the moveable to set
+ */
+ public void setMoveable(Boolean moveable) {
+ this.moveable = moveable;
+ }
+ /**
+ * @return the resizeable
+ */
+ public Boolean getResizeable() {
+ return resizeable;
+ }
+ /**
+ * @param resizeable the resizeable to set
+ */
+ public void setResizeable(Boolean resizeable) {
+ this.resizeable = resizeable;
+ }
+
+ public String changeAttributes(){
+ showWhenRendered = true;
+ moveable = false;
+ resizeable = false;
+ return null;
+ }
+
+ public String changeRendered(){
+ rendered = false;
+ return null;
+ }
+
+ public String reset(){
+ rendered = true;
+ showWhenRendered = false;
+ moveable = true;
+ resizeable = true;
+ return null;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-08-01 12:48:40 UTC (rev 9860)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-08-01 13:28:16 UTC (rev 9861)
@@ -205,6 +205,11 @@
<managed-bean-name>toolBarBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.ToolBarTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>modalPanelBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.ModalPanelTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/pages/ajaxInclude/step1.xhtml</from-view-id>
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-01 12:48:40 UTC (rev 9860)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-01 13:28:16 UTC (rev 9861)
@@ -777,6 +777,18 @@
selenium.mouseUp(testElementId);
AssertTextEquals(testElementResultId, afterResult);
}
+
+ /**
+ * Method to assert element style attribute with expected
+ * @param elementId - tested element id
+ * @param expectedExpression - expected style attribute
+ */
+ public void assertStyleAttribute(String elementId, String expectedExpression) {
+ String styleAttribute = selenium.getAttribute("//*[@id='" + elementId + "']/@style");
+ if (!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
+ Assert.fail("Element '" + elementId + "' with style '" + styleAttribute + "' doesn't contain '" + expectedExpression + "'");
+ }
+ }
/**
* Checks whether client is FireFox
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ModalPanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-08-01 13:28:16 UTC (rev 9861)
@@ -0,0 +1,157 @@
+/*
+ * ModalPanelTest.java Date created: 30.07.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+/**
+ * rich:modalPannel component selenium test
+ * @author Alexandr Levkovsky
+ *
+ */
+public class ModalPanelTest extends SeleniumTestBase {
+
+ private final static String PANEL_ID="test_panel";
+ private final static String FORM_ID="form:";
+ private final static String RESET_ID="reset";
+ private final static String CHANGE_RENDERED_ID="change_rendered";
+ private final static String CHANGE_ATTRIBUTES_ID="change_attributes";
+ private final static String HIDE_ID="hide";
+ private final static String SHOW_ID="show";
+ private final static String PANEL_C_DIV_ID = PANEL_ID + "CDiv";
+ private final static String PANEL_CONTENT_DIV_ID = PANEL_ID + "ContentDiv";
+ private final static String PANEL_CONTAINER_DIV_ID = PANEL_ID + "Container";
+
+
+ /**
+ * @see org.richfaces.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return "pages/modalPanel/modalPanelTest.xhtml";
+ }
+
+ @Test
+ public void testModalPanel(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing modal panel");
+
+ String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+
+ AssertPresent(panelId);
+ AssertNotVisible(panelId);
+
+ clickShow();
+
+ AssertPresent(panelId);
+ AssertVisible(panelId);
+
+ clickHide();
+
+ AssertPresent(panelId);
+ AssertNotVisible(panelId);
+
+ }
+
+ @Test
+ public void testRenderedAttribute(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing rendered attribute");
+
+ String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+
+ AssertPresent(panelId);
+
+ clickChangeRendered();
+
+ AssertNotPresent(panelId);
+ clickReset();
+ }
+
+ @Test
+ public void testShowWhenRenderedAttribute(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing showWhenRendered attribute");
+
+ String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+
+ AssertPresent(panelId);
+ AssertNotVisible(panelId);
+
+ clickChangeAttributes();
+
+ AssertPresent(panelId);
+ AssertVisible(panelId);
+ clickReset();
+ }
+
+ @Test
+ public void testLayoutAttributes(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing layout attribute");
+
+ clickShow();
+
+ String panelContainerId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+ String panelContentId = getParentId() + FORM_ID + PANEL_CONTENT_DIV_ID;
+ String panelCDivId = getParentId() + FORM_ID + PANEL_C_DIV_ID;
+
+ AssertPresent(panelContainerId);
+ AssertPresent(panelContentId);
+ AssertPresent(panelCDivId);
+
+ // test zindex attribute - should be 12
+ assertStyleAttribute(panelContainerId, "z-index: 12");
+
+ if (isFF()) {
+ // test top attribute - should be 101
+ assertStyleAttribute(panelCDivId, "top: 101");
+
+ // test left attribute - should be 102
+ assertStyleAttribute(panelCDivId, "left: 102");
+ }
+
+ // test width attribute - should be 103
+ assertStyleAttribute(panelContentId, "width: 103");
+
+ // test height attribute - should be 104
+ assertStyleAttribute(panelContentId, "height: 104");
+ }
+
+ private void clickReset() {
+ String buttonId = getParentId() + FORM_ID + RESET_ID;
+ writeStatus("Click reset button");
+ clickCommandAndWait(buttonId);
+ }
+
+ private void clickChangeRendered() {
+ String buttonId = getParentId() + FORM_ID + CHANGE_RENDERED_ID;
+ writeStatus("Click change rendered button");
+ clickCommandAndWait(buttonId);
+ }
+
+ private void clickChangeAttributes() {
+ String buttonId = getParentId() + FORM_ID + CHANGE_ATTRIBUTES_ID;
+ writeStatus("Click change attributes button");
+ clickCommandAndWait(buttonId);
+ }
+
+ private void clickShow() {
+ String buttonId = getParentId() + FORM_ID + SHOW_ID;
+ writeStatus("Click show button");
+ clickById(buttonId);
+ }
+
+ private void clickHide() {
+ String buttonId = getParentId() + FORM_ID + HIDE_ID;
+ writeStatus("Click hide button");
+ clickById(buttonId);
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ModalPanelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Rich Faces SVN: r9860 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces/ajaxValidator and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-08-01 08:48:40 -0400 (Fri, 01 Aug 2008)
New Revision: 9860
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/snippets/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/snippets/validationBean.java
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/examples/jsfValidation.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/hibernateValidation.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml
Log:
validators descriptions
Modified: 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 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/validation/PassTime.java 2008-08-01 12:48:40 UTC (rev 9860)
@@ -14,7 +14,7 @@
}
@NotEmpty
- @Length(max=12, min=3)
+ @Length(max=15, min=3)
private String title;
@NotNull
@Min(0)
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/examples/jsfValidation.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/examples/jsfValidation.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/examples/jsfValidation.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -15,7 +15,7 @@
<h:outputText value="Name:" />
<h:inputText value="#{userBean.name}" id="name" required="true">
<f:validateLength minimum="3" maximum="12"/>
- <rich:ajaxValidator event="onblur" ajaxSingle="true" />
+ <rich:ajaxValidator event="onblur"/>
</h:inputText>
<rich:message for="name" />
@@ -23,7 +23,7 @@
<h:inputText value="#{userBean.age}" id="age" required="true">
<f:convertNumber integerOnly="true"/>
<f:validateLongRange minimum="18" maximum="99"/>
- <rich:ajaxValidator event="onblur" ajaxSingle="true" />
+ <rich:ajaxValidator event="onblur"/>
</h:inputText>
<rich:message for="age"/>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/usage.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxValidator/usage.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -9,9 +9,15 @@
<ui:define name="sample">
<p>
- Using standard JSF validators
+ rich:ajaxValidator is a component designed in order to provide ajax validation
+ inside the inputs. It designed like a4j:support component but skips all JSF processing
+ except validation.
</p>
-
+ <p>
+ Look to the first simple example. This component should be added as child component
+ to input which should be validated and specify validation event. The component
+ is ajaxSingle by default so only current field will be validated.
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Title</legend>
<div class="sample-container" >
@@ -22,8 +28,11 @@
</div>
</fieldset>
<p>
- Using Hibernate validators
+ The component also provide possibility to use Hibernate Validation for the target fileds.
</p>
+ <p>
+ Look to the next examlpe which is modified in order to use Hibernate Validators:
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Title</legend>
<div class="sample-container" >
@@ -33,10 +42,10 @@
<ui:param name="openlabel" value="View Page Source" />
</ui:include>
<ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/WEB-INF/src/org/richfaces/demo/validator/ValidatorBean.java"/>
- <ui:param name="openlabel" value="View ValidatorBean.java Source" />
+ <ui:param name="openlabel" value="Validation Bean Code" />
<ui:param name="sourcetype" value="java" />
- </ui:include>
+ <ui:param name="sourcepath" value="/richfaces/beanValidator/snippets/validationBean.java"/>
+ </ui:include>
</div>
</fieldset>
</ui:define>
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-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/examples/simple.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -13,7 +13,7 @@
<h:panelGrid columns="3">
<h:outputText value="Name:" />
<h:inputText value="#{validationBean.name}" id="name">
- <rich:ajaxValidator/>
+ <rich:beanValidator/>
</h:inputText>
<rich:message for="name" />
<h:outputText value="Email:" />
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/snippets/validationBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/snippets/validationBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/snippets/validationBean.java 2008-08-01 12:48:40 UTC (rev 9860)
@@ -0,0 +1,49 @@
+package org.richfaces.demo.validation;
+
+import org.hibernate.validator.Email;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+
+public class ValidationBean {
+
+ @NotEmpty
+ @Length(min=3,max=12)
+ private String name;
+ @Email
+ @NotEmpty
+ private String email;
+ @NotNull
+ @Min(18)
+ @Max(100)
+ private int age;
+
+ public ValidationBean() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/usage.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/beanValidator/usage.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -9,19 +9,30 @@
<ui:define name="sample">
<p>
- Description
+ Starting from 3.2.2 GA version Rich Faces provides support for model-based
+ constraints defined using Hibernate Validator. So it's possible to use Hibernate
+ Validators the same as for Seam based applications.
</p>
-
+ <p>
+ rich:beanValidator component should be defined in the same way
+ as any JSF validators.
+ Lock through the example below.
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Title</legend>
<div class="sample-container" >
<ui:include src="/richfaces/beanValidator/examples/simple.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="openlabel" value="Page Code" />
<ui:param name="sourcepath" value="/richfaces/beanValidator/examples/simple.xhtml"/>
</ui:include>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="openlabel" value="Validation Bean Code" />
+ <ui:param name="sourcetype" value="java" />
+ <ui:param name="sourcepath" value="/richfaces/beanValidator/snippets/validationBean.java"/>
+ </ui:include>
</div>
</fieldset>
</ui:define>
-
</ui:composition>
</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/additionalValidation.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -21,11 +21,8 @@
</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" />
+ <a4j:commandButton value="Store my details" action="#{pt.store}"/>
</h:form>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/hibernateValidation.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/hibernateValidation.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/examples/hibernateValidation.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -13,7 +13,9 @@
<rich:graphValidator>
<h:panelGrid columns="3">
<h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name"/>
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="2"/>
+ </h:inputText>
<rich:message for="name" />
<h:outputText value="Email:" />
<h:inputText value="#{validationBean.email}" id="email"/>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml 2008-08-01 11:38:29 UTC (rev 9859)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/graphValidator/usage.xhtml 2008-08-01 12:48:40 UTC (rev 9860)
@@ -9,9 +9,15 @@
<ui:define name="sample">
<p>
- Description
+ Graph validator component also allow to register Hibernate Validators for the
+ input components. As opposite to beanValidator which should be
+ child component for the input to be validated this component should wrap
+ some subtree with inputs. As result validator for every input in this
+ subtree will be added to component.
</p>
-
+ <p>
+ Look through the next simple example:
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Title</legend>
<div class="sample-container" >
@@ -19,21 +25,38 @@
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath" value="/richfaces/graphValidator/examples/hibernateValidation.xhtml"/>
</ui:include>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="openlabel" value="Validation Bean Code" />
+ <ui:param name="sourcetype" value="java" />
+ <ui:param name="sourcepath" value="/richfaces/beanValidator/snippets/validationBean.java"/>
+ </ui:include>
</div>
</fieldset>
<p>
- Description
+ There is one additional usefull feature in Graph Validator component.
+ Value attribute could be defined with some value binding to bean. And the
+ bean properties will be validated again <b>after</b> model update.
</p>
-
+ <p>
+ Simple example of such usage below. Just write some activities of the day
+ and the time you spend to each one in a day.
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Title</legend>
- <div class="sample-container" >
+ <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>
+ <p>
+ In this case only properties of each passTime(values of the inputs) validated
+ at validation phase.
+ But after the model updated (Each explicit passtime was validated ok) all the
+ properties including "TotalTime" validated again. And total validation could
+ fails if the sum of the hours in a day more than 24.
+ </p>
</ui:define>
</ui:composition>
16 years, 4 months
JBoss Rich Faces SVN: r9859 - trunk/docs/userguide/en/src/main/resources/xslt/org/jboss/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-08-01 07:38:29 -0400 (Fri, 01 Aug 2008)
New Revision: 9859
Modified:
trunk/docs/userguide/en/src/main/resources/xslt/org/jboss/richfaces/xhtml-common.xsl
Log:
https://jira.jboss.org/jira/browse/RF-3875 - 'abstract' element was fixed
Modified: trunk/docs/userguide/en/src/main/resources/xslt/org/jboss/richfaces/xhtml-common.xsl
===================================================================
--- trunk/docs/userguide/en/src/main/resources/xslt/org/jboss/richfaces/xhtml-common.xsl 2008-08-01 11:14:44 UTC (rev 9858)
+++ trunk/docs/userguide/en/src/main/resources/xslt/org/jboss/richfaces/xhtml-common.xsl 2008-08-01 11:38:29 UTC (rev 9859)
@@ -129,4 +129,12 @@
<xsl:with-param name="nodes" select="part|reference |preface|chapter|appendix |article |bibliography|glossary|index |refentry |bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
+
+<xsl:template match="abstract" mode="titlepage.mode">
+ <div>
+ <xsl:apply-templates select="." mode="class.attribute"/>
+ <xsl:apply-templates mode="titlepage.mode"/>
+ </div>
+</xsl:template>
+
</xsl:stylesheet>
16 years, 4 months
JBoss Rich Faces SVN: r9858 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-08-01 07:14:44 -0400 (Fri, 01 Aug 2008)
New Revision: 9858
Modified:
trunk/test-applications/qa/Test Plan/ComponentsAssignment3.2.2.BETA3.xls
Log:
Modified: trunk/test-applications/qa/Test Plan/ComponentsAssignment3.2.2.BETA3.xls
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Rich Faces SVN: r9857 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-08-01 07:14:11 -0400 (Fri, 01 Aug 2008)
New Revision: 9857
Modified:
trunk/test-applications/qa/Test Plan/ComponentsAssignment3.2.2.BETA3.xls
Log:
Modified: trunk/test-applications/qa/Test Plan/ComponentsAssignment3.2.2.BETA3.xls
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Rich Faces SVN: r9856 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-08-01 07:08:36 -0400 (Fri, 01 Aug 2008)
New Revision: 9856
Modified:
trunk/docs/userguide/en/src/main/docbook/included/column.xml
Log:
RF-4068 - added information about "rich-sort-icon" class.
Modified: trunk/docs/userguide/en/src/main/docbook/included/column.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-08-01 07:42:16 UTC (rev 9855)
+++ trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-08-01 11:08:36 UTC (rev 9856)
@@ -299,11 +299,11 @@
<imagedata fileref="images/column6.png"/>
</imageobject>
</mediaobject>
- </figure>
-
+ </figure>
<para>
In the example above the first column is sorted in descending order. But if recurring rows appear in the table the relative second column are sorted in ascending order.
</para>
+ <para>You can customize the sorting's icon element using "rich-sort-icon" class.</para>
<para>
The <emphasis><property>"sortPriority"</property></emphasis> attribute
defines a set of column <property>ids</property> in the order the columns could be set.
16 years, 4 months
JBoss Rich Faces SVN: r9855 - in trunk/sandbox/ui/extendedDataTable/src/main: java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-08-01 03:42:16 -0400 (Fri, 01 Aug 2008)
New Revision: 9855
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
Log:
fix xml format - add CDATA inside script
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-01 06:20:33 UTC (rev 9854)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-01 07:42:16 UTC (rev 9855)
@@ -1640,10 +1640,11 @@
}
}
- public void encodeDragDropChildScripts(FacesContext context,
- UIComponent component) throws IOException {
+ public String encodeDragDropChildScripts(FacesContext context,
+ UIDataTable component) throws IOException {
TableDragDropRenderer.getInstance(context).encodeChildScripts(context,
component);
+ return "";
}
public void encodeNamespace(FacesContext context, UIComponent component)
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-08-01 06:20:33 UTC (rev 9854)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-08-01 07:42:16 UTC (rev 9855)
@@ -8,16 +8,15 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.javascript.JSEncoder;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.org.w3c.tidy.EntityTable;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIColumn;
+import org.richfaces.component.UIDataTable;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONObject;
import org.richfaces.renderkit.DragIndicatorRendererBase;
@@ -77,41 +76,28 @@
* table component
* @throws IOException
*/
- public void encodeChildScripts(FacesContext context, UIComponent component)
+ public void encodeChildScripts(FacesContext context, UIDataTable component)
throws IOException {
// new DragIndicatorRendererBase().encodeChildScripts(context,
// component);
new DragIndicatorRendererBase() {
public void encodeChildScripts(FacesContext context,
- UIComponent component) throws IOException {
+ UIDataTable component) throws IOException {
+
+ ResponseWriter responseWriter = context.getResponseWriter();
+ responseWriter.write("\nvar elt = $(\""+ component.getBaseClientId(context) +":dataTable_indicator\");\n");
+ responseWriter.write("elt.markers = {};\n");
+ responseWriter.write("elt.indicatorTemplates = {};\n");
+
super.encodeChildScripts(context, component);
// redefine DEFAULT marker to be like REJECT marker
- ResponseWriter responseWriter = context.getResponseWriter();
+
responseWriter.write("elt.markers['" + DEFAULT + "'] = \"");
responseWriter.write(getPredefinedMarker(context, REJECT));
responseWriter.write("\";\n");
+ responseWriter.write("createDragIndicator(elt, '', '');\n");
+
}
-
- protected String getPredefinedMarker(FacesContext context, Object facetName) {
- if (MARKERS_PREDEFINED.contains(facetName)) {
- StringBuffer buff = new StringBuffer();
- JSEncoder encoder = new JSEncoder();
- String source = "<img alt='' border='0' width='16' height='16' src='" +
- getResource("/org/richfaces/renderkit/html/images/" + facetName + ".gif").getUri(context, null) +"' />";
- char chars[] = source.toString().toCharArray();
- for (int i = 0; i < chars.length; i++) {
- char c = chars[i];
- if (!encoder.compile(c)) {
- buff.append(encoder.encode(c));
- } else {
- buff.append(c);
- }
- }
- return buff.toString();
- }
-
- throw new IllegalArgumentException("No predefined marker with [" + facetName + "] name exists!");
- }
}.encodeChildScripts(context, component);
}
Modified: trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-08-01 06:20:33 UTC (rev 9854)
+++ trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-08-01 07:42:16 UTC (rev 9855)
@@ -56,11 +56,9 @@
<f:call name="encodeNamespace" />
<script type="text/javascript">
- var elt = $("#{clientId}:dataTable_indicator");
- elt.markers = {};
- elt.indicatorTemplates = {};
- <f:call name="encodeDragDropChildScripts" />
- createDragIndicator(elt, '', '');
+ //<![CDATA[
+ #{this:encodeDragDropChildScripts(context, component)};
+ //]]>
</script>
</div>
<span id="#{clientId}:dataTable_indicator_span" />
16 years, 4 months