How to start a jQuery script after GWT finished DOM creation

1
0
-1

Hi All,

Please suggest some some solution, how to start a javascript function after the whole page loaded in a browser. Not just the "skeleton", but after GWT finished its work to generate widgets. ($( document ).ready() runs before GWD finished it's work)

Thanks Your help.

Bonita 6.2.6

2 answers

1
0
-1

Hi Zoltán

If you cannot modify the GWT, did you try to put a widget HTML at the end of your form, with your javascript code between html script tag? It should be executed when your form is displayed.

Nicolas

Comments

Submitted by zkarolyi on Tue, 09/02/2014 - 13:57

Hi, Sure, but this runs BEFORE the GWT generates the whole page, so the DOM is not ready then. Eg: A text widget is only an empty

with it's ID, but the input tag is missing.

I saw somwhere a solution to start a timer in javascript, check if the DOM is ready, and restart the timer if not. It is not an elegant solution:-(

1
0
-1

Hello,

I don't know what you want to do, but you can use a JSNI method which will call your JQuery code. http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html

If it is in a form, you can add a widget HTML, which contain your jquery call between

tag.

Hope this might help you

Nicolas

Comments

Submitted by zkarolyi on Tue, 09/02/2014 - 11:34

Hi Nicolas,

I think some JSNI code should be included in bonita code, to start some javascript on a page after loading...

I am only a user of bonita, I can not modify bonita/GWT codes, I can not insert JSNI.

Regards, Zoltán

Notifications