From: <ndi...@us...> - 2002-10-03 05:45:22
|
Update of /cvsroot/modus/org/bacfug/modus/form In directory usw-pr-cvs1:/tmp/cvs-serv21118/bacfug/modus/form Modified Files: formfieldfactory.cfc Log Message: had the damndest time trying to figure out why the newSelectOption method was having a null pointer error. Turns out it has something to do with having the formFieldFactory in the server scope. Not sure why, but that is fixed now. So, this is not actually any different, but has been rearranged slightly. Index: formfieldfactory.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/form/formfieldfactory.cfc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** formfieldfactory.cfc 30 Sep 2002 22:48:09 -0000 1.4 --- formfieldfactory.cfc 3 Oct 2002 05:45:19 -0000 1.5 *************** *** 1,4 **** --- 1,6 ---- <cfcomponent displayname="formFieldFactory" hint="This component can create all kinds of HTML form fields"> + <cfparam name="instance" default="#structNew()#"> + <!--- an init method ---> <cffunction name="init" access="public" output="no" returnType="org.bacfug.modus.form.formFieldFactory" hint="an initialization method"> *************** *** 37,40 **** --- 39,50 ---- <cfreturn toReturn> </cffunction> + + <!--- a method to make a struct to make a select option ---> + <cffunction name="newSelectOption" access="public" output="no" returnType="struct" hint="A quick way to make the data object necessary to pass to a SELECT box"> + <cfargument name="value" required="yes" type="variableName"> + <cfargument name="label" required="no" type="string" default="#arguments.value#"> + <cfreturn arguments> + </cffunction> + <!--- make a select field ---> <cffunction name="makeSelect" access="public" output="no" returnType="string" hint="makes a SELECT field"> *************** *** 54,57 **** --- 64,68 ---- <cfreturn toReturn> </cffunction> + <!--- make a select option ---> <cffunction name="makeSelectOption" access="public" output="no" returnType="string" hint="makes an OPTION field"> *************** *** 67,76 **** </cfscript> <cfreturn toReturn> ! </cffunction> ! <cffunction name="newSelectOption" access="public" output="no" returnType="struct" hint="Used mostly internally to create option structs to pass to a select"> ! <cfargument name="value" required="yes" type="string"> ! <cfargument name="label" required="yes" type="string" default="#arguments.value#"> ! <cfreturn duplicate(arguments)> ! </cffunction> <!--- make a checkbox ---> <cffunction name="makeCheckbox" access="public" output="no" returntype="string" hint="makes a checkbox"> --- 78,83 ---- </cfscript> <cfreturn toReturn> ! </cffunction> ! <!--- make a checkbox ---> <cffunction name="makeCheckbox" access="public" output="no" returntype="string" hint="makes a checkbox"> *************** *** 91,94 **** <cfargument name="name" required="yes" type="variableName"> <cfreturn "<input type=""file"" name=""" & arguments.name & """>"> ! </cffunction> </cfcomponent> --- 98,102 ---- <cfargument name="name" required="yes" type="variableName"> <cfreturn "<input type=""file"" name=""" & arguments.name & """>"> ! </cffunction> ! </cfcomponent> |