------------------------------------- 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: ------------------------------------ #session.message#
---------------------------------- Am i defining the function incorrectly? I am using it like the extranet application uses it. Thanks for any help. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => gemckay [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> ------------------------------------- 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: ------------------------------------ #session.message#
---------------------------------- Am i defining the function incorrectly? I am using it like the extranet application uses it. Thanks for any help. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Dan [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> variable undefined in udf.cfm - Coldfusion - Advanced Techniques

variable undefined in udf.cfm - Coldfusion - Advanced Techniques

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 ...

  1. #1

    Default variable undefined in udf.cfm

    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.

    gemckay Guest

  2. #2

    Default Re: variable undefined in udf.cfm

    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.
    gemckay Guest

  3. #3

    Default Re: variable undefined in udf.cfm

    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.



    Dan Guest

  4. #4

    Default Re: variable undefined in udf.cfm

    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.

    gemckay Guest

  5. #5

    Default Re: variable undefined in udf.cfm

    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.



    Dan Guest

  6. #6

    Default Re: variable undefined in udf.cfm

    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.

    gemckay Guest

  7. #7

    Default Re: variable undefined in udf.cfm

    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>

    gemckay Guest

Similar Threads

  1. Undefined Variable
    By Merrye in forum Macromedia Flash Actionscript
    Replies: 7
    Last Post: January 13th, 09:22 PM
  2. variable undefined
    By bina. r webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 13th, 01:01 PM
  3. [PHP] undefined variable
    By Viraj Kalinga Abayarathna in forum PHP Development
    Replies: 0
    Last Post: August 29th, 09:13 AM
  4. #22367 [Csd]: undefined variable has a value
    By stanislav dot chachkov at epfl dot ch in forum PHP Development
    Replies: 0
    Last Post: August 26th, 02:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •