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 Summary: html:javascript tag doesn't work right with jsFunctionName set Product: Struts Version: 1.2.4 Platform: All OS/Version: All Status: NEW Severity: Major Priority: Other Component: Validator Framework AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 1: create a custom <validator> that has the "jsFunctionName" attribute set. 2: create a page that includes the html:javascript tag. 3: Examine the generated javascript for the validateMyForm() function. Notice that the line that sets the formValidationResult variable calls the function defined by the validator tag "method" attribute instead of the correct one specified by jsFunctionName. Here's an example, where I tried to create a slightly different "required" field validation: <validator name="required_fullmsg" classname="org.apache.struts.validator.FieldChecks" method="validateRequired" 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="validateRequiredFullMsg" /> I copied org.apache.commons.validator.javascript.validateRequired.js and changed line 17 to look like this: oRequired = eval('new ' + formName.value + '_validateRequiredFullMsg()'); This works with a small patch to JavascriptValidatorTag.java (attached). --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
