So, I got it now working so far. The missing JS msgbox was a JS-error problem. In my resource bundle I used quotes around the fieldname and they won't be escaped so this broke the JS. Using " or " didn't work either because it won't be translated in the msgbox :(. So ' and " aren't an option. Not so nice that it can't handle the encoding properly.
Another thing is, that the JS doesn't check the required flag on selectboxes. So this will only be handled on server-side validation - also not so nice presenting the user two different error msg "styles". So, after I've got it "working" I must admit that this won't be an option for me anymore. All the points are no go's for me. Perhaps I will take a look at: http://jsf-comp.sourceforge.net/components/clientvalidators/index.html or http://wiki.apache.org/myfaces/OptionalValidationFramework which seem to be more integrated into jsf. But I will have separate view/business logic validations then :(. Thanks so far. regards, Veit Veit Guna schrieb: > David Geary schrieb: >> 2006/11/25, Veit Guna <[EMAIL PROTECTED]>: >>> Now the validation takes place and the JS gets rendered into the page. >>> Something with the validation msg looks strange, >> >> What does it look like? > > The problem was, that I put a EL resource-bundle reference to the arg > parameter of the commonsValidator that pointed to the error msg key in > my resource bundle. I thought this parameter is used for the error msg - > so it can be customized. So the raw msg of my RB was inserted in the > default shale error msg as {0} - that looked strange ;). Didn't find > documentation about that. > > BTW: why do I have to pass the label explicit by the arg parameter to > the validator? The information is already in the component tree. It > could take it from there?! If I leave it out, (null) is shown for the > label in the error msg. Another strange things is, I mixed on a form > commonsValidator with std. JSF validators. Now the problem arises, that > shale allows only ONE error msg. Not separate summary and detail msgs as > JSF offers. Now when the form gets validated I get in h:messages the > summary plus the detail for jsf validators and from the commonsValidator > just ONE msg. That looks odd. So there is the same msg for h:message and > h:messages when using commonsValidator. Could that be optimized? > > >> but I'll figure that >>> out. Also I expected a msgbox to appear due to JS client verification?! >> Yes. If you specify client="true", you should see a JS alert if you have JS >> turned on; otherwise, the validation will be performed on the server. > > Thats the second strange thing. As I mentioned before I mix both > validators - jsf and commmonsValidator. I've set client and server to > true. But there's no JS msgbox concerning the required field when > sending it. There's just a "normal" msg, like for the other jsf > validators. I got _once_ a msgbox - I don't know why. But then even the > msg was not I18N style - the german umlaut got rendered as some html > encoding - can't remember exactly. Is there a problem mixing both > validation methods in one form? I expected JS validation first with a > msgbox, after that the server validation of the other jsf validator fields. > > Any hints? > > regards, > Veit >
