From: Nick B. <ni...@co...> - 2002-03-14 23:11:07
|
:) We're having an epistemological disconnect. If you have multiple forms that each have their own set of validation rules, but they are parts of a cardinal, logical form, it would be nice to script the validation rules for that cardinal form, thereby making that desire "larger grained". (g) Instead what we have are lots of tedious little sets of validators mapping to screens. Too fine grained. See? Incidentally, in proper MVC Model II, the controller would decide what to do with an invalid form element, making this conversation moot. > Still not sure what you mean... "less fine grained" with regard to > what? > > On Thu, 14 March 2002, "Nick Bauman" wrote: > >> >> > I see tests quizes and examinations as groups of small >> > validations... perhaps on the individual question level... at least, >> > that is how I have implemented it in the past... >> >> Right, that's how you'd do it, but I think Anthony wants something >> less fine grained but still flexible enough. >> >> > In that particular config file, are you able to reuse validators? >> >> Godd question. Not yet but that's a minor tweak to the >> ConfigSaxHandler. Next release. >> >> > >> > On Thu, 14 March 2002, "Nick Bauman" wrote: >> > >> >> >> >> Legit forms that fall into this catagory are examinations, tests >> >> and quizzes. I'm not sure I know of a good way to solve this >> >> problem right off the bat. >> >> >> >> BTW, maybe I'm just stupid, but I still think the whole config file >> >> format for FormProc is overly complex. In Integradata, a form >> >> config is this simple: >> >> >> >> <?xml version="1.0" encoding="ISO-8859-1"?> >> >> <integradata> >> >> <!-- any number of controllers can be in a config --> >> >> <controller >> >> controllerClass="com.xyz.servlet.controllers.PurchaseProduct"> >> >> >> >> <field label="nameAppearingOnCard"> >> >> <rule >> >> ruleClass="com.cortexity.integradata.rule.StringLength"> >> >> <param name="min" value="9"/> >> >> <param name="max" value="32"/> >> >> </rule> >> >> <rule ruleClass="com.cortexity.integradata.rule.WordCount"> >> >> <param name="min" value="2"/> >> >> <param name="max" value="4"/> >> >> </rule> >> >> </field> >> >> <field label="creditCardNumber"> >> >> <rule >> >> ruleClass="com.cortexity.integradata.rule.IsCreditCard"> >> >> <param name="american_express" value="true"/> >> >> <param name="visa" value="true"/> >> >> <param name="mastercard" value="true"/> >> >> </field> >> >> </controller> >> >> <!-- ... --> >> >> </integradata> >> >> >> >> Since error messages don't change that often, I think it's a >> >> mistake to put them in the config. I put them into i18n codepages. >> >> You pass a locale to the engine and the error message of the >> >> correct i18n codepage is displayed. Of course it's all aimed at >> >> MVC Model II right now. >> >> >> >> Incidentally, the concept of a "rule" is similar to FormProc's >> >> concept of a "validator". >> >> >> >> > not sure i would find this useful.. I try and keep my forms as >> >> > "stand alone" as possible.. i.e. a choice made on an earlier form >> >> > is already reflected in the rendering of the current form... and >> >> > elements that are likely to effect each other will tend to be on >> >> > the same page... >> >> > >> >> > do you have a concrete example of where you would find this >> >> > concept useful? >> >> > >> >> > On Thu, 14 March 2002, "Anthony Eden" wrote: >> >> > >> >> >> >> >> >> I was just thinking about how to handle submission of forms over >> >> >> multiple pages or multiple dialogs or screens. I am thinking of >> >> >> something along the lines of sub forms or form chunks, where the >> >> >> request could include the name of the sub form or chunk which >> >> >> should be used for the current request. Does anyone have any >> >> >> thoughts on this? Is this useful? >> >> >> >> >> >> Sincerely, >> >> >> Anthony Eden |