by the way, i moved the displayMessage code to the manageusers.cfm and it could find displayMessage. So, it has something to do with the way I included displayMessage in the udf.cfm file.
error is below: --------------------------------------------------- Variable DISPLAYMESSAGE is undefined. The error occurred in C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\aviatio n\manageusers.cfm: line 46 44 : 45 : 46 : <cfdump var="#displayMessage()#"> 47 : 48 : ----------------------------------------- I have a udf.cfm file with 2 functioins. setMessage and displayMessage. I am trying to call displayMessage in another cfm. I have included udf.cfm in my application.cfc file. Below is a snippet: --------------------------------------- <cfcomponent> <cffunction name="onRequestStart"> <cfargument name="thisRequest" required="true"/> <!--- user defined functions ---> <cfinclude template="shared/udf.cfm"> <!---<cfinclude template="mm_wizard_application_include.cfm">---> <!--- <cfif GetAuthUser() NEQ ""> <cfoutput> <cfform action="mm_wizard_authenticate.cfc?method=logout&l oginType=#args.authLogin#" method="Post"> <cfinput type="submit" Name="Logout" value="Logout"> </cfform> </cfoutput> </cfif>---> </cffunction> </cfcomponent> ------------------------------------- I am just ...
error is below:
---------------------------------------------------
Variable DISPLAYMESSAGE is undefined.
The error occurred in
C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\aviatio n\manageusers.cfm: line 46
44 :
45 :
46 : <cfdump var="#displayMessage()#">
47 :
48 :
-----------------------------------------
I have a udf.cfm file with 2 functioins. setMessage and displayMessage. I am
trying to call displayMessage in another cfm. I have included udf.cfm in my
application.cfc file. Below is a snippet:
---------------------------------------
<cfcomponent>
<cffunction name="onRequestStart">
<cfargument name="thisRequest" required="true"/>
<!--- user defined functions --->
<cfinclude template="shared/udf.cfm">
<!---<cfinclude template="mm_wizard_application_include.cfm">--->
<!--- <cfif GetAuthUser() NEQ "">
<cfoutput>
<cfform
action="mm_wizard_authenticate.cfc?method=logout&l oginType=#args.authLogin#"
method="Post">
<cfinput type="submit" Name="Logout" value="Logout">
</cfform>
</cfoutput>
</cfif>--->
</cffunction>
</cfcomponent>
-------------------------------------
I am just trying to dump displayMessage in my manageusers.cfm. However it
cannot find displayMessage even though it is defined in udf.cfm. Below is my
udf.cfm file:
------------------------------------
<!---User-Defined Functions--->
<cffunction name="setMessage" access="public" output="false" hint="set the
error or confirm message">
<cfargument name="confirmmsg" type="string" required="True" />
<cflock timeout="10" throwontimeout="no" type="exclusive" scope="session">
<cfparam name="session.message" default="" />
<cfset session.message=confirmmsg>
</cflock>
</cffunction>
<cffunction name="displayMessage" access="public" output="True" hint="displays
error or confirm message">
<cfif isdefined("session.message")>
<cflock timeout="10" throwontimeout="no" type="readonly" scope="session">
#session.message# <br>
</cflock>
<cflock timeout="10" throwontimeout="No" type="exclusive" scope="session">
<cfset structdelete(session,"message")>
</cflock>
</cfif>
</cffunction>
----------------------------------
Am i defining the function incorrectly? I am using it like the extranet
application uses it. Thanks for any help.
by the way, i moved the displayMessage code to the manageusers.cfm and it could find displayMessage. So, it has something to do with the way I included displayMessage in the udf.cfm file.
Your displaymessage function seems to be missing a cfoutput tag.
Originally posted by: gemckay
error is below:
---------------------------------------------------
Variable DISPLAYMESSAGE is undefined.
The error occurred in
C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\aviatio n\manageusers.cfm: line 46
44 :
45 :
46 : <cfdump var="#displayMessage()#">
47 :
48 :
-----------------------------------------
I have a udf.cfm file with 2 functioins. setMessage and displayMessage. I am
trying to call displayMessage in another cfm. I have included udf.cfm in my
application.cfc file. Below is a snippet:
---------------------------------------
<cfcomponent>
<cffunction name="onRequestStart">
<cfargument name="thisRequest" required="true"/>
<!--- user defined functions --->
<cfinclude template="shared/udf.cfm">
<!---<cfinclude template="mm_wizard_application_include.cfm">--->
<!--- <cfif GetAuthUser() NEQ "">
<cfoutput>
<cfform
action="mm_wizard_authenticate.cfc?method=logout&l oginType=#args.authLogin#"
method="Post">
<cfinput type="submit" Name="Logout" value="Logout">
</cfform>
</cfoutput>
</cfif>--->
</cffunction>
</cfcomponent>
-------------------------------------
I am just trying to dump displayMessage in my manageusers.cfm. However it
cannot find displayMessage even though it is defined in udf.cfm. Below is my
udf.cfm file:
------------------------------------
<!---User-Defined Functions--->
<cffunction name="setMessage" access="public" output="false" hint="set the
error or confirm message">
<cfargument name="confirmmsg" type="string" required="True" />
<cflock timeout="10" throwontimeout="no" type="exclusive" scope="session">
<cfparam name="session.message" default="" />
<cfset session.message=confirmmsg>
</cflock>
</cffunction>
<cffunction name="displayMessage" access="public" output="True" hint="displays
error or confirm message">
<cfif isdefined("session.message")>
<cflock timeout="10" throwontimeout="no" type="readonly" scope="session">
#session.message# <br>
</cflock>
<cflock timeout="10" throwontimeout="No" type="exclusive" scope="session">
<cfset structdelete(session,"message")>
</cflock>
</cfif>
</cffunction>
----------------------------------
Am i defining the function incorrectly? I am using it like the extranet
application uses it. Thanks for any help.
you are correct about dumping displayMessage. However it is undefined and that
is the main problem. I changed the dump to this in my manageusers.cfm file.
---------------------------
<cfformitem type="HTML">
<cfoutput><span class="message">#displayMessage()#</span></cfoutput>
</cfformitem>
--------------------------
i am still getting the undefined errror. however if I put the displaymessage
funtion right above this code in my manageusers.cfm rather than making it an
include it works fine.
Just for fun, add a return true to your function and try x=displaymessager();
in your main template. Worse possible result is that it won't work, kinda what
you have now.
Originally posted by: gemckay
you are correct about dumping displayMessage. However it is undefined and
that is the main problem. I changed the dump to this in my manageusers.cfm
file.
---------------------------
<cfformitem type="HTML">
<cfoutput><span class="message">#displayMessage()#</span></cfoutput>
</cfformitem>
--------------------------
i am still getting the undefined errror. however if I put the displaymessage
funtion right above this code in my manageusers.cfm rather than making it an
include it works fine.
I'll give that a try. What's weird is that I am using code directly from the
extranet app on the getting started tutorial. It works in the tutorial of
course.(i copied and pasted it from the tutorial) However, I am thinking I
might be missing a piece. Thanks for your help on this. It is frustrating
because it is relatively simple problem.
Problem solved. The following code is what I added to my application.cfc to
get displayMessage variable to be defined. I am ned to CF so I am not sure why
this fixed it, but it did and I am grateful for your help Dan. Thanks
<cffunction name="onRequest">
<cfargument name="targetTemplate" type="String" required="true" />
<cfinclude template="#arguments.targetTemplate#">
</cffunction>
Bookmarks