Loading javascript on Uibinder

799 views
Skip to first unread message

bond

unread,
Nov 21, 2011, 12:54:58 PM11/21/11
to Google Web Toolkit
Hi,
I need to load a javacript in a uibinder.xml file. In a few words,a
need to load this script http://malsup.com/jquery/cycle/ when the page
is created. I can't load the script at startup of application.

THanks very much!

-sowdri-

unread,
Nov 21, 2011, 11:36:57 PM11/21/11
to google-we...@googlegroups.com
UiBinder is not the place to load external js files. For more info on when and where its appropriate to load external js refer: 

-sowdri-

bond

unread,
Nov 22, 2011, 2:46:57 AM11/22/11
to Google Web Toolkit
Hi sowdri. Thanks for your post. I know that but I need the javascript
file is loaded only after the html page is rendered. And the html page
is made throught uibinder.
So there is a way to do this?

Thanks very much!

Best regards

On 22 Nov, 05:36, -sowdri- <sow...@gmail.com> wrote:
> UiBinder is not the place to load external js files. For more info on when

> and where its appropriate to load external js refer:http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_WhenDoMo...
>
> -sowdri-

Thomas Broyer

unread,
Nov 22, 2011, 4:34:30 AM11/22/11
to google-we...@googlegroups.com

bond

unread,
Nov 22, 2011, 5:15:05 AM11/22/11
to Google Web Toolkit
Hi Thomas,
your suggestion is very good but unfortunally I'm using GWT 2.1.1 and
I can't change it :-(

Another way maybe can be know when uiBinder finish to display the
page.

After initWidget(uiBinder.createAndBindUi(this)); the page is not yet
made. Can I know when the page is built?

Thanks very much

On 22 Nov, 10:34, Thomas Broyer <t.bro...@gmail.com> wrote:
> http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/googl...
> ?

Thomas Broyer

unread,
Nov 22, 2011, 5:29:49 AM11/22/11
to google-we...@googlegroups.com
UiBinder does not "show" anything, it builds widgets just like you could have done programmatically (it generates almost the same code as you would have coded by hand).

A widget built with UiBinder is like any other widget, it's only attached to the document when added to another widget which itself is already attached, or when its parent widget becomes attach. You can listen to the AttachEvent or override onLoad to be notified when that happens.
Reply all
Reply to author
Forward
0 new messages