cancel
Showing results for 
Search instead for 
Did you mean: 

Open a view twice does not work

Former Member
0 Kudos

Hello,

I have a problem with bsp-views:

I open a new window via the JavaScript command

<script type="text/javascript" language="javascript">

open( "<%= controller->mv_srch_url%>",

"searchTask", "resizable=no, scrollbars=no,

status=yes, menubar=no, width=320, height=522,

top=50, left=50" );

</script>

If I close this window via the 'X' on the upper right corner of the window and want to open the popup again it doesn't work. This JavaScript command passes correctly but no window is opened.

If I close the popup via a button where a submit is made to the calling (parent) document and open it again, everything works fine.

Now I have two questions:

1. Does anybody have an idea why the popup cannot be opened again?

2. If not, I would like to make a submit if the popup is closed by the 'X'. I tried this in my bsp-view:

<script language="javascript">

function do_submit(){

var theForm = window.opener.document.getElementById("theForm");

theForm.submit();}

window.onUnload = do_submit

</script>

but it did not work.

I would be very grateful for any help.

Best regards,

Ralph

Message was edited by: Ralph Rillig

Catching the 'X' does not work, but opening the popup twice is working. I used the following coding:

open( "<%= controller->mv_srch_url%>",

"searchTask<%=sy-uzeit>", "resizable=no, scrollbars=no,

status=yes, menubar=no, width=320, height=522,

top=50, left=50" );

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The problem is partly solved.

I can catch the closing window with the following java script coding and make a submit to the parent window.

function do_submit(){

var theForm = window.opener.document.getElementById("theForm");

theForm.submit();}

window.onunload = do_submit;

I don't know why it didn't work before, maybe because of the capital letter in 'onUnLoad'..?

Former Member
0 Kudos

Ralph

try the following...

1) create a new parameter or variable named callPopup (type CHAR01) with a default value 'N'.

2) then in your view put the following;

<% IF callPopup = 'S'. callPopup = 'N'. %>

<script type="text/javascript" language="javascript">

open( "<%= controller->mv_srch_url%>",

"searchTask", "resizable=no, scrollbars=no,

status=yes, menubar=no, width=320, height=522,

top=50, left=50" );

</script>

<% ENDIF. %>

3) Then when the user press the button to search (or the event to call the popup) just put the value of this variable to 'S'.

Try it...

Ariel

Former Member
0 Kudos

Hi Ariel,

thank you for your post, but it still doesn't work.

My coding is as follows:

<%

if controller->mv_call_popup is not initial.

clear controller->mv_call_popup.

%>

<script type="text/javascript" language="javascript">

open( "<%= controller->mv_srch_url%>", "searchTask", "resizable=no, scrollbars=no, status=yes, menubar=no, width=320, height=522, top=50, left=50" );

</script>

<%

endif.

%>

Also my second problem is not solved because the event 'window.onunload = do_submit;' is raised with every request on the bsp-view of the popup and not only with the click on the 'X' of the window.

Ralph