RE: [S2] client-side validation error message duplication
--- On Fri, 9/12/08, Kawczynski, David wrote: > I'm using struts 2.1.2, and the xhtml theme to render a > form. When client-side validaiton fails, an error message > is placed above the bad input fields. > Subsequent submission attempts result in new error messages > being ADDED to the UI, but the old messages are never removed. I found the issue. I was being a dodo. The struts/xhtml/validation.js file's clearErrorMessages function contains code to retrieve the table that stores the form. It then iterates over the table's rows, deleting any that has an "errorFor" attribute. In my case, the table that is retrieved is completely empty! It turns out that my jsp file looks like this: Which resulted in the generated html to look like this: The first table in the form had no rows! Removing the empty elements from the jsp page fixed my issue. I should pay more attention when migrating from the simple theme to an xhtml theme. :) Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] client-side validation error message duplication
If you are using Spring into your projet, this may be related to the beans being singletons, we had this problem in the past, we actually were required to call cleanErrorsAndMessages method at each prepare call. - Pascal Kawczynski, David wrote: I'm using struts 2.1.2, and the xhtml theme to render a form. When client-side validaiton fails, an error message is placed above the bad input fields. Subsequent submission attempts result in new error messages being ADDED to the UI, but the old messages are never removed. I need to clear out previous submission attempt's error messages before adding current submission attempt's error messages. I appreciate any help you can provide! -dave Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] client-side validation error message duplication
--- On Fri, 9/12/08, Kawczynski, David wrote: > I'm using struts 2.1.2, and the xhtml theme to render a > form. When client-side validaiton fails, an error message > is placed above the bad input fields. > Subsequent submission attempts result in new error messages > being ADDED to the UI, but the old messages are never removed. The label code is made of fairly brittle DOM manipulation; is there anything in your form that might mess with the DOM (IIRC there was an issue with hidden fields at one point; not sure if that was resolved or not)? The code that does all that lives in validation.js, although it's not served from the template directory. If you want to customize yours you need to change the form-validate.ftl template to use the location of your copy of validation.js. (I'm writing a small blurb about this in case my client-side validation changes don't meet with strenuous objections, but the technique is valid even if it doesn't make it in to the mainline release; I'll follow up when that's done.) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] client-side validation error message duplication
I'm using struts 2.1.2, and the xhtml theme to render a form. When client-side validaiton fails, an error message is placed above the bad input fields. Subsequent submission attempts result in new error messages being ADDED to the UI, but the old messages are never removed. I need to clear out previous submission attempt's error messages before adding current submission attempt's error messages. I appreciate any help you can provide! -dave Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.