The background JSP window disappears when a new JSP dialog is displayed

210 views Asked by At

I have a JSP page (first.jsp) displayed. On the click of a button in this page, the server side code performs computation and requests for displaying a jJSP dialog(dialog.jsp). dialog.jsp should appear on top of first.jsp.

The dialog.jsp appears but when did does, the first.jsp disappears. I tried including this in first.jsp and on page load, set this page to hidden:

<jsp:include page="/WEB-INF/pages/dialog.jsp" /> 
$(function () {
 $("#dialog").modal('hide');    
});

But its not working! I am using Struts, Spring.

1

There are 1 answers

1
Roman C On

First you need to set up the dialog on the div and not open it

$(function () {
 $("#dialog").dialog({modal: true, autoOpen: false});    
});

then open it on some event

$("#dialog").dialog("open");