Results 1 to 5 of 5

Thread: JSF,JSP,JAVASCRIPT help need

  1. #1
    Join Date
    Aug 2005
    Posts
    5
    Rep Power
    0

    Angry JSF,JSP,JAVASCRIPT help need

    I wrote a java class to check if users have loggin and user rights to pages but because i have limited experience with Oracle Jdeveloper did not want to mess with filtters does anyone know how i can get to use the class in my program before a page loads i want to use the class to check for validations.

    Additionally does anyone know how to close a pop-up and refresh the calling form i tried the following

    onload = "opener.location=(CallingWindowName)"
    have a button and onclick="opener.location.reload(true);javascript:w indow.close();"

    but keep getting an error that the opener is null or not an object any ideas

  2. #2
    Join Date
    Jun 2003
    Posts
    159
    Rep Power
    0

    Default

    Occasionally a popup is meant to replace the opening page. What we'd like to do is open a popup to give a window exact dimensions and/or an exact position on the screen and load the starting page of the site in it. Then we want to close the useless opening window.

    Theoretically

    opener.close()

    should be the code from the popup: close the window that has opened this popup.

    However, in some browsers it is not allowed to automatically close windows that have not been opened by JavaScript. The line above works fine in Explorer on Mac, Mozilla, Opera and OmniWeb, but not in Explorer on Windows, Netscape 4 and lower and iCab. In these browsers the user is asked to confirm the closing of the window. As to Safari, it does absolutely nothing.

    Rather to my surprise it's very easy to get around this confirm box in Explorer 5.5 and 6 on Windows. Explorer merely looks if the page has an opener. If it doesn't the window has been opened by the user and may not be closed without a confirm. So what we need to do is trick Explorer into thinking the opening page has an opener:

    opener.opener = top; // or whatever, as long as opener.opener has a value;
    opener.close()

    This trick doesn't work in Netscape 4 and lower and iCab, these browsers have more sophisticated ways to determine whether a window has been opened by JavaScript.
    I have within me the blood of kings....take me to the leader of your world.

  3. #3
    Join Date
    Aug 2005
    Posts
    5
    Rep Power
    0

    Default next question

    well tahnks very much for the reply but i tried doing what u recommended but still got the same error stating that the opener object is null.....what i would really like to know is how to close a pop-up and update the calling form/parent window after some task has been exceuted

  4. #4
    Join Date
    Jul 2004
    Posts
    264
    Rep Power
    0

    Default

    I hope this solution can help you out .... the page test.html opens a popup window with open.html... open.html then runs a script which updates the form on test.html then closes itself ....

    test.html
    HTML Code:
    <form name='f'>
    	<input name='t1' />
    	<input name='t2' />
    </form>
    
    <script>
    	win = window.open('open.html');
    </script>
    open.html
    HTML Code:
    <script>
    	window.opener.document.all.f.t1.value = "aone";
    	window.opener.document.all.f.t2.value = "killa";
    	window.close();
    </script>
    Hopefully you will be able to incorporate this into your site

  5. #5
    Join Date
    Jun 2003
    Posts
    159
    Rep Power
    0

    Default

    Quote Originally Posted by troublemeka
    well tahnks very much for the reply but i tried doing what u recommended but still got the same error stating that the opener object is null.....what i would really like to know is how to close a pop-up and update the calling form/parent window after some task has been exceuted
    Are you sure that you are clearing the cache everytime you make changes to the javascript? This may mask any changes that you make to your client-side script.
    I have within me the blood of kings....take me to the leader of your world.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •