Posts Tagged ‘Validation Tutorial’

04
Nov

Option Four Option Four seems quite convoluted, but is essentially a simple principle. We use server-side javascript in the beforePageLoad event to set viewScope variables for each of the radio button, check box and list box mandatory questions we want to check against. We then use the onClick event to trigger a partial refresh and clear the viewScope variables. Our validation again uses server-side javascript to check the viewScope variable, and set a second viewScope variable if validation fails. We then set the styling of a div based on this second viewScope variable. A few basic points to note. The beforeRenderResponse event ...

03
Nov

Option Three is a modification of Option Two, which reproduced the client-side validation available for other XPages controls, with a javascript alert. At this point I should add some background to the application I was working on. The application in question is a major upgrade of our enterprise feedback tool, EFT, which added in Dojo styling, used NotesView2. I had already developed much of the application using classic notes web development and dojo before I attended an XPages course, but I took the opportunity to remove the agent that generated HTML on the fly for the survey response ...

29
Oct

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 ...

15
Oct

XPages: Validation for Radio Buttons – 8.5.1 Issue

 First of all, apologies for not making further progress on the validation tutorials. Prior to a customer meeting, I was doing a final review of the mixture of client-side and server-side validation I implemented, and found problems. It looks like 8.5.1 may be able to address this, so watch this space. So as a fall-back I used a modified version of Option 2. This worked fine. I had set this up as Option 3 and was getting ready to post that up. But when I checked that code after upgrading my server to 8.5.1, not only did that stop working, but ...

21
Sep

 In Part One we saw that the XSP.attachValidator function threw a javascript error, and that adding a required validator does not allow you to customise the message. However, with a little bit of scripting it is still possible to use XSP.attachValidator. Option Two: Add Scripted Validators First, a couple of basics. Whereas the required validator uses server-side javascript, XSP.attachValidator uses client-side javascript functions in xspClientDojo.js. You will find this as part of your installation in dominojsdojo-1.1.1ibmxspwidgetlayout. For more information on client dojo, see the Domino Designer wiki, which also taught me the techniques I use here to extend the functions. So our XPage ...