XPages: Validation for Radio Buttons, Check Boxes and List Boxes: Part Four

Home » XPages: Validation for Radio Buttons, Check Boxes and List Boxes: Part Four

Update

I’ve now got everything working, got answers to my last blog post, and worked out the various Domino version differences affecting this all. So before I continue with Option 3 and Option 4, here’s an update on where we are.

Option 1 used the out-of-the-box server-side validation for radio buttons, check boxes and multi-value list boxes. This was ok, but in 8.5.0 any custom validation error message you entered for these controls was not rendered to the user. I’m pleased to say this is resolved for 8.5.1.

Option 2 used an extension to the RequiredValidator function to alert of any fields not filled in. This uses client-side validation, reproducing the basic client-side validation, but avoiding the error caused by e.select() in this.validationError() function. However, testing with 8.5.1 showed this doesn’t work. Big thanks to Paul Hannan at IBM for proactively picking this up and progressing it on my behalf. This is a problem specific for 8.5.1, logged under SPR Reference TMON7X3ER8.

For 8.5 I had extended this to validate with client-side javascript, adding background shading and a dojo tooltip to alert the user of the error, as you would have seen on the original demo. This is Option 3, the next instalment in Part 5. Again, this didn’t work in 8.5.1.

When I first started writing this up a few weeks ago, I had a rather complex solution that used server-side javascript validation and viewScopes, but still added background shading and a dojo tooltip to alert the user. However, when reviewing testing for a customer, I identified an issue setting the viewScopes that I initially couldn’t overcome (which is why I developed Option 3). But thanks to an article on the XPages Blog, again by Paul Hannan, I realised in the last few days that it must be user error, and that I should be able to get it working. So Option 4, to follow in Part 6, is now the option implemented and has been updated in the original demo.

So now I’ve completed everything, the annotated sample database is attached. Parts 5 and 6 will follow shortly, where I’ll walk through the approach and the code, but the eager ones amongst you can download it and hopefully work your way through understanding it.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top