DJ Native Swing javascript command problems

Using DJ Native Swing it is possible to show a web page within a java application. When you do this it is also possible to communicate from the browser to the java runtime environment using the "command" protocol. The documentation has a code snippet which demonstrates it's usage:


function sendCommand( command ){
    var s = 'command://' + encodeURIComponent( command );

    for( var i = 1; i < arguments.length; s+= '&' + encodeURIComponent( arguments[i++] ) );
      window.location = s;
}

As it looks here it seems to be a regular GET request to an url using the command protocol instead of http. Although when I create and image, script tag or just and ajax get request there is no response and the breakpoint in the java runtime isn't triggered.

I don't want to set the window.location because I don't want to navigate away from the page I am currently at. Using the link to navigate to a command url does work though but it also navigates away from the current page. The page uses OpenLayers and dojo. (I have also tried dojo.io.script)

1
задан Andre Steenveld 4 November 2010 в 13:01
поделиться