1 of 1 people found this helpful
There are lifecycle methods for loading a page. You can annotate methods in a page with
@PageShownto have them invoked while the page is loading, and when it's done loading, respectively.
Ok. Thanks. I can now call / execute JS from within @PageShown, but these can only be simple blocks of JS code. The real problem is that the app does not benefit libraries (e.g Twitter Bootstrap) which gets loaded with the index.html file. So a
<select class="selectpicker">in the template html of a errai @Page that wold have been tweaked by Bootstrap 3 (or some other aditional JS library), does not even even get displayed in my app.
Do you have them in the head of the document? Try putting them at the bottom ( just before </body> ) then they load at a later time and it could fix your timing problems
Well, they are already just before </body> in the app's index.html file. Am thinking a way to look at this would be to see if these JS libraries / plugins have initializers / triggers that can be invoked from JSNI that can do the same thing as loading them with already-present HTML markup.
there is also a project called gwt-bootstrap maybe they have a solution for this.
Yes, am aware of that project, used it before but not with Errai UI. I also noticed that these issues only come up in dev mode. Once the app is compiled and deployed, everything kinda works well. So the fact / issue is that, in dev mode, the @Template / @Page markup loads much after the JS libraries.