java script file linking with gwt java file

41 views
Skip to first unread message

Syed Shahkar Raza

unread,
Jun 23, 2016, 7:43:02 AM6/23/16
to GWT Users
Hey there,
i m working on GWT Urdu Editor application. i have managed to write javascript file to convert data in unicode. but in my entrypoint class i m unable to call the function which is being used in .js file i m attaching files . please kindly help me out.
Urdueditor.java
urdueditor.nocache.js

JonL

unread,
Jun 23, 2016, 11:21:07 AM6/23/16
to GWT Users
You need to provide more info for a definitive answer, but it is likely a race condition,either in the semantics of your html or just because of the manner in which GWT loads.  You will likely want to add some sort of check that the function exists and do a deferred scheduling until the point where the function exists. You will also need to make sure that you are referencing the function correctly via JSNI using the $wnd., IE $wnd.MakeTextBoxUrduEnabled(). You could also provide a Interface wrapper for the class.

Options for checking loaded:

1. manual checks
2. Instead of adding the js via html, you can use scriptInjector which provides a callback interface.
Reply all
Reply to author
Forward
0 new messages