Here is a workaround.
I've modified validator-rules.xml, not to verify field that are null (or 'undefined' is Javascript).
I add comments around the modifications (just add 'if (field != null)' test around field manipulation.
This workaround is successfully tested with Firefox (and not with IE).
The correct solution would be to not generate date verification for date field displayed as textfield.
Same issue can be reproduce by specifying as readonly an attribute displayed as textfield.
So the correct correction should be to not generate any JS validation on textfield attribute (and not only for date as explained above).
I never actually intended dates to be represented using plain text fields but I guess we should allow it nevertheless .. according to you, which types do not require validation when rendered into a textfield (you mentioned 'not only date a explained above' ) ?
I am just reading all this for the first time but could you explain to me why you talk about a text field while at the same time you say the field does not exist ?
OK my text was not clear ...
In my 2 lasts comment, I wanted to say "plaintext" instead of "textfield".
So with this replacement, we've got :
"... The correct solution would be to not generate date verification for date field displayed as plaintext" for the 1rst comment,
and
"Same issue can be reproduce by specifying as readonly an attribute displayed as plaintext.
So the correct correction should be to not generate any JS validation on plaintext attribute (and not only for date as explained above)." for the second comment.
Sorry for this mistake.
so if I understand correctly (I haven't tried to reproduce it yet), it would be sufficient to added the conditional statement around the part where the plaintext would be generated ? should not be a problem..
I'm not shure I'm understand correctly your proposition, but to my opinion the best way is to do the following :
- struts validator should not try to verify plaintext field (@andromda.presentation.web.view.field.type=plaintext). The best way to do this is certainly to not generate plaintext field in the "WEB-INF/validator.xml" file.
If this is not simple, the other solution, is to add conditional statement around the javascript generated code. This is done by modifying the validator-rules.xml file like done in the one I upload. Of course the first solution is the best.