Friday, October 5, 2012

Requirement for updation of window.showModalDialog functionality in JSP

Requirement:  I need to create a JavaScript "modal child window" functionality with JSP, along with the same JSP webpage update functionality.  Here, parent window should aware of child window's number of update requests.

Issue: I can create a "modal child window" with JSP using window.showModalDialog JavaScript function.  But, it is not supporting JSP webpage update functionality.  There is one more JavaScript function window.open.  It is supporting JSP webpage update functionality.  But, it creates "modeless child window".  

Issue Resolution:  I had chosen window.open JavaScript function, as it is supporting major JSP webpage update functionality.  Later, using the additional JavaScript features (i.e., JavaScript global variables, HTML hidden variables and JavaScript parent-child/child-parent window communication), I made the child window behaves like a "modeless child window".

Here, using JavaScript global variables, parent window can know the state of the child window, i.e., whether child window is opened/closed.  Using JavaScript HTML hidden variables, parent window would aware of child window's number of update requests.  Using JavaScript parent-child/child-parent communication, I successfully made the "modeless child window", even though by using JavaScript window.open function.