Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Getting form values from Pop up and processing them in Parent

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !

I have an application where I have to show a pop up on click of a button and the values user enter in the pop-up are to be processed backend and written to database. Immediately, I need to refresh the parent where that information written by pop-up has to be read from databse and displayed.

When I did all this in pop-up itself (I mean, I called submit on pop-up, then opener.document.reload() and then window.close() all on the click of save button in the pop-up javascript) , I got deadlock or timeout exception on database because the pop-up and parent were both trying to access the data at same time...

Things work fine if I give setTimeOut of atleast 100ms on the call to opener.document.reload(), but I don't want to take a risk because I'm not sure about the backend process time.

Hence I want to accomplish this by passing the form fields of pop-up onto the parent and closing the pop-up then itself and soon after, processing those form values and updating on databse and refreshing the parent page from parent itself.

I'm not getting the way to know in the parent that the pop-up is closed so that processing can be started immediately. Could anybody help me on this?

Thanks,
Vidya.
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic