On Tue, Nov 20, 2012 at 3:00 PM, Pete Ruckelshaus <[email protected]>wrote:
> 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> | twitter<http://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

