0 Replies Latest reply on May 15, 2006 9:01 AM by mynewnameforthisforum

    Why is CFGrid not working for me

    mynewnameforthisforum
      Why is this not working for me?

      This is Gridtest1.cfm

      <cfoutput>

      <CFFORM align="center" ACTION="gridtest2.cfm" METHOD="POST" name="getstuff" >
      <cfinput type="HIDDEN" name="ID" value="#form.id#" >
      <cfinput type="HIDDEN" name="customerno" value="#form.customerno#" >

      <cfgrid name="Mygrid" width="960" query="getpermits" gridlines = "yes" rowheaders="yes"
      selectmode = "edit" height="350" >
      <cfgridcolumn name="id" bgcolor="##FFFFFF" header="ID" display="yes" WIDTH="40" select="no">
      <cfgridcolumn name="permitno" bgcolor="##FFFFFF" header="Permit No" display="yes" width="70" select="yes">
      <cfgridcolumn name="sortorder" bgcolor="##FFFFFF" header="SortOrder" display="yes" WIDTH="62" select="yes">
      </cfgrid>

      <div align="center">
      <cfINPUT TYPE="submit" VALUE="Save My Changes" NAME="savemychanges" >
      </div>
      </cfform>
      </cfoutput>

      This is GridTest2.cfm
      Form fields: <cfoutput>[#form.fieldnames#]</cfoutput>
      Form values:
      <cfloop list="#form.fieldnames#" index="idx"><cfoutput>#idx# = #Evaluate(idx)#</cfoutput>
      </cfloop>

      <cfif isdefined ("form.savemychanges")>
      <cfgridupdate grid="mygrid" datasource = "divwt" tablename = "tankerpermits" keyonly="yes" >
      </cfif>


      <cfoutput>
      form.#__CFGRID__GETSTUFF__MYGRID#.original.#permitno#
      </cfoutput>


      Output from TestGrid2.cfm reflects a “funny looking” grid name and I can see in the output that Permitno is definitely a defined field.



      Form fields: [ID,CUSTOMERNO,SAVEMYCHANGES,__CFGRID__GETSTUFF__MYGRID]
      Form values:
      ID = 13
      CUSTOMERNO = 21691
      SAVEMYCHANGES = Save My Changes
      __CFGRID__GETSTUFF__MYGRID = __CFGRID__EDIT__=3 id N Permitno Y sortorder Y 1 U 571 z




      Element __CFGRID__GETSTUFF__MYGRID.ORIGINAL.PERMITNO is undefined in FORM.


      The error occurred in C:\cmudintranet\Purple\divwt\bftankertruck\gridtest2.cfm: line 147
      #form.__CFGRID__GETSTUFF__MYGRID.original.permitno#