General discussion

Locked

Windows, Parents, Children...help!

By sgroner ·
I have a parent form which contains an IFRAME named lstEducation, which lists all the education items for a record. Outside of that IFRAME on the parent form I have an ADD Button. When that button is clicked it opens a Modal Web Dialog Window withthe Education Entry form on it. Once I enter my data and click on my Save Button I want it to Save the record, Close the Modal Dialog Window, and then refresh that IFRAME to show the newly add item. Any ideas? I got the Window to close, and the save to happen but the refresh of the IFRAME or the Parent window does not work very well. BTW I really do not care which order the close and Refresh happen.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Windows, Parents, Children...help!

by Cedric King In reply to Windows, Parents, Childre ...

What language are you using? If the language that you are using allows Javascript, then perhaps you can call a script on "OnBlur" or any similar event of the modal window. The script should reload the page. The syntax will be something like "window.document.frame.location.href = "(URL)"".
Alternative, you can use Meta tag "Refresh" and set it to a short period of time, such that when the modal window is close and with the refresh timing being short, it will seems that it refresh upon closing of the modal window.
Hope I understand what you ask and this solve your problem.

Collapse -

Windows, Parents, Children...help!

by sgroner In reply to Windows, Parents, Childre ...

Sorry this is not going to work, I do not want to lose what is in the parent form.

Collapse -

Windows, Parents, Children...help!

by kirya In reply to Windows, Parents, Childre ...

I think you must have some server-side script to Save the record, so in this script you can output to client's browser something like :

<script language="JaavaScript">
window.parent.frames["IstEducation"].location.reload()
window.close()
<script>

Think this should work...

Collapse -

Windows, Parents, Children...help!

by sgroner In reply to Windows, Parents, Childre ...

Poster rated this answer

Collapse -

Windows, Parents, Children...help!

by lastorck In reply to Windows, Parents, Childre ...

From point of view WinAPI you can direct to repaint parent with InvalidateRect() (or InvalidateRgn()) and UpdateWindow() (u can also use RedrawWindow() ). You must have HWND of parent. Hope it may help you if you find analogue in your language.
Regards

Collapse -

Windows, Parents, Children...help!

by sgroner In reply to Windows, Parents, Childre ...

Poster rated this answer

Collapse -

Windows, Parents, Children...help!

by Cedric King In reply to Windows, Parents, Childre ...

Alternatively, you can save whatever you have in your parent frame into database so that when you refresh the page, it will be reflected. When you refresh a page, all data that is entered on that page remains on the screen only. Only when you submitit, i.e. write into database of some sort, will it be reflected when you refresh the page.
If the above is not feasible, you can use javascript to point to the element and write the data from the child window to it. The javascript will need to be in the child window and executed before it is closed.
When you say you don't want to lose your data in the parent window, is it because you want to save into the database only when all the data is entered? If that is the case, the only solution that I can of now is to use elements in forms and point to the particular field and write into it.
Hope this solve your problem.

Collapse -

Windows, Parents, Children...help!

by sgroner In reply to Windows, Parents, Childre ...

Poster rated this answer

Collapse -

Windows, Parents, Children...help!

by sgroner In reply to Windows, Parents, Childre ...

This question was closed by the author

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums