XPages - The Good, The Bad and the UGLY - XIV
I am presently spending a lot of my time back in Xpage school developing real-life Xpage functionaility. So I can again share with you some of my thoughts based upon my latest experiences learning this new technology. . The Good: Validation - Yet another of the really cool capabilities Xpages bring to NSF development is a range of new options for validating fields. Most controls have a validation section which allows you to set a property to mark that a field is required. As with most properties of an Xpage, this can be enabled via a formula to conditionally determine when it is required. Depending on the display type of the data (text, date/time, number) it is also possible to specify additional validation checks. For strings this includes minimum and maximum lengths. For dates, that the date lies within a specified range. For attachments you can specify MIME types allowed (or not allowed). Underlying this are a series nine different alidators that can be coded directly to do all of this plus a whole lot more. In short there seems to be a a way to perform every form of validation possible. Tied with the validtors are two error controls you can add to your Xpage. This can be a single control that displays all validation errors, one control for each field being validated, or almost anywhere in between. . The Bad: Invalid Invalidation
- So in theory we have almost everything we could dream of for validating fields right? In practice however Xpage validation falls short of it potential. It seems that there is currently no way to control when the validators are invoked. The validation seems to get invoked each and every time the page refreshes. This typically causes validation errors to be triggered before they are wanted. There is a "No data validation" options but this seems to turn off a whole lot more than just the validators (e.g. updating the data!). To get around this, as pointed out in the Domino Designer wiki, it seems you must create your own validation code using JS (client sided validation)t or SSJS (server sided validation). So that leaves you back to not being able to use all that great validation stuff Xpages gives you - except when using VERY simple forms. . The Ugly: Documentation - Not the first time i have mentioned this, but the on-line Help sucks. On validation I get inciteful comments such as "Show Error details - to show the error details" and "Show Error summary - to show a summary of the errors" without any explanation or examples of what the difference between the two is. Detailed explanations of the nine validators - if they are there they are well hidden. Detailed explanation of the "No data validation" - No. Any mention at all about "No data validation" - No. Any explanation about the validation cycle - No. IBM probably would have been better served if they linked their help menu in Xpages to google's search page as that seems to be the only way to find help about validation (and almost anything else in Xpages).
|
Ratings
0
|
Comments (1)
This is one that really had me frustrated and I thought it would be fixed in 8.5.1. The validation could be so awesome but as it is it is completely worthless.