Jamie: using your method, how do you validate (JS) logic between form elements?
eg: if this checkbox is ticked and that textbox has a valid value, set a hidden form value - or - calculations using multiple form elements (like an order form with subtotal and order totals with GST, etc). - or - dual input select boxes ...etc sounds like your simple controls would turn into composite controls which would have to be custom built anyway. doesn't sound really flexable. why not use custom tags as a taglib? all the best web languages are doing it (JSP, ASP.NET, etc) take the encapsulation a step further and create UI objects. Ever done any VB form building? want the web as easy? use taglibs and create UI "objects" just a thought barry.b -----Original Message----- From: Jamie Lawrence Jenner [mailto:[EMAIL PROTECTED] Sent: Thursday, 29 July 2004 11:35 AM To: CFAussie Mailing List Subject: [cfaussie] RE: the big oo train, on the right track? gareth The method i have now finished, uses cfcs to output the form field. the cfc is in the application scope, and when i want a form field i use the following, and pass it the type and the relevant arguments for that element #application.elementbuilder.basicElement(type="text",name="address2",ID= "Addess2",ClassName="maintext",Size="",Maxlength="50",value="")# #application.elementbuilder.basicElement(type="checkbox",name="check1",I D="check1",ClassName="formelements",value="terms")# and for selectors #application.formbuilder.selectElement("DOBDay","Date of birth",IDList="01,02,03,04,05",ValuesList="a,b,c,d,e")# the cfc then returns the html needed for the field. it will output any form field you give it (using the type argument) by using a switch Using this method i can have whatever form fields, by whatever name, with whatever attributes but still use the same cfc and not have to add to it. Taco, by using your method, if you needed a field for say chickens, would you have to add to the xml file a new object called chicken? Ive binned the prefix for validation, and instead, i pass an xml string with the form, <string> <element>name<element> <element>address<element> <string> <numeric> <element>phone<element> </numeric> <whateverelse> This then refrences the relevant form fields and passes them to the validation obj, which if there is a fault, creates the errorobj I suppose this is one of those things for which their is no right or wrong way. I do prefer to write things like this myself though cos thats what i do! chow jamo > We are currently going down the track of building custom tag library's > > Is it o.k to make a cfc create the form element for you? > > Would the xml file contain data such as status bar information and = > clientside validation? > > Gareth. > > -----Original Message----- > From: Jamie Lawrence Jenner [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 28 July 2004 10:26 PM > To: CFAussie Mailing List > Subject: [cfaussie] RE: the big oo train, on the right track? > > > taco said > > Centralized data validation is certainly a good idea, but I would = > store the > > meta data for the fields in a XML file instead of defining it by a = > prefix. > > the validation obj will be accessible by all forms across many sites.=20 > > So do you mean that each form from each site should also pass an xml > string detailing which field needs what validation? If not, what do you > mean exactly? > > if i can do without the prefix it will make my life easier > > >I don't think all your objects should go into one CFC, the error.cfc > should > >handle all errors and not just those for your form, so that should be a > CFC > >on its own IMHO > > It will, but ive only just started out! I am hoping to have a global = > error > object, form object, validation object, and ive also thought about doing = > a > global DAO. any others i could implement? your views > > greg said > >My understanding is that there is still some way to go > >before you could even start considering cfml an OO language=20 > > oh yes, i agree, but i thought that there may have been more emphasis on > teaching the benefits of oop and what can be done in cf so far (thus i > could have concentrated on these methods from the start). joined the > various lists you suggested, tuned brain to sponge mode and off i go! > > cheers for the info guys > > jamo > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to = > [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
