Re: Odd behavior when using cfform inside a CFC
Unfortunately, I'm on a very tight self-imposed deadline, so I've dropped it for the time being and I'm skipping the cf8 ajax functions. I'll revisit in the next version. I did try moving the relevant CFCs to the request scope. Didn't do the trick. Even those I invoked the CFC fresh on every page visit, I only got the /cfide scripts on the first view. To get them back, I had to restart jrun. Not an optimal solution. I'm sure its something simple, but for the time being I'm just going to have to wait. I did find this discussion which seems to be a related/same issue, but specific to coldbox: http://www.luismajano.com/forums/index.cfm? event=ehMessages.dspMessages&threadid=626902EA-123F-6116-42A4A957FB64581 C On Sep 11, 2007, at 6:02 PM, Jaime Metcher wrote: > Not sure how much effort you want to go to, but if you want to have > it both > ways you could have a per-request object which has composed into it > the > session-scope object. > > Did you do that dump of the variables scope? I'd be interested to > see how > CFGRID is doing this. I'd have a look myself, but my copy of CF8 > is still > in a box on my desk. > > Jaime Metcher ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288215 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Odd behavior when using cfform inside a CFC
Not sure how much effort you want to go to, but if you want to have it both ways you could have a per-request object which has composed into it the session-scope object. Did you do that dump of the variables scope? I'd be interested to see how CFGRID is doing this. I'd have a look myself, but my copy of CF8 is still in a box on my desk. Jaime Metcher > -Original Message- > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 11 September 2007 7:14 PM > To: CF-Talk > Subject: Re: Odd behavior when using cfform inside a CFC > > > Well, the verdict here: > > 1) If I create the object every request, the javascript appears and > the cfform works fine > 2) If I CFINCLUDE a CFM template, the javascript appears and the > cffform works fine > 3) If it is invoked from a persistent object (in either application > or session scope) it shows up the first time I access the page, but > subsequent access fails to send the page with the needed javascript > > Hmm. I want the cfgrid considerably less than I want to do either of > the first two, because both of the first two options introduce the > problems I was trying to avoid by having the thing in memory in the > first place. Ah, well. > > -- > Charles Sheehan-Miles | http://www.sheehanmiles.com > Author of Republic: A Novel of America's Future > > Sparse, clean narrative... Pay attention to this new book... -- > Pulitzer > Prize winning journalist John Hanchette, Niagara Falls Reporter > > This novel ...may be prophetic...It will disturb you...It should. -- > DailyKos > > > > > On Sep 10, 2007, at 11:53 AM, Brian Kotek wrote: > > > You could try dumping the variables scope of the CFC to see if > > cfform is > > putting something in there. But whatever the problem is, I'm pretty > > sure it > > must be related to the fact that the CFC is being stored in a > > shared scope. > > Does switching to a per-request CFC allow the JavaScript to work > > correctly? > > While I don't recommend doing it in general, you might also see if > > doing a > > cfinclude of a template that contains the cfform tags makes a > > difference. > > > > On 9/10/07, Jaime Metcher <[EMAIL PROTECTED]> wrote: > >> > >> Well, this really is just a wild guess, but maybe it's worth trying > >> re-instantiating the CFC on every request. CFFORM could be > >> stashing some > >> state in that CFC. > >> > >> Jaime Metcher > >> > >>> -Original Message- > >>> From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > >>> Sent: Monday, 10 September 2007 6:58 PM > >>> To: CF-Talk > >>> Subject: Re: Odd behavior when using cfform inside a CFC > >>> > >>> > >>> Jaime interesting question, and yes, the CFC in this case is > >>> stored in the session scope. > >>> > >> > >> > >> > >> > > > > > > ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288207 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Odd behavior when using cfform inside a CFC
This stands to reason, as the grid objects needs to know if the relevant JS has been included once already, in case you have multiple grids on a page (or any other controls using the same JS files). It seems that calling multiple grid tags reuses the same java object in a page (and in this case it's stored in the CFC instance). On 9/11/07, Charles Sheehan-Miles <[EMAIL PROTECTED]> wrote: > Well, the verdict here: > > 1) If I create the object every request, the javascript appears and > the cfform works fine > 2) If I CFINCLUDE a CFM template, the javascript appears and the > cffform works fine > 3) If it is invoked from a persistent object (in either application > or session scope) it shows up the first time I access the page, but > subsequent access fails to send the page with the needed javascript > > Hmm. I want the cfgrid considerably less than I want to do either of > the first two, because both of the first two options introduce the > problems I was trying to avoid by having the thing in memory in the > first place. Ah, well. -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288133 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Odd behavior when using cfform inside a CFC
Well, the verdict here: 1) If I create the object every request, the javascript appears and the cfform works fine 2) If I CFINCLUDE a CFM template, the javascript appears and the cffform works fine 3) If it is invoked from a persistent object (in either application or session scope) it shows up the first time I access the page, but subsequent access fails to send the page with the needed javascript Hmm. I want the cfgrid considerably less than I want to do either of the first two, because both of the first two options introduce the problems I was trying to avoid by having the thing in memory in the first place. Ah, well. -- Charles Sheehan-Miles | http://www.sheehanmiles.com Author of Republic: A Novel of America's Future Sparse, clean narrative... Pay attention to this new book... -- Pulitzer Prize winning journalist John Hanchette, Niagara Falls Reporter This novel ...may be prophetic...It will disturb you...It should. -- DailyKos On Sep 10, 2007, at 11:53 AM, Brian Kotek wrote: > You could try dumping the variables scope of the CFC to see if > cfform is > putting something in there. But whatever the problem is, I'm pretty > sure it > must be related to the fact that the CFC is being stored in a > shared scope. > Does switching to a per-request CFC allow the JavaScript to work > correctly? > While I don't recommend doing it in general, you might also see if > doing a > cfinclude of a template that contains the cfform tags makes a > difference. > > On 9/10/07, Jaime Metcher <[EMAIL PROTECTED]> wrote: >> >> Well, this really is just a wild guess, but maybe it's worth trying >> re-instantiating the CFC on every request. CFFORM could be >> stashing some >> state in that CFC. >> >> Jaime Metcher >> >>> -Original Message- >>> From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] >>> Sent: Monday, 10 September 2007 6:58 PM >>> To: CF-Talk >>> Subject: Re: Odd behavior when using cfform inside a CFC >>> >>> >>> Jaime interesting question, and yes, the CFC in this case is >>> stored in the session scope. >>> >> >> >> >> > > ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288132 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Odd behavior when using cfform inside a CFC
You could try dumping the variables scope of the CFC to see if cfform is putting something in there. But whatever the problem is, I'm pretty sure it must be related to the fact that the CFC is being stored in a shared scope. Does switching to a per-request CFC allow the JavaScript to work correctly? While I don't recommend doing it in general, you might also see if doing a cfinclude of a template that contains the cfform tags makes a difference. On 9/10/07, Jaime Metcher <[EMAIL PROTECTED]> wrote: > > Well, this really is just a wild guess, but maybe it's worth trying > re-instantiating the CFC on every request. CFFORM could be stashing some > state in that CFC. > > Jaime Metcher > > > -Original Message- > > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > > Sent: Monday, 10 September 2007 6:58 PM > > To: CF-Talk > > Subject: Re: Odd behavior when using cfform inside a CFC > > > > > > Jaime interesting question, and yes, the CFC in this case is > > stored in the session scope. > > > > > > ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288093 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Odd behavior when using cfform inside a CFC
Well, this really is just a wild guess, but maybe it's worth trying re-instantiating the CFC on every request. CFFORM could be stashing some state in that CFC. Jaime Metcher > -Original Message- > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > Sent: Monday, 10 September 2007 6:58 PM > To: CF-Talk > Subject: Re: Odd behavior when using cfform inside a CFC > > > Jaime interesting question, and yes, the CFC in this case is > stored in the session scope. > ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288077 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Odd behavior when using cfform inside a CFC
Jaime interesting question, and yes, the CFC in this case is stored in the session scope. Andrew ... for a lot of reasons, I chose to have the "view" layer implemented in a CFC. The application is set up such that a user creates their own templates, and then uses keywords inside those templates which are equivalent to various widgets, etc. For example, the user might put the following into their template, which is stored in the database: %title% other stuff some header and formatting stuff %blog_entry% some footer and formatting stuff All of the above is stored in the database. When the page is actually executed, the OnRequest in application CFC looks something like this: #APPLICATION.PG.RENDER(TEMPLATE, REQUEST.RQ)# So this calls a function that determines which of those templates to use, then renders it, calling the correct routines on the fly. So basically all of the content in any given user website is driven by the render method in the page processing CFC. I ended up building it this way because the app was a nightmarish chaos of code before. While I appreciate the suggestion to separate out the page processing into CFM templates, I've just spent about six months undoing that, so it's not really an option at this point. That said, the "view" CFCs are separated out from the business logic, but yes, it's completely CFC driven. I don't have any CFM templates in the entire app. > > Also, I know that was only pseudocode, but given that "var" is a > reserved > word it looks a bit dodgy. You'd want to at least var scope that > result > variable, e.g. > > Correct here, I mistyped in my orriginal email ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288076 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Odd behavior when using cfform inside a CFC
That is correct, CFC's are really used for business logic. Not that they can't be used for output, just that it makes for ugly coding in my opinion. Keep things simple and in their place, and it will make for easier debugging and maintenance further down the track. Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: Jaime Metcher [mailto:[EMAIL PROTECTED] Sent: Monday, 10 September 2007 1:57 PM To: CF-Talk Subject: RE: Odd behavior when using cfform inside a CFC Charles, Nothing obvious, but a couple of questions come to mind: 1. Is it just the javascript that's missing i.e. the other content is OK? 2. Is the CFC instance cached e.g. in session or application scope? Also, I know that was only pseudocode, but given that "var" is a reserved word it looks a bit dodgy. You'd want to at least var scope that result variable, e.g. etc. @Andrew: You're implying that the "V" layer in MVC not be implemented using CFCs, right? Any particular reason why? Jaime Metcher ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288071 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Odd behavior when using cfform inside a CFC
Charles, Nothing obvious, but a couple of questions come to mind: 1. Is it just the javascript that's missing i.e. the other content is OK? 2. Is the CFC instance cached e.g. in session or application scope? Also, I know that was only pseudocode, but given that "var" is a reserved word it looks a bit dodgy. You'd want to at least var scope that result variable, e.g. etc. @Andrew: You're implying that the "V" layer in MVC not be implemented using CFCs, right? Any particular reason why? Jaime Metcher > -Original Message- > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > Sent: Monday, 10 September 2007 12:32 PM > To: CF-Talk > Subject: Re: Odd behavior when using cfform inside a CFC > > > It's CF8. > > > On Sep 9, 2007, at 10:19 PM, Andrew Scott wrote: > > > What version of Coldfusion? > > > > Personally I would be looking at an MVC solution and not be placing > > Form > > output into CFC's > > > > > > > > Andrew Scott > > Senior Coldfusion Developer > > Aegeon Pty. Ltd. > > www.aegeon.com.au > > Phone: +613 8676 4223 > > Mobile: 0404 998 273 > > > > > > > > -Original Message- > > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > > Sent: Monday, 10 September 2007 12:07 PM > > To: CF-Talk > > Subject: Odd behavior when using cfform inside a CFC > > > > Hi all, > > > > Here's my situation, and its a bit odd. I've reproduced it under a > > couple of different contexts. > > > > I have a number of CFC methods which handle page processing for my > > application. It typically looks something like this: > > > > > > > > page content executes here: example: > > > > > > > > Here's the issue. This works just fine, but I'm starting to play > > with cf8 cfforms, particularly cfgrid. What's interesting is that > > the first time I call one of these pages, the grid works fine. On > > subsequent page loads, I don't get any of the coldfusion javascript, > > so I get no grid. Looking at the page source at the browser, the > > scripts don't even show up. > > > > It I have the ajax calls in a vanilla cfm template, they load every > > time. But when loaded from a cfc -- the scripts only appear the first > > time. Anyone run into anything like this? > > > > -- > > Charles Sheehan-Miles | http://www.sheehanmiles.com > > Author of Republic: A Novel of America's Future > > > > .Sparse, clean narrative... Pay attention to this new book... -- > > Pulitzer > > Prize winning journalist John Hanchette, Niagara Falls Reporter > > > > This novel ...may be prophetic...It will disturb you...It should. -- > > DailyKos > > > > > > > > > > > > > > > > > > > > ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288070 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Odd behavior when using cfform inside a CFC
I still would be looking at an MVC solution. Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] Sent: Monday, 10 September 2007 12:32 PM To: CF-Talk Subject: Re: Odd behavior when using cfform inside a CFC It's CF8. On Sep 9, 2007, at 10:19 PM, Andrew Scott wrote: > What version of Coldfusion? > > Personally I would be looking at an MVC solution and not be placing > Form > output into CFC's > > > > Andrew Scott > Senior Coldfusion Developer > Aegeon Pty. Ltd. > www.aegeon.com.au > Phone: +613 8676 4223 > Mobile: 0404 998 273 > > > > -Original Message- > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > Sent: Monday, 10 September 2007 12:07 PM > To: CF-Talk > Subject: Odd behavior when using cfform inside a CFC > > Hi all, > > Here's my situation, and its a bit odd. I've reproduced it under a > couple of different contexts. > > I have a number of CFC methods which handle page processing for my > application. It typically looks something like this: > > > > page content executes here: example: > > > > Here's the issue. This works just fine, but I'm starting to play > with cf8 cfforms, particularly cfgrid. What's interesting is that > the first time I call one of these pages, the grid works fine. On > subsequent page loads, I don't get any of the coldfusion javascript, > so I get no grid. Looking at the page source at the browser, the > scripts don't even show up. > > It I have the ajax calls in a vanilla cfm template, they load every > time. But when loaded from a cfc -- the scripts only appear the first > time. Anyone run into anything like this? > > -- > Charles Sheehan-Miles | http://www.sheehanmiles.com > Author of Republic: A Novel of America's Future > > .Sparse, clean narrative... Pay attention to this new book... -- > Pulitzer > Prize winning journalist John Hanchette, Niagara Falls Reporter > > This novel ...may be prophetic...It will disturb you...It should. -- > DailyKos > > > > > > > > > ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288067 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Odd behavior when using cfform inside a CFC
It's CF8. On Sep 9, 2007, at 10:19 PM, Andrew Scott wrote: > What version of Coldfusion? > > Personally I would be looking at an MVC solution and not be placing > Form > output into CFC's > > > > Andrew Scott > Senior Coldfusion Developer > Aegeon Pty. Ltd. > www.aegeon.com.au > Phone: +613 8676 4223 > Mobile: 0404 998 273 > > > > -Original Message- > From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] > Sent: Monday, 10 September 2007 12:07 PM > To: CF-Talk > Subject: Odd behavior when using cfform inside a CFC > > Hi all, > > Here's my situation, and its a bit odd. I've reproduced it under a > couple of different contexts. > > I have a number of CFC methods which handle page processing for my > application. It typically looks something like this: > > > > page content executes here: example: > > > > Here's the issue. This works just fine, but I'm starting to play > with cf8 cfforms, particularly cfgrid. What's interesting is that > the first time I call one of these pages, the grid works fine. On > subsequent page loads, I don't get any of the coldfusion javascript, > so I get no grid. Looking at the page source at the browser, the > scripts don't even show up. > > It I have the ajax calls in a vanilla cfm template, they load every > time. But when loaded from a cfc -- the scripts only appear the first > time. Anyone run into anything like this? > > -- > Charles Sheehan-Miles | http://www.sheehanmiles.com > Author of Republic: A Novel of America's Future > > .Sparse, clean narrative... Pay attention to this new book... -- > Pulitzer > Prize winning journalist John Hanchette, Niagara Falls Reporter > > This novel ...may be prophetic...It will disturb you...It should. -- > DailyKos > > > > > > > > > ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288066 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Odd behavior when using cfform inside a CFC
What version of Coldfusion? Personally I would be looking at an MVC solution and not be placing Form output into CFC's Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: Charles Sheehan-Miles [mailto:[EMAIL PROTECTED] Sent: Monday, 10 September 2007 12:07 PM To: CF-Talk Subject: Odd behavior when using cfform inside a CFC Hi all, Here's my situation, and its a bit odd. I've reproduced it under a couple of different contexts. I have a number of CFC methods which handle page processing for my application. It typically looks something like this: page content executes here: example: Here's the issue. This works just fine, but I'm starting to play with cf8 cfforms, particularly cfgrid. What's interesting is that the first time I call one of these pages, the grid works fine. On subsequent page loads, I don't get any of the coldfusion javascript, so I get no grid. Looking at the page source at the browser, the scripts don't even show up. It I have the ajax calls in a vanilla cfm template, they load every time. But when loaded from a cfc -- the scripts only appear the first time. Anyone run into anything like this? -- Charles Sheehan-Miles | http://www.sheehanmiles.com Author of Republic: A Novel of America's Future .Sparse, clean narrative... Pay attention to this new book... -- Pulitzer Prize winning journalist John Hanchette, Niagara Falls Reporter This novel ...may be prophetic...It will disturb you...It should. -- DailyKos ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288065 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4