-
1. Re: Errai UI DOM Access & JS Execution Failures ?
mbarkley Dec 11, 2013 10:58 AM (in response to chaluwa)1 of 1 people found this helpfulCharles,
There are lifecycle methods for loading a page. You can annotate methods in a page with
@PageShowing
and@PageShown
to have them invoked while the page is loading, and when it's done loading, respectively.Cheers.
-
2. Re: Errai UI DOM Access & JS Execution Failures ?
chaluwa Dec 11, 2013 12:26 PM (in response to mbarkley)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. -
3. Re: Errai UI DOM Access & JS Execution Failures ?
edewit Dec 13, 2013 10:21 AM (in response to chaluwa)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
-
4. Re: Errai UI DOM Access & JS Execution Failures ?
chaluwa Dec 13, 2013 1:52 PM (in response to edewit)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.
-
5. Re: Errai UI DOM Access & JS Execution Failures ?
edewit Dec 16, 2013 2:31 AM (in response to chaluwa)there is also a project called gwt-bootstrap maybe they have a solution for this.
-
6. Re: Errai UI DOM Access & JS Execution Failures ?
chaluwa Dec 16, 2013 4:05 AM (in response to edewit)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.