RE: Mach-II client variables
I have realized that I am having a problem with client variables, but I don't know why. I get this message when I try to set a client variable: Message: The requested scope client has not been enabled. Details: Before client variables can be used, the client state management system must be enabled using the CFAPPLICATION tag. However, I do have the clientmanagement=yes attribute set in the CFAPPLICATION tag. What am I doing wrong? Is there anything I should be checking on the server? Matthew Small Web Developer American City Business Journals 704-973-1045 [EMAIL PROTECTED] -Original Message- From: Matthew Small [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 28, 2004 8:52 AM To: CF-Talk Subject: Mach-II client variables Question for the Mach-II people on this list - I have a dropdown box that appears on every page, in its own form on each page of my small application. I'd like the most recently selected item on this dropdown box to be selected whenever I move to a new page view. I can set a variable that holds the last value selected whenever the dropdown is changed, but when I move to a view that does not pass the dropdown box into the form scope, I lose the most recently selected value and it moves to the default value on the next view. I tried placing the MRU value into both session and client variables, and enabling client and session variables in the CFApplication tag, but I just got an error. Also, the most logical place for me to put an assignment for this variable is in a CFC, but I see that Mr. Corfield does not recommend doing this: It's not that CFCs cannot access scope variables, just that they should not in general (since it breaks encapsulation). The general approach is to create a CFC whose sole job is to 'wrap' the scope access so as to hide it from the rest of the app. http://lists.topica.com/lists/mach-ii-coldfusion/read/message.html?mid=81031 3532sort=dstart=2193 So where/how can I create a variable that persists this information? Thank you, Matthew Small Web Developer American City Business Journals 704-973-1045 [EMAIL PROTECTED] ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188853 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Mach-II client variables
From: Matthew Small [mailto:[EMAIL PROTECTED] Before client variables can be used, the client state management system must be enabled using the CFAPPLICATION tag. You need to set the location for storing the client vars.. http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pa3.htm#wp10 97308 You need to set the clientStorage attribute in the cfapplication tag. HTH, Mike ~| Special thanks to the CF Community Suite Silver Sponsor - New Atlanta http://www.newatlanta.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188854 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Mach-II client variables
Thanks, but I've already tried that and it didn't do anything for me. Here is the present content of my CFAPPLICATION tag: cfapplication name=mrktPromoTool sessionmanagement=yes clientmanagement=yes clientStorage = cookie setClientCookies=yes/ I've also had the clientStorage and setClientCookies attributes removes and that does not help. I'm using CFMX 6.1 if that's of any use. Here is the offending line of code: cfparam name=client.currentMarket default=0 What am I doing wrong? Matthew Small Web Developer American City Business Journals 704-973-1045 [EMAIL PROTECTED] -Original Message- From: Tangorre, Michael [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 28, 2004 10:09 AM To: CF-Talk Subject: RE: Mach-II client variables From: Matthew Small [mailto:[EMAIL PROTECTED] Before client variables can be used, the client state management system must be enabled using the CFAPPLICATION tag. You need to set the location for storing the client vars.. http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pa3.htm#wp10 97308 You need to set the clientStorage attribute in the cfapplication tag. HTH, Mike ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188855 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Mach-II client variables
I tried placing the MRU value into both session and client variables, and enabling client and session variables in the CFApplication tag, but I just got an error. As Mike Tangorre mentioned, if you want to use Client variables you will need to specify where Client variables will be stored. You can either do this using the CLIENTSTORAGE attribute of the CFAPPLICATION tag, or you can specify a default storage location within the CF Administrator. However, I would generally recommend that you not use both Client and Session variables. Usually, I think you're better off just using one or the other, depending on the needs of your application. For most relatively simple applications, Session variables are your best bet. I'm oversimplifying a bit here, of course. So, what happened when you tried to use Session variables? Remember that they also need to be enabled within the CF Administrator and within your CFAPPLICATION tag using the SESSIONMANAGEMENT attribute. Also, the most logical place for me to put an assignment for this variable is in a CFC, but I see that Mr. Corfield does not recommend doing this: It's not that CFCs cannot access scope variables, just that they should not in general (since it breaks encapsulation). The general approach is to create a CFC whose sole job is to 'wrap' the scope access so as to hide it from the rest of the app. ... So where/how can I create a variable that persists this information? If you're using the Client scope, I suspect you'll get a little less value out of the idea of encapsulating access to it within a CFC, since the Client scope itself isn't stored in memory beyond a single page request, but rather is refetched for each page request from whatever storage location you specified. If you're using the Session scope, I would wholeheartedly endorse Mr. Corfield's recommendation. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188856 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Mach-II client variables
On Tue, 28 Dec 2004 10:14:25 -0500, Matthew Small [EMAIL PROTECTED] wrote: Thanks, but I've already tried that and it didn't do anything for me. Here is the present content of my CFAPPLICATION tag: cfapplication name=mrktPromoTool sessionmanagement=yes clientmanagement=yes clientStorage = cookie setClientCookies=yes/ I've also had the clientStorage and setClientCookies attributes removes and that does not help. I'm using CFMX 6.1 if that's of any use. Here is the offending line of code: cfparam name=client.currentMarket default=0 What am I doing wrong? To my knowledge, there's no way of explicitly disabling client variables (i.e., through a CFMX Administrator setting or some such). Where is this cfapplication declaration located? Are you sure that you don't have an Application.cfm that gets executed before this code that might have another cfapplication directive in it? Also, I would not use cookies for clientStorage due to security considerations (the data is stored in clear text on the user's machine) -- it would be preferable to use your database to store the client variables. However, that being said, one thing at a time. Have you checked for any possible conflicting cfapplication directive in an Application.cfm file that's being executed? Regards, Dave. ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188861 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54