File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes set ajax response in parent window field without refreshing the parent window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "set ajax response in parent window field without refreshing the parent window" Watch "set ajax response in parent window field without refreshing the parent window" New topic
Author

set ajax response in parent window field without refreshing the parent window

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Hi,

I have a popup window with form fields Date and Cash and a Submit button. On click of submit button, i call an ajax function which then passes the control to struts action class. I do db fetching over here and set the ajax response.

I want to set the ajax response in my parent window form field, but it is not happening.

Here is my code:

pop up jsp:


Action Class:


pop up window gets closed, but parent window field does not change, also i am not getting the alerts which i have put inside function processStateChange().
I have to refresh the parent window to show up the value, but i dont want that.

What am i doing wrong?

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Is you child window cached, hence why you are not getting the alert?

eric
Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Eric Pascarello wrote:Is you child window cached, hence why you are not getting the alert?

eric


Hey, how can i find out whether my child window is cached or not?

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Make a change to the file and see if you can see it OR just clear your cache

Eric
Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Eric Pascarello wrote:Make a change to the file and see if you can see it OR just clear your cache

Eric

Hey, i added a line in the file, but was not able to see it, had to refresh the page manually to see the changes.

How do i clear my cache? in my jsp ?

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You want the pages to be cache, makes it faster for your users. That is why you need to use proper caching headers.

For development, you just need to clear your cache and set your browser up to not cache files.

Eric
Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Eric Pascarello wrote:You want the pages to be cache, makes it faster for your users. That is why you need to use proper caching headers.

For development, you just need to clear your cache and set your browser up to not cache files.

Eric

Hey Eric, i am a little confused over here. How do i solve my caching problem?



Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Easiest solution is to do Ctrl-R in Firefox or Ctrl-f5 in IE.

You can look at your browser settings and there is ways to set up your browser to not cache.

You can just clear your cache manually.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: set ajax response in parent window field without refreshing the parent window
 
Similar Threads
close pop up window after submit form
pass <bean:write> to a function
How to update a image using servlet?
populate <html:options> with AJAX response
Eclipse: JSP page has no errors, still eclipse complains