You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dw...@apache.org on 2001/08/17 19:42:05 UTC

cvs commit: jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/taglib/html JavascriptValidatorTag.java

dwinterfeldt    01/08/17 10:42:05

  Modified:    contrib/validator/src/share/com/wintecinc/struts/taglib/html
                        JavascriptValidatorTag.java
  Log:
  Switch to using commons packages and fix for the JavaScript because float and some other words are keywords in Netscape.
  
  Revision  Changes    Path
  1.2       +7 -1      jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavascriptValidatorTag.java	2001/07/09 03:20:25	1.1
  +++ JavascriptValidatorTag.java	2001/08/17 17:42:05	1.2
  @@ -273,8 +273,14 @@
             for (Iterator i = lActions.iterator(); i.hasNext(); ) {
                ValidatorAction va = (ValidatorAction)i.next();
                String jscriptVar = null;
  +             String functionName = null;
                
  -             results.append("	 function " + va.getName() + " () { \n");
  +             if (va.getJsFunctionName() != null && va.getJsFunctionName().length() > 0)
  +                functionName = va.getJsFunctionName();
  +             else 
  +                functionName = va.getName();
  +             
  +             results.append("	 function " + functionName + " () { \n");
                for (Iterator x = form.getFields().iterator(); x.hasNext(); ) {
                   Field field = (Field)x.next();