scaffold propertylist optional attribute

5 views
Skip to first unread message

Chuck Savage

unread,
Dec 22, 2009, 6:41:11 PM12/22/09
to model-glue
I'm trying to use propertylist, but its throwing me an error.

These are the fields to my table, and I've supplied them to my
scaffold tag like this,

propertylist="id,invoice_number,date,userId,addressId,comment"

should I be doing it differently?

Dan Wilson

unread,
Dec 23, 2009, 8:09:39 AM12/23/09
to model...@googlegroups.com
chuck, I think I missed the error message in your email. Would you please be more specific on which error you got?


DW

--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en



--
“Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew.”

Guillaume Apollinaire quotes

Chuck Savage

unread,
Dec 23, 2009, 5:07:11 PM12/23/09
to model...@googlegroups.com
Dan here's my two scaffolds for the table,

<scaffold object="invoice"
                    type="list,edit,view"
          event-type="Admin,Sidebar,MainTemplate"
      propertylist="id,invoice_number,date,userId,addressId,comment"
          /> 
<scaffold object="invoice"
                    type="commit,delete" event-type="Admin"
          /> 
I don't think I need property list in either commit or delete, so it isn't a part of it.

Here's the error.

Message Element userId is undefined in a CFML structure referenced as part of an expression.
Detail
Extended Info
Tag Context C:\Websites\157900dq4\mg\config\scaffolds\views\BD952F44-9BBD-4746-B790A3B782A0BE4E.cfm (16)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\modules\scaffold\ScaffoldManager.cfc (333)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\modules\scaffold\ScaffoldManager.cfc (61)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\module\XMLModuleLoader.cfc (522)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\module\XMLModuleLoader.cfc (74)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\module\XMLModuleLoader.cfc (92)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\modules\internal\configuration\controller\ConfigurationController.cfc (21)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\eventrequest\EventContext.cfc (298)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\eventrequest\EventContext.cfc (225)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\eventrequest\phase\Configuration.cfc (27)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\eventrequest\EventContext.cfc (155)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\ModelGlue.cfc (215)
C:\Websites\157900dq4\Frameworks\ModelGlue\gesture\ModelGlue.cfm (58)
C:\Websites\157900dq4\mg\index.cfm (49)

But userId is a part of the table, and the scaffolds work if I remove the  propertylist line.
--
Chuck Savage
http://SeaRisen.com

Dan Wilson

unread,
Dec 23, 2009, 5:11:25 PM12/23/09
to model...@googlegroups.com
go ahead and take a look at the output here:

C:\Websites\157900dq4\mg\config\scaffolds\views\BD952F44-9BBD-4746-B790A3B782A0BE4E.cfm (


can you see what the issue is? Possibly on line 16 or thereabouts?


DW

--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
 
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Chuck Savage

unread,
Dec 23, 2009, 5:45:24 PM12/23/09
to model...@googlegroups.com
Here's the cut and paste of that file.

<cfoutput>
!!START_CF_TAG!!cfsilent!!END_CF_TAG!!
    !!START_CF_TAG!!cfset event.copyToScope( variables, "id,invoiceQuery,myself,xe.delete,xe.edit,xe.list,xe.view" )/!!END_CF_TAG!!
    !!START_CF_TAG!!cfset variables.deleteEvent = myself & xe.delete  /!!END_CF_TAG!!
    !!START_CF_TAG!!cfset variables.editEvent = myself & xe.edit  /!!END_CF_TAG!!
    !!START_CF_TAG!!cfset variables.listEvent = myself & xe.list  /!!END_CF_TAG!!
    !!START_CF_TAG!!cfset variables.viewEvent = myself & xe.view  /!!END_CF_TAG!!
!!START_CF_TAG!!/cfsilent!!END_CF_TAG!!
!!START_CF_TAG!!cfoutput!!END_CF_TAG!!
!!START_CF_TAG!!div id="breadcrumb"!!END_CF_TAG!!!!START_CF_TAG!!a href="!!CFVariableString!!listEvent!!CFVariableString!!"!!END_CF_TAG!!#spaceCap( Metadata.alias )#!!START_CF_TAG!!/a!!END_CF_TAG!!!!START_CF_TAG!!/div!!END_CF_TAG!!
!!START_CF_TAG!!br /!!END_CF_TAG!!
!!START_CF_TAG!!table!!END_CF_TAG!!
    !!START_CF_TAG!!tr!!END_CF_TAG!!
     <cfloop list="#Metadata.orderedPropertyList#"  index="variables.thisProp">
         <cfif listFindNoCase(Metadata.primaryKeyList , thisProp) IS false AND Metadata.properties[thisProp].relationship IS false >
             !!START_CF_TAG!!th!!END_CF_TAG!!#spaceCap(thisProp)#!!START_CF_TAG!!/th!!END_CF_TAG!!
        </cfif>
    </cfloop>
        !!START_CF_TAG!!th!!END_CF_TAG!!&nbsp;!!START_CF_TAG!!/th!!END_CF_TAG!!   
        !!START_CF_TAG!!th!!END_CF_TAG!!&nbsp;!!START_CF_TAG!!/th!!END_CF_TAG!!   
    !!START_CF_TAG!!/tr!!END_CF_TAG!!
    !!START_CF_TAG!!cfloop query="#Metadata.alias#Query"!!END_CF_TAG!!
        !!START_CF_TAG!!tr!!END_CF_TAG!!   
    <cfloop list="#Metadata.orderedPropertyList#"  index="variables.thisProp">
        <cfif listFindNoCase( Metadata.primaryKeyList, thisProp ) IS false AND Metadata.properties[thisProp].relationship IS false >
            !!START_CF_TAG!!td!!END_CF_TAG!!!!START_CF_TAG!!a href="!!CFVariableString!!viewEvent!!CFVariableString!!#makeQuerySourcedPrimaryKeyURLString( Metadata.alias, Metadata.primaryKeyList )#"!!END_CF_TAG!!!!CFVariableString!!#Metadata.alias#Query.#thisProp#!!CFVariableString!!!!START_CF_TAG!!/a!!END_CF_TAG!!!!START_CF_TAG!!/td!!END_CF_TAG!!
        </cfif>
    </cfloop>
            !!START_CF_TAG!!td!!END_CF_TAG!!!!START_CF_TAG!!a href="!!CFVariableString!!editEvent!!CFVariableString!!#makeQuerySourcedPrimaryKeyURLString( Metadata.alias, Metadata.primaryKeyList )#"!!END_CF_TAG!!Edit!!START_CF_TAG!!/a!!END_CF_TAG!!!!START_CF_TAG!!/td!!END_CF_TAG!!
            !!START_CF_TAG!!td!!END_CF_TAG!!!!START_CF_TAG!!a href="!!CFVariableString!!deleteEvent!!CFVariableString!!#makeQuerySourcedPrimaryKeyURLString( Metadata.alias, Metadata.primaryKeyList )#"!!END_CF_TAG!!Delete!!START_CF_TAG!!/a!!END_CF_TAG!!!!START_CF_TAG!!/td!!END_CF_TAG!!
        !!START_CF_TAG!!/tr!!END_CF_TAG!!
    !!START_CF_TAG!!/cfloop!!END_CF_TAG!!
!!START_CF_TAG!!/table!!END_CF_TAG!!
!!START_CF_TAG!!/div!!END_CF_TAG!!
!!START_CF_TAG!!/cfoutput!!END_CF_TAG!!
</cfoutput>

Chuck Savage

unread,
Dec 23, 2009, 5:47:43 PM12/23/09
to model...@googlegroups.com
Line 16 is the first line in the cfloop, this line


<cfif listFindNoCase(Metadata.primaryKeyList , thisProp) IS false AND Metadata.properties[thisProp].relationship IS false >

Dennis Clark

unread,
Dec 23, 2009, 6:36:06 PM12/23/09
to model...@googlegroups.com
The names "userId" and "addressId" look like the names of linking columns for many-to-one relationships. If so, try replacing the column names with their corresponding relationship names ("user" and "address" perhaps?) and see what happens.

-- Dennis

--
Reply all
Reply to author
Forward
0 new messages