From: Eric C. <ecr...@us...> - 2006-09-25 19:17:20
|
User: ecrutchfield Date: 06/09/25 12:17:18 Modified: andromda-aspdotnet/src/site/axdoc howto11.xml Log: updated to reflect current Validation implementation Revision Changes Path 1.2 +23 -20 cartridges/andromda-aspdotnet/src/site/axdoc/howto11.xml Index: howto11.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/site/axdoc/howto11.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- howto11.xml 17 Sep 2006 17:31:53 -0000 1.1 +++ howto11.xml 25 Sep 2006 19:17:18 -0000 1.2 @@ -10,36 +10,39 @@ <body> <section name="Input Validation"> <p> - By default the cartridge generates client-side and server-side validation code. On the - client side this is implemented using Javascript, rendered dynamically into the JSP - pages by the <![CDATA[<html:javascript ... />]]> struts tag. + The aspdotnet cartridge generates Validator controls when validation is specified in your model. + Different types of validation exist and, depending on how you model your application, + different validation routines will be activated. For example, fields on a form can be marked as + required, numeric input fields can be checked to make sure they are valid numbers, numbers can + be checked to make sure they fall within a certain range, and regular expressions can be matched. + <em>Please note that more than one validator tagged value can be added to an event parameter.</em> </p> <p> - The server-side code is perfectly equivalent to the validation on the client-side. Client-side - validation is interesting because it can warn the user of errors without having to go to the server - (which can take time and resources), server-side validation is a safety net that will guarantee - input fields are present or properly formatted. + For required fields, you'll mark parameters coming out of a <![CDATA[<<FrontEndView>>]]> + with the <a href="profile.html#@andromda.presentation.view.field.required">@andromda.presentation.view.field.required</a> + tagged-value. </p> <p> - Client-side and/or server-side validation can be enabled or disabled using the - <code>clientValidation</code> and <code>serverValidation</code> - <a href="namespace.html">namespace properties</a> respectively. + To check the format of a parameter, you can apply the + <a href="profile.html#@andromda.presentation.view.field.required">@andromda.presentation.view.field.format</a> + tagged-value. Check the table at the bottom of the <a href="profile.html">Profile</a> page to learn + what's possible. </p> <p> - Different types of validation exist and depending on how you model your application - different validation routines will be activated. For example, numeric input fields - will be checked, email addresses will be checked for valid format, URLs must be well-formed, - input needs to be in a certain range, creditcard numbers must pass the - <a href="http://www.beachnet.com/~hstiles/cardtype.html">Luhn</a> check, .. even regular expressions - can be matched. + You can compare the value of one parameter to another using the + <a href="profile.html#@andromda.presentation.web.view.field.validwhen">@andromda.presentation.web.view.field.validwhen</a> + tagged-value. Placing this tagged-value on a parameter will render a CompareValidator and + set the ControlToCompare property based on the value you provide. For example, to check that + the password and confirmPassword fields match, you could add a <em>validWhen</em> tagged-value to + the password field and set it's value to '== confirmPassword'. </p> <p> - Check the table at the bottom of the <a href="profile.html">Profile</a> page to learn - what's possible. <em>Please note that more than one validator tagged value can be added to an - event parameter.</em> + Note: The <a href="profile.html#@andromda.presentation.web.view.field.validwhen">@andromda.presentation.web.view.field.validwhen</a> + tagged-value can also be used to compare a parameter to a value. For example, you could specify that + the age field must be greater than or equal to 18 (>= 18). </p> <p> - Adding your own validator is simple, you can specify the validator's name so it will be checked + <font color="red">[Not yet implemented]</font> Adding your own validator is simple, you can specify the validator's name so it will be checked if you just make sure your validator has been added to the <code>validator-rules.xml</code> file. To do this make use of the <![CDATA[<!-- validator-rules merge-point -->]]> <a href="../andromda-cartridges/index.html#mergeMappingsUri">merge point</a>. |