Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to call “javascript:void(0)” and return statement using ADF link

3126822Apr 6 2016 — edited Apr 7 2016

Hi,

In ADF application I am using a java script to invoke URL in a new IE window. URL is getting opened in new window, but the control is not coming back to the original url / request, it is just showing processing icon in the ADF application, hence i could not do any operations in my adf application.

Java script used in ADF :

function handleURLLaunch (linkurl) {

  loginUrl =  linkurl; 

if (document.getElementById) {

    window.oldOnError = window.onerror;

    window._command = loginUrl;

    window.onerror = function (err) {

      if (err.indexOf('utomation') != -1) {

        alert('command execution of ' + window._command + ' disallowed by user.');

        return true;

      }

      else return false;

    };

    var wsh = new ActiveXObject('WScript.Shell');

    if (wsh){

      wsh.Run("iexplore -nomerge "+loginUrl,8,true);

      return true; // this return statement is not working.

    } 

     window.onerror = window.oldOnError;

  }

  else

    window.open(loginUrl);

}  

below HTML code is invoking the same java script and it works fine.

<a href="javascript:void(0);" onClick="handleURLLaunch ('http://google.com'); return false;">Sample URL to open in IE</a>

I am invoking this java script in ADF through java code.

Can any one let me know how to use the call the java script along with href and return statements / or the other way to solve this issue.

Thanks,

Swathi

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2016
Added on Apr 6 2016
7 comments
1,537 views