views:

51

answers:

0

Have defined a browserfunction in my java code and am trying to call that from javascript. On executing this javascript I get an error objectExpected(). Anyone knows what could be causing this ?

Here is the JS:

var result = myCustomFn("test", "abd", "url");

Here is code from java side:

final Browser browser = new Browser(shell, SWT.NONE); 
browser.setUrl("file:///C:/test.html"); 
final BrowserFunction function = new CustomFunction (browser, "myCustomFn"); 

static class CustomFunction extends BrowserFunction 
{ 
    CustomFunction (Browser browser, String name) 
    { 
        super (browser, name); 
    } 

    public Object function (Object[] arguments) 
    { 
        System.err.println("test function called*****************"); 
    } 
}