Re: Anyone using Twitter Bootstrap with CF?
Is the edit form a part of your html from the beginning, populating fields from data on open (preferred)? Or do you open the modal and bring in the form? In either event, you probably need to add code to your modal hidden event that will clear the form. Steve 'Cutter' Blades Adobe Community Professional Adobe Certified Expert Advanced Macromedia ColdFusion MX 7 Developer http://cutterscrossing.com Co-Author Learning Ext JS 3.2 Packt Publishing 2010 https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book The best way to predict the future is to help create it On 11/20/2012 3:00 PM, Pete Ruckelshaus wrote: OK, new (but related) problem. I'm using a modal window to edit records. When I click to edit the first record, it loads the edit window with that records data. Cool. Close the window, click on the second record, and the data for the first record is still in the form and remains there until I refresh the page. I am using this method to call the edit window: a href=#CGI.script_name#?a=editassetid=#getassets.assetid# data-toggle=modal data-target=##editmodal role=button class=btn btn-small pull-rightEdit/a I tried some of the no-cache tricks, thinking it might be a caching issue, but that caused no content to be loaded in the body of the modal window. Is there a solution to this? Thanks Pete On Wed, Nov 14, 2012 at 1:33 PM, Cameron Childress camer...@gmail.comwrote: On Wed, Nov 14, 2012 at 1:13 PM, Pete Ruckelshaus pruckelsh...@gmail.com wrote: Yeah, that's what I get for just glancing at the docs. This a data-toggle=modal href=remote.html data-target=#modalclick me/a worked like a charm. Great! Next up, is there a way to submit a form within the same modal window? Sorry for the questions, I've been doing almost entirely server-side stuff for the past few years. You can actually have someone submit the form in the modal just like any other page. Then it will make a round trip tot he server and refresh the underlying page (the one that opened the modal). Alternately, you can have a button in the modal make a javascript call and do a jQuery AJAX call to submit the data, without causing the underlying page to refresh. You can then close the modal using some of the code you should be able to find in the documentation. There are a bunch of ways you can solve the problem, but I'd read up on the whole she-bang a bit before trying to cut/paste anything from Stack Overflow (or this list) to solve your problem. I'd put down the IDE for a bit, get a coffee and take a long read in the jQuery docs around the AJAX methods. http://api.jquery.com/category/ajax/ You should be able to chain those calls along with the Bootstrap modal stuff to get where you want to be. -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353277 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
On Tue, Nov 20, 2012 at 3:00 PM, Pete Ruckelshaus pruckelsh...@gmail.comwrote: I'm using a modal window to edit records. When I click to edit the first record, it loads the edit window with that records data. Cool. Close the window, click on the second record, and the data for the first record is still in the form and remains there until I refresh the page. I tried some of the no-cache tricks, thinking it might be a caching issue, but that caused no content to be loaded in the body of the modal window. Keep in mind that the modal window in jQuery isn't really a separate window, it's just a layer that jQuery shows/hides from visibility. When you load content into a modal form a remote source you're basically just changing the content of that hidden layer, after showing the layer. When you close it you are simply hiding the layer (and whatever it last contained). So, the order of execution workflow the first time is: 1) Show layer 2) Load content into it In your scenario you are doing this twice: 1) Show layer 2) Load content into it 3) Hide layer 4) Show layer again (still has old content) 5) Load content into it So... you can fix this a few ways. you can either programmatically clear the modal content after hiding it (between #3 and #4), or you can programmatically clear the modal before showing it (before #1 and #4). Both of these will require you to call an opener method of your own instead of relying on the simplified jQuery syntax for opening modals. I don't have any code handy to show you a solution, but hopefully that's enough about what's going on to find one on your own (or maybe someone else will jump in with sample code). -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353278 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
OK, new (but related) problem. I'm using a modal window to edit records. When I click to edit the first record, it loads the edit window with that records data. Cool. Close the window, click on the second record, and the data for the first record is still in the form and remains there until I refresh the page. I am using this method to call the edit window: a href=#CGI.script_name#?a=editassetid=#getassets.assetid# data-toggle=modal data-target=##editmodal role=button class=btn btn-small pull-rightEdit/a I tried some of the no-cache tricks, thinking it might be a caching issue, but that caused no content to be loaded in the body of the modal window. Is there a solution to this? Thanks Pete On Wed, Nov 14, 2012 at 1:33 PM, Cameron Childress camer...@gmail.comwrote: On Wed, Nov 14, 2012 at 1:13 PM, Pete Ruckelshaus pruckelsh...@gmail.com wrote: Yeah, that's what I get for just glancing at the docs. This a data-toggle=modal href=remote.html data-target=#modalclick me/a worked like a charm. Great! Next up, is there a way to submit a form within the same modal window? Sorry for the questions, I've been doing almost entirely server-side stuff for the past few years. You can actually have someone submit the form in the modal just like any other page. Then it will make a round trip tot he server and refresh the underlying page (the one that opened the modal). Alternately, you can have a button in the modal make a javascript call and do a jQuery AJAX call to submit the data, without causing the underlying page to refresh. You can then close the modal using some of the code you should be able to find in the documentation. There are a bunch of ways you can solve the problem, but I'd read up on the whole she-bang a bit before trying to cut/paste anything from Stack Overflow (or this list) to solve your problem. I'd put down the IDE for a bit, get a coffee and take a long read in the jQuery docs around the AJAX methods. http://api.jquery.com/category/ajax/ You should be able to chain those calls along with the Bootstrap modal stuff to get where you want to be. -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353268 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
You will really need to confirm if you do actually have a caching issue. If you're using Firefox, use Firebug to watch your ajax traffic in the console view. If you're using Chrome, F12 will pull up the developer tools. I hear there are other browsers, but you wouldn't be using them, I'm sure. Otherwise, view the HTML your CF is generating and make sure the links are all unique, and that you're not calling id=1 on every link to the modal. Disclaimer: I haven't used the modal yet except in playing around, and I've never experienced your issue. nathan strutz [www.dopefly.com] [hi.im/nathanstrutz] [about.me/nathanstrutz] ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353270 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Anyone using Twitter Bootstrap with CF?
I'm playing around with Twitter Bootstrap as a UI solution because, well, my design skills are lacking. I like it so far, but I want to use their modal windows (not CF's) for forms that I use to add or edit records. The problem is, how do I pass dynamic variables (i.e. the ID of the record that I want to edit) into what is essentially a static modal window that isn't accessed via URL? Thanks, Pete ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353161 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
Look in the Bootstrap Modal docs under Via Javascript. Specifically I've used the remote option to accomplish this. That way you can just pull the modal content off the server on-demand instead of using a static modal. http://twitter.github.com/bootstrap/javascript.html#modals -Cameron On Wed, Nov 14, 2012 at 10:37 AM, Pete Ruckelshaus pruckelsh...@gmail.comwrote: I'm playing around with Twitter Bootstrap as a UI solution because, well, my design skills are lacking. I like it so far, but I want to use their modal windows (not CF's) for forms that I use to add or edit records. The problem is, how do I pass dynamic variables (i.e. the ID of the record that I want to edit) into what is essentially a static modal window that isn't accessed via URL -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353162 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
Yeah, that's what I get for just glancing at the docs. This a data-toggle=modal href=remote.html data-target=#modalclick me/a worked like a charm. Next up, is there a way to submit a form within the same modal window? Sorry for the questions, I've been doing almost entirely server-side stuff for the past few years. Thanks Pete On Wed, Nov 14, 2012 at 10:48 AM, Cameron Childress camer...@gmail.comwrote: Look in the Bootstrap Modal docs under Via Javascript. Specifically I've used the remote option to accomplish this. That way you can just pull the modal content off the server on-demand instead of using a static modal. http://twitter.github.com/bootstrap/javascript.html#modals -Cameron On Wed, Nov 14, 2012 at 10:37 AM, Pete Ruckelshaus pruckelsh...@gmail.comwrote: I'm playing around with Twitter Bootstrap as a UI solution because, well, my design skills are lacking. I like it so far, but I want to use their modal windows (not CF's) for forms that I use to add or edit records. The problem is, how do I pass dynamic variables (i.e. the ID of the record that I want to edit) into what is essentially a static modal window that isn't accessed via URL -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353166 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Anyone using Twitter Bootstrap with CF?
On Wed, Nov 14, 2012 at 1:13 PM, Pete Ruckelshaus pruckelsh...@gmail.comwrote: Yeah, that's what I get for just glancing at the docs. This a data-toggle=modal href=remote.html data-target=#modalclick me/a worked like a charm. Great! Next up, is there a way to submit a form within the same modal window? Sorry for the questions, I've been doing almost entirely server-side stuff for the past few years. You can actually have someone submit the form in the modal just like any other page. Then it will make a round trip tot he server and refresh the underlying page (the one that opened the modal). Alternately, you can have a button in the modal make a javascript call and do a jQuery AJAX call to submit the data, without causing the underlying page to refresh. You can then close the modal using some of the code you should be able to find in the documentation. There are a bunch of ways you can solve the problem, but I'd read up on the whole she-bang a bit before trying to cut/paste anything from Stack Overflow (or this list) to solve your problem. I'd put down the IDE for a bit, get a coffee and take a long read in the jQuery docs around the AJAX methods. http://api.jquery.com/category/ajax/ You should be able to chain those calls along with the Bootstrap modal stuff to get where you want to be. -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353167 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm