|
Respected Folks, I sending a request how to build this system in Mach-II
. So please if you have time then please guide me otherwise you ignore
it. My system requirements. One generic SQL query this will I use to generate thml
form to display and user can enter data into it, add ,
update action are possible requirements. So every time with different form_id and form_Name have
different elements which I will display as html form gets the data from
user’s inputs. Query results
form_id, form_Name these are fields I pass to query to get back results ElementName ElementType ElementRequired Element_id form_id form_Name Elemt1
text yes
26 2 form_client Element2 text yes 59 2 form_client Element3 checkbox Yes 64 2 form_client Element4 radio Yes 63 2 form_client Element5 text No 62 2 form_client Element6 file Yes 27 2 form_client I have one generic cffuntion who returns result . Important is we will call same query to generate
other forms as well. Now I have create a html forms (from query
result elements). That is done by cffuntion which
generate html form according to query elements type like text, checkbox, radio
box, select etc. I am just confused when I submit form, how I can check that required
elements are filled. If not return back to same form with filled value and some error
messages to guide user to filled these form fields which are required. As I am new to Mach-II I trying to get ideas to create dynamic type html
form and storing data according to element_id which
is returned from generic SQL query. How I can create a dynamic Instance from SQL query. I have a little
thought about it. <cffunction name="init"
access="public"> <cfset formInstance = structNew()/> <cfloop query="request.formElements"> <cfset formInstance.#request.elementName#
= #request.elementName# /> </cfloop> </cffunction> Then here I need to generate some getter / setter according to quey result. These are my
ideas ( I can be totally wrong in my logic), you express your best
way (logic) to achieve a solution for this. According to ( Sean A Corfield
) [ ColdFusion's
introspection to build fully dynamic CFC persistence is a dead end! ] Sean I can bet you have more better idea how
to deal with it rather than using CFC persistence I would like your ideas about it, how can I build like this system in
Mach-II. |
