|
5.5 How to Validate Page Data Dataview fields may have constraints added to them. If validation takes place, data must fulfil these constraint criteria. Attributes may also have constraints added and if the field is backed by an attribute, the data must fulfil both sets of constraint criteria. By default pages allow validation. This can be suppressed by setting the validate property to novalidate. Events work the other way and by default they do not validate, you need to set the validate property to validate. Alternatively update and create styled events always validate. If validation is suppressed at the page level and the data is passed back to the dataview to be sent to the database, validation will occur automatically against the constraints. This is not as good for the user as validating at page level for two reasons. First, when the page validates the data, it validates all fields against all criteria. If more than one constraint is violated, all the errors are reported back to the user, whereas if the dataview or the entity are allowed to process the data, the first error will be sent back to the page and only that error will be shown. Second the error message sent back from the application server is wrapped up with extra information, that isn't as user friendly. By and large, if you want to validate page data you should set the style of the event to update or create, or you should set validate. Links:
Copyright © 2001-2006 New Technology / enterprise Ltd. | |||||||||||||||||||||