0

I have a JFX panel that run typeScript. I want to execute typeScript function that trigger by java function.

there is a: engine.executeScript("scriptName"); but its working just on javaScript function and doesnt know the TypeScript function.

I try this option: I create JS page that try to call to TS function like this code:

in jfxPanelManager.java

engine.executeScript("realoadMe()");

in bridge.js

var app=requierd('./home/app.ts');

function reloadMe(){
    app.reloadData();
}

java throw exeption that the app in undefined.

How can I refresh the data?

azro
  • 53,056
  • 7
  • 34
  • 70
user3937548
  • 67
  • 2
  • 9
  • for your approach to succeed without considerable effort you need to compile to JavaScript (js), before you try to run it in a web-view, if you are not aware of differences between js and typescript see https://stackoverflow.com/questions/12694530/what-is-typescript-and-why-would-i-use-it-in-place-of-javascript/35048303#35048303 – Nigel Savage Aug 22 '17 at 13:43
  • I try and put an convert ts code but the error (in java) **'undefine' is not an object (Componenet1.component)** \ my code in JS is: `Component1=requierd('./Component'); Component1.component.prototype.func();` – user3937548 Aug 23 '17 at 06:25
  • you have 'var app=requierd('./home/app.ts');' should be 'var app=require('./home/app.ts');' but that is a different issue to running typescript instead of javascript – Nigel Savage Aug 23 '17 at 19:10

0 Answers0