From: Brad P. <br...@ro...> - 2002-09-09 23:23:50
|
Hey All, I am just getting the hang of how Modus works, so bear with my ignorance. I have some thoughts/questions about forms and content objects. I set up the test application then created my own content object called "event". The first thing I noticed was that I didn't really want to do all the checking that is done when a content object is created. Granted, some of this is due to having one page serve as a both "add" and "edit". However, I would like to be able to do something like: <cfscript> event = createObject("component","modustest.contentobjects.event").init(); if(isDefined("url.id")) { event.load(url.id); } if (event.hasErrors()) { // code to handle errors } </cfscript> <cfoutput> #event.renderBasicForm()# </cfoutput> I think the object should know if it has been POSTed and do the right thing. Is it plausible to check for form.id (or form.fieldnames) in the init function and take care of storing etc there? Also, could the id be used to know if an object exists or not? I realize that the init function is assigning the id. Could this be held off until later? Perhaps it could be set to 0 or "" in init, then it being nonzero would signify that it already existed. I am guessing much of this has been considered but thought I would through it out there anyway. Brad |