eaglesview
asked on
opening and closing of a dialog window in JSP
Hello everyone, i hope you can help on this
I have a display.jsp file that opens a dialog window when a button is clicked. An input is then made in the dialog window (input.jsp). The dialog window's form is then submitted to another jsp page(without html) to process the inputted data then go back to display.jsp using pageContext.forward( "display.jsp" ).
When I opened the dialog window using 'window.open("input.jsp",. ..)' then close it using 'self.close'I got an IO exception error and no update was made in display.jsp.
When I used window.showModalDialog("in put.jsp",. ...)then close it using self.close, display.jsp is updated but displayed in another window(browser).
How will I open the dialog window then update the display.jsp without opening a new browser window?
Is it possible to forward 'display.jsp' to previous browser where 'display.jsp' was first displayed? how will I do it?
thanks in advance
eaglesview
I have a display.jsp file that opens a dialog window when a button is clicked. An input is then made in the dialog window (input.jsp). The dialog window's form is then submitted to another jsp page(without html) to process the inputted data then go back to display.jsp using pageContext.forward( "display.jsp" ).
When I opened the dialog window using 'window.open("input.jsp",.
When I used window.showModalDialog("in
How will I open the dialog window then update the display.jsp without opening a new browser window?
Is it possible to forward 'display.jsp' to previous browser where 'display.jsp' was first displayed? how will I do it?
thanks in advance
eaglesview
U can solve ur problem with javascript. I have done similar programs but I havent used forward() function to refresh the parent. What I did was I processed the data in the dialog window ( using window.open) , then in the next page of dialog window I wrote javascript functions to update the parent /opener window. then closed the dialog
ASKER
what my dialog window does is that it displays select buttons for the user to select a field to be deleted in the database. That's why I have to submit the form to a jsp file that uses a class file and access the database. then go back to the opener window using pageContext.forward('displ ay.jsp').
OK. You delete the data using ur JSP. After that what do u want? I think u just need to refresh the parent window to display new values from database. Here u can use javascript to refresh the parent and close the dialog. that will be the easiest way
ASKER
thanks..
yes.. I think you got my point. can you help me on my javascript code?
I have this code on my dialog window but it didn't worked right.
function submitForm(){
self.yoteiform.submit();
window.opener.write('displ ay.jsp');
window.close()
}
yes.. I think you got my point. can you help me on my javascript code?
I have this code on my dialog window but it didn't worked right.
function submitForm(){
self.yoteiform.submit();
window.opener.write('displ
window.close()
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> window.opener.location = "display.jsp?name1=value1& name2=valu e2...";//r efresh parent
or window.opener.form1.action = "display.jsp?name1=value1& name2=valu e2...";//r efresh parent
window.opener.form1.submit ();
Is that means we must can the parent window's location/ or action (then submit it) property?
Just thinking if there is a better solution?
<learning..>
or window.opener.form1.action
window.opener.form1.submit
Is that means we must can the parent window's location/ or action (then submit it) property?
Just thinking if there is a better solution?
<learning..>
ASKER
thanks.. it helped me a lot.
I did just what you've told me.
my problem was not really to refresh the page. the problem really was where to close the dialog window and display again the display.jsp without using pagecontext.forward(..)
I did just what you've told me.
my problem was not really to refresh the page. the problem really was where to close the dialog window and display again the display.jsp without using pagecontext.forward(..)