The content inside my modal window is not updated
Can you post some code to show what technique you're using to update the content?
Posted August 28th, 2007 at 10:49am by bbodien
Hi Bbodien, thanks for reply.
I'm using prototype and scriptaculous library for my code. here is one of the example how I update the data:
var url = '../phpscript/savecase.php'; var pars = Form.serialize(caseform) + '&pseudoParam=' + new Date().getTime(); var action = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: ShowCasesaveResult} );
Posted August 28th, 2007 at 11:05pm by Winglys
Okay, can you show us the definition of ShowCasesaveResult()?
PS - Use the code tags in the toolbar when typing your reply to get nice syntax highlighting and layout, it makes the code a lot more readable:
var hello = 'hello world!';
Posted August 29th, 2007 at 4:12am by bbodien
THanks for reminding me bbodien, here is the code that you requested:
function showCasesaveResult (originalRequest)
{
var newData = originalRequest.responseText;
$('results').innerHTML = newdata;
}
I think I have to make my problem clear. My English is not very good so the explanation will be little bit long. I hope bbodien doesn't mind with this.
My case is, I will open my customer details in the modal windows. I load the details for the first time and everything just fine.
I close the modal window and if I update my customer's address in another form using ajax. The problem will appear.
After updating, if I click on the button to show my customer details again, the old address is loaded and no updates was done. I found that the page is just same like the first time I load and I feel that the page is being save in the cache of browser. So no matter how many times I load it, the same results will be out
So in order to see the new data, I have to close and reopen my browser. Then only the new updated address comes out.
In normal Ajax code, I can solve this problem by adding a time at the end of my parameter, just like this:
var url = '../phpscript/savecase.php'; var pars = Form.serialize(caseform) + '&pseudoParam;=' + new Date().getTime();
But in modal window, I have no idea how to make it.
Anyway, I hope I make my problems clear. Thank for your time, bbodien....
Posted August 29th, 2007 at 10:09pm by Winglys
Hi Winglys,
I'm afraid it's difficult to diagnose the error behaviour without seeing it, since the problem could be a number of things.
If you could post the page that's showing the problem somewhere I can see it, I may be able to work it out.
It could be caching, or maybe the Modal needs to be re-initialised if something is externally modifying the values of the inputs?
As I say, if you can publish the site it'd be much easier to determine the cause of the problem :)
Ben
Posted August 31st, 2007 at 4:56am by bbodien
I see, I understand your problem. Let me make an example page to show my problem. Anyway thanks for your helps.
Posted August 31st, 2007 at 5:59pm by Winglys
Hi everyone,
My question is really simple. I'm using modal window to show my data. So I found that after I load the modal window, no matter how much update I make to my data using Ajax, the data inside is not updated.
So I have to close my browser, and load the modal window again. Then only my new data appear. So is there any solution for this? I want my data updated in the real time. Thank you
Posted August 28th, 2007 at 3:43am by Winglys