I see one mistake at a quick glance: <cfproperty name="teststruct" type="struct" default="StructNew()"> Should be
<cfproperty name="teststruct" type="struct" default="#StructNew()#"> Taco Fleur Tell me and I will forget Show me and I will remember Teach me and I will learn > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Barry Beattie > Sent: Thursday, 8 April 2004 5:19 PM > To: CFAussie Mailing List > Subject: [cfaussie] CFC propert struct error > > > hi all > > I'm obviously not calling the struct correctly in the CFC: > "Element OBJAPP is undefined in APPLICATION" but this happens > only when I try to access the object struct values. > > ...and I gotta get it working or no easter bunny for me! > > can anyone see what have I missed? > > cheers > barry.b > > > > test page: > ========== > <hr> > <cfoutput>#application.objApp.testval#</cfoutput> > <hr> > <hr><!--- it errors here on either of these calls ---> > <cfoutput>#application.objApp.teststruct.value1#</cfoutput><br> > <cfoutput>#application.objApp.teststruct.value2#</cfoutput> > <hr> > > > Application.cfm (used to persist object - needed) > ===================================================== > <cfapplication name="testcomps"> > > <cfif not isDefined("application.objApp")> > <cfset application.objApp = createObject("component","test")> > <cfset OK = application.objApp.init()> > </cfif> > > > > app.cfc: > ======== > <cfcomponent> > <cfproperty name="testval" type="string"> > <cfproperty name="teststruct" type="struct" > default="StructNew()"> > <cfproperty name="teststruct.value1" type="string" default=""> > <cfproperty name="teststruct.value2" type="string" default=""> > > <cffunction name="init" access="public" output="No"> > <cfset this.testval = "hello world"> > <cfset this.teststruct.value1 = "fido was here"> > <cfset this.teststruct.value2 = "and here"> > </cffunction> > > </cfcomponent> > > > > > --- > You are currently subscribed to cfaussie as: > [EMAIL PROTECTED] To unsubscribe send a blank email to > [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
