Author: mvitenkov
Date: 2008-07-17 05:39:30 -0400 (Thu, 17 Jul 2008)
New Revision: 9646
Added:
trunk/test-applications/jsp/src/main/java/validator/GraphValidatorBean.java
trunk/test-applications/jsp/src/main/java/validator/TestValidable.java
trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
Removed:
trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
Modified:
trunk/test-applications/jsp/src/main/java/validator/DataBean.java
trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Validator.xml
Log:
AjaxValidator & GraphValidator
Modified: trunk/test-applications/jsp/src/main/java/validator/DataBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/DataBean.java 2008-07-17 08:07:38
UTC (rev 9645)
+++ trunk/test-applications/jsp/src/main/java/validator/DataBean.java 2008-07-17 09:39:30
UTC (rev 9646)
@@ -4,22 +4,94 @@
package validator;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-import java.util.ListIterator;
-
+import java.util.Random;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import org.hibernate.validator.Max;
+import org.hibernate.validator.Size;
import org.hibernate.validator.Valid;
-
+import org.richfaces.component.UIGraphValidator;
+import util.componentInfo.ComponentInfo;
+import util.data.Data;
/**
- * @author asmirnov
+ * @author mvitenkov
*
*/
public class DataBean {
private final List<Validable> beans;
+ private UIGraphValidator graphValidatorComponent = null;
+ private String bindLabel;
+ private boolean rendered;
+ @Size(min=2,max=5,message="Size validation failed!!!!")
+ private ArrayList<Data> data;
+ private int length;
+ public int getLength() {
+ return length;
+ }
+
+ public void setLength(int length) {
+ this.length = length;
+ }
+
+ public ArrayList<Data> getData() {
+ return data;
+ }
+
+ public void setData(ArrayList<Data> data) {
+ this.data = data;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = graphValidatorComponent.getClientId(context).toString();
+ }
+
+ public String add(){
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(graphValidatorComponent);
+ return null;
+ }
+ public String addNewItem() {
+ if (length < 0)
+ length = 0;
+ if (data.size() > length)
+ for (int i = length; i < data.size();)
+ data.remove(i);
+ else{
+ Random r = new Random();
+ for (int i = data.size() + 1; i <= length; i++)
+ data.add(new Data(i, r.nextInt(1000), Data.Random(6), r.nextInt(10000) + 98389,
Data.Random(r.nextInt(10) + 1), r.nextInt(500000), Data.statusIcon[i % 5], Data.Random(3),
false));
+ }
+ return null;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public UIGraphValidator getGraphValidatorComponent() {
+ return graphValidatorComponent;
+ }
+
+ public void setGraphValidatorComponent(UIGraphValidator graphValidatorComponent) {
+ this.graphValidatorComponent = graphValidatorComponent;
+ }
+
/**
* @return the beans
*/
@@ -36,6 +108,12 @@
beans.add(new MinBean());
beans.add(new MaxBean());
beans.add(new MinMaxBean());
+ this.bindLabel = "Click Binding";
+ this.rendered = true;
+ this.data = new ArrayList<Data>();
+ Random r = new Random();
+ for(int i = 0; i < 10; i++)
+ data.add(new Data(i, r.nextInt(1000), Data.Random(6), r.nextInt(10000) + 98389,
Data.Random(r.nextInt(10) + 1), r.nextInt(500000), Data.statusIcon[i % 5], Data.Random(3),
false)); //new Data(i, Data.Random(5), Data.statusIcon[i % 5], Data.Random(6), false));
}
@Max(value=20,message="Total value should be less then 20")
Added: trunk/test-applications/jsp/src/main/java/validator/GraphValidatorBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/GraphValidatorBean.java
(rev 0)
+++ trunk/test-applications/jsp/src/main/java/validator/GraphValidatorBean.java 2008-07-17
09:39:30 UTC (rev 9646)
@@ -0,0 +1,32 @@
+package validator;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.Valid;
+import org.richfaces.component.UIGraphValidator;
+
+public class GraphValidatorBean {
+
+ private final List<TestValidable> beans;
+
+ @Valid
+ public List<TestValidable> getBeans() {
+ return beans;
+ }
+
+ public GraphValidatorBean() {
+ beans = new ArrayList(1);
+ beans.add(new ValidatorBean());
+ }
+ @Max(value=50,message="total length > 50")
+ @Min(value=10,message="total length < 10")
+ public int getTotal(){
+ int total = 0;
+ for (TestValidable bean : beans) {
+ total += bean.getText().toString().length() +
bean.getDateValue().toString().length();
+ }
+ return total;
+ }
+}
Added: trunk/test-applications/jsp/src/main/java/validator/TestValidable.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/TestValidable.java
(rev 0)
+++ trunk/test-applications/jsp/src/main/java/validator/TestValidable.java 2008-07-17
09:39:30 UTC (rev 9646)
@@ -0,0 +1,13 @@
+package validator;
+
+
+public interface TestValidable {
+
+ public String getText();
+
+ public int getIntValue();
+
+ public boolean isBooleanValue();
+
+ public String getDateValue();
+}
Deleted: trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java 2008-07-17
08:07:38 UTC (rev 9645)
+++ trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java 2008-07-17
09:39:30 UTC (rev 9646)
@@ -1,37 +0,0 @@
-package validator;
-
-import javax.faces.component.UIMessages;
-
-import org.hibernate.validator.CreditCardNumber;
-import org.hibernate.validator.Email;
-
-public class ValidatorBean {
- @Email(message="not a valid email value!")
- private String mailValue;
- @CreditCardNumber(message="not a valid credit card number")
- private String creditValue;
-
- public String getCreditValue() {
- return creditValue;
- }
-
- public void setCreditValue(String creditValue) {
- this.creditValue = creditValue;
- }
-
- public String getMailValue() {
- return mailValue;
- }
-
- public ValidatorBean(){
- this.mailValue = "";
- this.creditValue = "";
- }
- public String getMailDescription() {
- return "E-mail validation:";
- }
-
- public String getCreditDescription() {
- return "Credit card validation:";
- }
-}
Added: trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
(rev 0)
+++ trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java 2008-07-17
09:39:30 UTC (rev 9646)
@@ -0,0 +1,290 @@
+package validator;
+
+import java.util.ArrayList;
+import java.util.Date;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+import org.hibernate.validator.AssertFalse;
+import org.hibernate.validator.AssertTrue;
+import org.hibernate.validator.CreditCardNumber;
+import org.hibernate.validator.EAN;
+import org.hibernate.validator.Email;
+import org.hibernate.validator.Future;
+import org.hibernate.validator.Pattern;
+import org.hibernate.validator.Size;
+import org.richfaces.component.UIBeanValidator;
+import util.componentInfo.ComponentInfo;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+
+public class ValidatorBean implements TestValidable{
+ @Email(message="Mail validation failed!")
+ private String text;
+ @AssertFalse(message="AssertFalse validation failed!")
+ private boolean booleanValue;
+ @AssertTrue(message="Asserttrue validation failed!")
+ private boolean assertTrue;
+ @Future(message="Future validation failed!")
+ private String dateValue;
+ @Pattern(regex="^\b1234\b*$") //Searh "1234" as a whole word
+ private int intValue;
+ @EAN(message="EAN validation failed")
+ private String ean;
+ @CreditCardNumber(message="CreditCardNumber validation failed!")
+ private String creditValue;
+ @Size(min=1,max=5,message="Size validation failed!")
+ private ArrayList<SelectItem> sizeValues;
+ private String sizeValue;
+ private UIBeanValidator ajaxValidatorComponent = null;
+ private boolean ajaxSingle;
+ private String bindLabel;
+ private boolean disableDefault;
+ private String eventsQueue;
+ private boolean ignoreDupResponses;
+ private boolean immediate;
+ private boolean limitToList;
+ private UIComponent parentProperties = null;
+ private boolean rendered;
+ private boolean renderRegionOnly;
+ private int requestDelay;
+ private boolean selfRendered;
+ private boolean submitted;
+ private int timeout;
+
+ public int getTimeout() {
+ return timeout;
+ }
+
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+
+ public boolean isSubmitted() {
+ return submitted;
+ }
+
+ public void setSubmitted(boolean submitted) {
+ this.submitted = submitted;
+ }
+
+ public boolean isSelfRendered() {
+ return selfRendered;
+ }
+
+ public void setSelfRendered(boolean selfRendered) {
+ this.selfRendered = selfRendered;
+ }
+
+ public int getRequestDelay() {
+ return requestDelay;
+ }
+
+ public void setRequestDelay(int requestDelay) {
+ this.requestDelay = requestDelay;
+ }
+
+ public boolean isRenderRegionOnly() {
+ return renderRegionOnly;
+ }
+
+ public void setRenderRegionOnly(boolean renderRegionOnly) {
+ this.renderRegionOnly = renderRegionOnly;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+
+
+ public UIComponent getParentProperties() {
+ return parentProperties;
+ }
+
+ public void setParentProperties(UIComponent parentProperties) {
+ this.parentProperties = parentProperties;
+ }
+
+ public boolean isLimitToList() {
+ return limitToList;
+ }
+
+ public void setLimitToList(boolean limitToList) {
+ this.limitToList = limitToList;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isIgnoreDupResponses() {
+ return ignoreDupResponses;
+ }
+
+ public void setIgnoreDupResponses(boolean ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+
+ public String getEventsQueue() {
+ return eventsQueue;
+ }
+
+ public void setEventsQueue(String eventsQueue) {
+ this.eventsQueue = eventsQueue;
+ }
+
+ public boolean isDisableDefault() {
+ return disableDefault;
+ }
+
+ public void setDisableDefault(boolean disableDefault) {
+ this.disableDefault = disableDefault;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public boolean isAjaxSingle() {
+ return ajaxSingle;
+ }
+
+ public void setAjaxSingle(boolean ajaxSingle) {
+ this.ajaxSingle = ajaxSingle;
+ }
+
+ public String add(){
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(ajaxValidatorComponent);
+ return null;
+ }
+
+ public UIBeanValidator getAjaxValidatorComponent() {
+ return ajaxValidatorComponent;
+ }
+
+ public void setAjaxValidatorComponent(UIBeanValidator ajaxValidatorComponent) {
+ this.ajaxValidatorComponent = ajaxValidatorComponent;
+ }
+
+ public String getSizeValue() {
+ return sizeValue;
+ }
+
+ public void setSizeValue(String sizeValue) {
+ this.sizeValue = sizeValue;
+ }
+
+ public ArrayList<SelectItem> getSizeValues() {
+ return sizeValues;
+ }
+
+ public void setSizeValues(ArrayList<SelectItem> sizeValues) {
+ this.sizeValues = sizeValues;
+ }
+
+ public String getCreditValue() {
+ return creditValue;
+ }
+
+ public void setCreditValue(String creditValue) {
+ this.creditValue = creditValue;
+ }
+
+ public String getEan() {
+ return ean;
+ }
+
+ public void setEan(String ean) {
+ this.ean = ean;
+ }
+
+ public ValidatorBean(){
+ this.ajaxSingle = true;
+ this.text = "mvitenkov(a)exadel.com";
+ this.intValue = 1234;
+ this.dateValue = (new Date()).toString();
+ this.booleanValue = false;
+ this.ean = "97 81550 41198 0";
+ this.creditValue = "visa maestro";
+ this.assertTrue = true;
+ this.sizeValues = new ArrayList<SelectItem>();
+ for(int i=0;i<6;i++){
+ sizeValues.add(new SelectItem("value_"+i,"label_"+i));
+ }
+ this.sizeValue = sizeValues.get(0).getValue().toString();
+ this.bindLabel = "click Binding";
+ this.disableDefault = false;
+ this.eventsQueue = "onchange";
+ this.ignoreDupResponses = true;
+ this.immediate = false;
+ this.limitToList = false;
+ this.rendered = true;
+ this.renderRegionOnly = true;
+ this.requestDelay = 500;
+ this.selfRendered = false;
+ this.submitted = false;
+ this.timeout = 3000;
+ }
+
+ public int getIntValue() {
+
+ return intValue;
+ }
+
+ public String getText() {
+
+ return text;
+ }
+
+ public String getDateValue() {
+
+ return dateValue;
+ }
+ public boolean isBooleanValue() {
+
+ return booleanValue;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public void setBooleanValue(boolean booleanValue) {
+ this.booleanValue = booleanValue;
+ }
+
+ public void setDateValue(String dateValue) {
+ this.dateValue = dateValue;
+ }
+
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public boolean isAssertTrue() {
+ return assertTrue;
+ }
+
+ public void setAssertTrue(boolean assertTrue) {
+ this.assertTrue = assertTrue;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = ajaxValidatorComponent.getClientId(context);
+ }
+}
Modified: trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp 2008-07-17
08:07:38 UTC (rev 9645)
+++ trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp 2008-07-17
09:39:30 UTC (rev 9646)
@@ -3,6 +3,7 @@
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="validatorSubviewID">
+<a4j:region>
<rich:panel>
<f:facet name="header">
<h:outputText>Single input field with label and message. Validated by AJAX on
every changing.</h:outputText>
@@ -15,7 +16,8 @@
</rich:panel>
<h2>Input fields with label and message in the JSF dataTable. Each
field validated by AJAX on "onchange" event</h2>
- <rich:graphValidator value="#{data}">
+ <rich:graphValidator value="#{data}"
binding="#{data.graphValidatorComponent}" id="graphValidatorID"
+ rendered="#{data.rendered}">
<rich:dataTable value="#{data.beans}" var="bean"
id="table">
<f:facet name="header">
<h:outputText
@@ -29,8 +31,7 @@
<h:outputLabel for="text" value="#{bean.textDescription}"
/>
<h:inputText id="text" value="#{bean.text}">
<rich:ajaxValidator event="onchange" />
- </h:inputText>
- <rich:message for="text" showDetail="true"
showSummary="true" />
+ </h:inputText>
</h:column>
<h:column>
<f:facet name="header">
@@ -45,19 +46,104 @@
<f:facet name="footer">
<h:panelGroup>
<h:outputText>in addition to fields validation, total sum for an all integer
values validated for a value less then 20.</h:outputText>
- <h:commandButton value="Submit all fields"></h:commandButton>
+ <a4j:commandButton value="Submit all
fields"></a4j:commandButton>
</h:panelGroup>
</f:facet>
</rich:dataTable>
</rich:graphValidator>
+ </a4j:region>
<br />
+ <%--<rich:graphValidator value="#{graphValidator}">--%>
+ <h:panelGrid columns="2" border="2"
id="panelGridID">
- <h:panelGroup>
- <h:outputLabel for="mailValue"
value="#{validator.mailDescription}" />
- <h:inputText value="#{validator.someValue}" id="mailValue">
+ <f:facet name="header">
+ <h:outputText value="Ajax Validator test" />
+ </f:facet>
+
+ <h:outputLabel for="mailValue" value="Mail validation:" />
+ <h:panelGroup>
+ <h:inputText value="#{validator.text}" id="mailValue">
+ <rich:ajaxValidator ajaxSingle="#{validator.ajaxSingle}"
binding="#{validator.ajaxValidatorComponent}"
+ data="{param1:'param1',param2:'param2'}"
disableDefault="#{validator.disableDefault}" event="onchange"
eventsQueue="#{validator.eventsQueue}"
+ focus="mailValue" id="ajaxValidatorID"
ignoreDupResponses="#{validator.ignoreDupResponses}"
immediate="#{validator.immediate}"
+ limitToList="#{validator.limitToList}"
onbeforedomupdate="#{event.onbeforedomupdate}"
oncomplete="#{event.oncomplete}" onsubmit="#{event.onsubmit}"
+ parentProperties="#{validator.parentProperties}"
process="mailValue,booleanValue,assertTrue,eanValue,creditValue"
rendered="#{validator.rendered}"
+ renderRegionOnly="#{validator.renderRegionOnly}"
requestDelay="#{validator.requestDelay}"
reRender="mailValue,booleanValue,assertTrue,eanValue,creditValue"
+ selfRendered="#{validator.selfRendered}" status="mailValue"
submitted="#{validator.submitted}"
timeout="#{validator.timeout}"></rich:ajaxValidator>
+ </h:inputText>
+ <rich:message for="mailValue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputLabel for="booleanValue" value="AssertFalse
validation:" />
+ <h:panelGroup>
+ <h:selectBooleanCheckbox value="#{validator.booleanValue}"
+ id="booleanValue">
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:selectBooleanCheckbox>
+ <rich:message for="booleanValue" showDetail="true"
+ showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputLabel for="assertTrue" value="AssertTrue validation:"
/>
+ <h:panelGroup>
+ <h:selectBooleanCheckbox value="#{validator.assertTrue}"
+ id="assertTrue">
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:selectBooleanCheckbox>
+ <rich:message for="assertTrue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+ <%--
+ <h:outputLabel for="dateValue" value="Future validation:" />
+ <h:panelGroup>
+ <h:inputText value="#{validator.dateValue}" id="dateValue">
<rich:ajaxValidator event="onchange"></rich:ajaxValidator>
</h:inputText>
- <rich:message for="mailValue" showDetail="true"
showSummary="true" />
- </h:panelGroup>
+ <rich:message for="dateValue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputLabel for="patternValue" value="Pattern(1234)
validation:" />
+ <h:panelGroup>
+ <h:inputText value="#{validator.intValue}"
id="patternValue">
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:inputText>
+ <rich:message for="patternValue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+ --%>
+ <h:outputLabel for="eanValue" value="EAN validation:" />
+ <h:panelGroup>
+ <h:inputText value="#{validator.ean}" id="eanValue">
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:inputText>
+ <rich:message for="eanValue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputLabel for="creditValue" value="CreditCardNumber
validation:" />
+ <h:panelGroup>
+ <h:inputText value="#{validator.creditValue}"
id="creditValue">
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:inputText>
+ <rich:message for="creditValue" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputLabel for="sizeValues" value="Size validation:" />
+ <h:panelGroup>
+ <h:selectOneMenu value="#{validator.sizeValue}">
+ <f:selectItems id="sizeValues"
value="#{validator.sizeValues}"></f:selectItems>
+ <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ </h:selectOneMenu>
+ <rich:message for="sizeValues" showDetail="true"
showSummary="true" />
+ </h:panelGroup>
+
+ <h:outputText value="total length should be less than 50" />
+ <a4j:commandButton value="validate all fields"
reRender="panelGridID"></a4j:commandButton>
+
+ <f:facet name="footer">
+ <h:outputText value="...together with graphValidator" />
+ </f:facet>
+
+ </h:panelGrid>
+ <%--</rich:graphValidator>--%>
+
+
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp 2008-07-17
08:07:38 UTC (rev 9645)
+++ trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp 2008-07-17
09:39:30 UTC (rev 9646)
@@ -3,5 +3,79 @@
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="validatorPropertySubviewID">
-<div style="FONT-WEIGHT: bold;">Component properties</div>
+ <h:commandButton value="add(ajaxValidator) test"
action="#{validator.add}"></h:commandButton>
+
+ <h:commandButton value="add(graphValidator) test"
action="#{data.add}"></h:commandButton>
+ <br />
+ <br />
+ <h:panelGrid columns="2">
+ <h:outputText value="Ajax Validator test" style="align:center;
font-weight:bold;"/>
+ <h:outputText value="Graph Validator test" style="align:center;
font-weight:bold;"/>
+ <h:panelGrid columns="2" border="2">
+
+ <h:outputText value="ajaxSingle" />
+ <h:selectBooleanCheckbox value="#{validator.ajaxSingle}"
+ onchange="submit();" />
+
+ <h:commandButton actionListener="#{validator.checkBinding}"
+ value="Binding" />
+ <h:outputText value="#{validator.bindLabel}" />
+
+ <h:outputText value="disableDefault" />
+ <h:selectBooleanCheckbox value="#{validator.disableDefault}"
+ onchange="submit();" />
+
+ <h:outputText value="eventsQueue" />
+ <h:inputText value="#{validator.eventsQueue}">
+ <a4j:support event="onchange"
reRender="ajaxValidatorID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="ignoreDupResponces" />
+ <h:selectBooleanCheckbox value="#{validator.ignoreDupResponses}"
+ onchange="submit();" />
+
+ <h:outputText value="immediate" />
+ <h:selectBooleanCheckbox value="#{validator.immediate}"
+ onchange="submit();" />
+
+ <h:outputText value="limitToList" />
+ <h:selectBooleanCheckbox value="#{validator.limitToList}"
+ onchange="submit();" />
+
+ <h:outputText value="renderRegionOnly" />
+ <h:selectBooleanCheckbox value="#{validator.renderRegionOnly}"
+ onchange="submit();" />
+
+ <h:outputText value="requestDelay" />
+ <h:inputText value="#{validator.requestDelay}">
+ <a4j:support event="onchange"
reRender="ajaxValidatorID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="selfRendered" />
+ <h:selectBooleanCheckbox value="#{validator.selfRendered}"
+ onchange="submit();" />
+
+ <h:outputText value="submitted" />
+ <h:selectBooleanCheckbox value="#{validator.submitted}"
+ onchange="submit();" />
+
+ <h:outputText value="timeout" />
+ <h:inputText value="#{validator.timeout}">
+ <a4j:support event="onchange"
reRender="ajaxValidatorID"></a4j:support>
+ </h:inputText>
+ </h:panelGrid>
+
+
+ <h:panelGrid columns="2" border="2"
style="float:top;">
+ <h:commandButton actionListener="#{data.checkBinding}"
+ value="Binding" />
+ <h:outputText value="#{data.bindLabel}" />
+
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox value="#{data.rendered}"
+ onchange="submit();" />
+ </h:panelGrid>
+
+ </h:panelGrid>
+
</f:subview>
\ No newline at end of file
Modified:
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp
===================================================================
---
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp 2008-07-17
08:07:38 UTC (rev 9645)
+++
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp 2008-07-17
09:39:30 UTC (rev 9646)
@@ -3,5 +3,66 @@
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="validatorStraightforwardSubviewID">
-<div style="FONT-WEIGHT: bold;">Straightforward for test set</div>
+ <rich:dataTable value="#{data.data}" var="data"
id="SizeValidationID">
+ showSummary="true" />
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#1" />
+ </f:facet>
+ <a4j:commandLink value="Select"
reRender="SizeValidationID"></a4j:commandLink>
+ <f:facet name="footer">
+ <h:outputText value="#1" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#4" />
+ </f:facet>
+ <h:outputText value="#{data.int2}"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#4" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#5" />
+ </f:facet>
+ <h:outputText value="#{data.str1}"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#5" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#7" />
+ </f:facet>
+ <h:graphicImage value="#{data.str2}"></h:graphicImage>
+ <h:outputText value="#{data.str2}"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#7" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#9" />
+ </f:facet>
+ <h:selectBooleanCheckbox
value="#{data.bool0}"></h:selectBooleanCheckbox>
+ <f:facet name="footer">
+ <h:outputText value="#9" />
+ </f:facet>
+ </rich:column>
+ </rich:dataTable>
+ <br />
+ <a4j:region>
+ <h:outputText value="Enter quantity of lines [data]" />
+ <h:panelGroup>
+ <h:inputText value="#{data.length}"/>
+ <a4j:commandButton action="#{data.addNewItem}" value="ok"
+ reRender="SizeValidationID"></a4j:commandButton>
+ </h:panelGroup>
+ </a4j:region>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Validator.xml
===================================================================
---
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Validator.xml 2008-07-17
08:07:38 UTC (rev 9645)
+++
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Validator.xml 2008-07-17
09:39:30 UTC (rev 9646)
@@ -22,5 +22,10 @@
<managed-bean-class>validator.ValidatorBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>graphValidator</managed-bean-name>
+ <managed-bean-class>validator.GraphValidatorBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>