File Changes:
Directory: /visualweb/samples/webapps/TwoPageCrudTable/web/
===========================================================
File [changed]: Page1.jsp
Url: http://visualweb.netbeans.org/source/browse/visualweb/samples/webapps/TwoPageCrudTable/web/Page1.jsp?r1=1.1&r2=1.2
Delta lines: +2 -2
-------------------
--- Page1.jsp 22 Aug 2007 22:44:46 -0000 1.1
+++ Page1.jsp 16 Oct 2007 02:05:22 -0000 1.2
@@ -66,8 +66,8 @@
-
-
+
+
Directory: /visualweb/samples/webapps/TwoPageCrudTable/web/
===========================================================
File [changed]: UpdatePage.jsp
Url: http://visualweb.netbeans.org/source/browse/visualweb/samples/webapps/TwoPageCrudTable/web/UpdatePage.jsp?r1=1.1&r2=1.2
Delta lines: +2 -2
-------------------
--- UpdatePage.jsp 22 Aug 2007 22:44:46 -0000 1.1
+++ UpdatePage.jsp 16 Oct 2007 03:12:48 -0000 1.2
@@ -46,9 +46,9 @@
-
+
-
+
Page bean that corresponds to a similarly named JSP page. This
@@ -397,5 +402,28 @@
// TODO: Replace with your code
tripDataProvider.setValue("TRIP.TRIPTYPEID", tripType.getValue());
}
+
+ private void multipleValidate(UIComponent component, Object value) {
+ String theCity = (String) value;
+ if ( theCity.length() > 32 ) {
+ ((UIInput) component).setValid(false);
+ throw new ValidatorException(new FacesMessage("Error: City name must be less than 32 characters"));
+ }
+ for (int i = 0; i < theCity.length(); i++) {
+ if (Character.isDigit(theCity.charAt(i)) ) {
+ ((UIInput) component).setValid(false);
+ throw new ValidatorException(new FacesMessage("Error: City name must contain no digits"));
+ }
+ }
+ }
+
+ public void fromCity_validate(FacesContext context, UIComponent component, Object value) {
+ multipleValidate(component, value);
+ }
+
+ public void toCity_validate(FacesContext context, UIComponent component, Object value) {
+ multipleValidate(component, value);
+ }
+
}