struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31509] - html:javascript tag doesn't work right with jsFunctionName set
Date Sun, 03 Oct 2004 07:04:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31509>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31509

html:javascript tag doesn't work right with jsFunctionName set

niallp@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From niallp@apache.org  2004-10-03 07:04 -------
The jsFunctionName relates to the functions called by the scripts rather than 
whats in generated form's validation method. You're right in that it uses the 
method name - you need to change your custom validator so it doesn't have the 
same method name as the required validator. You can do ith either with or 
without a jsFunctionName....

1) Specifying a jsFunctionName
==============================

<validator name="required_fullmsg"
              classname="org.apache.struts.validator.FieldChecks"
                 method="validateRequiredFullMsg"
           methodParams="java.lang.Object,
                         org.apache.commons.validator.ValidatorAction,
                         org.apache.commons.validator.Field,
                         org.apache.struts.action.ActionMessages,
                         javax.servlet.http.HttpServletRequest"
                    msg="errors.detail"
             jsFunction="org.swapsimple.javascript.validateRequiredFullMsg"
             jsFunctionName="RequiredFullMsgValidations"
        />

In your script....

   function validateRequiredFullMsg(form) {
     
      oRequired = eval('new ' + formName.value + '_RequiredFullMsgValidations
()');
      etc. etc.

   }

2) Without a jsFunctionName
===========================

<validator name="required_fullmsg"
              classname="org.apache.struts.validator.FieldChecks"
                 method="validateRequiredFullMsg"
           methodParams="java.lang.Object,
                         org.apache.commons.validator.ValidatorAction,
                         org.apache.commons.validator.Field,
                         org.apache.struts.action.ActionMessages,
                         javax.servlet.http.HttpServletRequest"
                    msg="errors.detail"
             jsFunction="org.swapsimple.javascript.validateRequiredFullMsg"
        />

In your script....

   function validateRequiredFullMsg(form) {
     
      oRequired = eval('new ' + formName.value + '_required_fullmsg()');
      etc. etc.

   }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message