Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6809648

JSObject.eval() gets blocked by modal JDialog

XMLWordPrintable

    • b03
    • x86
    • windows_xp
    • Verified

        JSObject.eval() do not return when JDialog is opened.
        Java version: jdk 6u12 build02 or later with new generation plugin enabled.
        browser: Firefox 3.0.6, IE6, IE7 (not reproducible on Firefox 2.0)

        To reproduce:
        1. open attached TestApplet.html file in a web browser(it will run attached TestApplet.java).
        2. click "run javascript button" - it will open JDialog and start a thread which opens
        javascript alert window.

        Expected results:
        clicking OK button on javascript alert window should close
        the JDialog windows and javascript alert window itself.

        Actual results:
        on jdk 6u12b01 or earlier (with new plugin enabled) (i.e. before a fix for 6764266)
        javascript alert window freezes.

        on jdk 6u12b02 or later (with new plugin enabled) (i.e. after a fix for 6764266)
        javascript alert window closes but JSObject.eval() never returns and as a result
        JDialog.setVisible(false) doesn't get called and JDialog window doesn't close.

        Test case passes if an old generation plugin is enabled.

        Attached is also original Oracle test case - OracleTestApplet.
        After clicking OK on javascript aler window the whole browser
        gets frozen. This is obviously because invisible (undecorated) modal JDialog
        is still active.
        Below is an explanation from Oracle why they need Javascript alert window
        running in a separate thread:
        "We had introduced this mechanism of setting a invisible JDialog to true
        in our Forms code to fix another complex issue - bug 6802701. The problem
        there was that when we execute javascript alerts in the Event thread, we
        block the Forms client applet. If the applet is blocked beyond a certain
        time, then the Forms server thinks that the client is already dead and thus
        exits. To resolve this issue, we introduced the mechanism of running the
        javascript in a separate thread and keep the forms client alive by running an
        invisible JDialog. The advantage that we have here is that the state of Forms
        would remain at the same point where the Javascript alert is brought up, but
        at the same time keep the Forms client alive."

              miroslawzn Miroslaw Niemiec (Inactive)
              miroslawzn Miroslaw Niemiec (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: