Re: onModuleLoad() Before Page Load

2010-08-09 Thread spierce7
I'm not familiar with a lot of the things that you are using, however
GWT has a method that it calls after the widget that the method is
attached to is loaded. It's called onLoad(). Typically, when I've used
it in the past, it's because I was extending a widget, say a Grid, and
then I would override the onLoad() method. I'm not sure how you would
implement it into a completely custom widget though. You might be able
to put the iframe in a HTMLPanel or something, and call the onLoad()
method. Either way, I think this may be what your looking for. Hope
this helps!

On Aug 6, 9:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:
 To my understanding, the compiled GWT file module-name.nocache.js
 blocks page evaluation when it is loading. When it finishes, it
 creates a hidden iframe that begins to load the module-name.cache.js
 file but it does NOT block page evaluation and loads asynchronously.

 In my GWT module I define a native Javascript function using JSNI that
 adds a widget to the page.

 I use a Velocity Template that dynamically generates divs with unique
 ids, then call my Javascript method that I defined using JSNI to
 attach the widget to the specific div.

 The problem is that when my page is loading, and the Velocity Template
 calls my Javascript method, the hidden iframe has not finished loading
 the module-name.cache.js that defines the method.

 Is there a way to make the module-name.cache.js file load
 synchronously so that it will block page evaluation until it finishes
 loading? Or make onModuleLoad() run before the page loads completely?
 Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: onModuleLoad() Before Page Load

2010-08-09 Thread mooreds
Hi Ryan,

This doesn't answer your question, but I was wondering why you had the
velocity template initiate attaching your widgets to your spans?

Another possibility is to have velocity write a list of span ids to a
hidden span, and then have your GWT component (in a startup module)
read that span and attach widgets to each span in turn.  That's the
way I do things.

Thanks,
Dan

On Aug 6, 7:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:
 To my understanding, the compiled GWT file module-name.nocache.js
 blocks page evaluation when it is loading. When it finishes, it
 creates a hidden iframe that begins to load the module-name.cache.js
 file but it does NOT block page evaluation and loads asynchronously.

 In my GWT module I define a native Javascript function using JSNI that
 adds a widget to the page.

 I use a Velocity Template that dynamically generates divs with unique
 ids, then call my Javascript method that I defined using JSNI to
 attach the widget to the specific div.

 The problem is that when my page is loading, and the Velocity Template
 calls my Javascript method, the hidden iframe has not finished loading
 the module-name.cache.js that defines the method.

 Is there a way to make the module-name.cache.js file load
 synchronously so that it will block page evaluation until it finishes
 loading? Or make onModuleLoad() run before the page loads completely?
 Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: onModuleLoad() Before Page Load

2010-08-09 Thread Ryan McDonald
Calling an onLoad() method for the widget would be called after the
widget has loaded though. My problem is that I can't call my method
from the script to tell it to create the widget in the first place. I
need a way to make my HTML page know that it shouldn't do anything
else until my script has finished loading so it can recognize my
method. Also, the hidden iframe that is generated is all done behind
the scenes by GWT, isn't it? So I can't really manipulate that in any
way, I'm assuming.

On Aug 9, 6:28 am, spierce7 spier...@gmail.com wrote:
 I'm not familiar with a lot of the things that you are using, however
 GWT has a method that it calls after the widget that the method is
 attached to is loaded. It's called onLoad(). Typically, when I've used
 it in the past, it's because I was extending a widget, say a Grid, and
 then I would override the onLoad() method. I'm not sure how you would
 implement it into a completely custom widget though. You might be able
 to put the iframe in a HTMLPanel or something, and call the onLoad()
 method. Either way, I think this may be what your looking for. Hope
 this helps!

 On Aug 6, 9:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:



  To my understanding, the compiled GWT file module-name.nocache.js
  blocks page evaluation when it is loading. When it finishes, it
  creates a hidden iframe that begins to load the module-name.cache.js
  file but it does NOT block page evaluation and loads asynchronously.

  In my GWT module I define a native Javascript function using JSNI that
  adds a widget to the page.

  I use a Velocity Template that dynamically generates divs with unique
  ids, then call my Javascript method that I defined using JSNI to
  attach the widget to the specific div.

  The problem is that when my page is loading, and the Velocity Template
  calls my Javascript method, the hidden iframe has not finished loading
  the module-name.cache.js that defines the method.

  Is there a way to make the module-name.cache.js file load
  synchronously so that it will block page evaluation until it finishes
  loading? Or make onModuleLoad() run before the page loads completely?
  Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: onModuleLoad() Before Page Load

2010-08-09 Thread Ryan McDonald
My velocity template is in charge of dynamically creating my page.
Basically I have a Velocity macro to create two DateBox widgets so
that a date range may be input by a user. My macro is called whenever
I am generating a page that requires a date range input.

For the list of span ids, that would require all my widgets to be
added in the same span, so be in the same place in the page. My page
needs my widgets to be able to be embedded wherever I choose. The only
way I could think of accomplishing this was creating a GWT JSNI method
that takes a div id string as a parameter so it knows where to attach
my widget.
On Aug 9, 8:18 am, mooreds moor...@gmail.com wrote:
 Hi Ryan,

 This doesn't answer your question, but I was wondering why you had the
 velocity template initiate attaching your widgets to your spans?

 Another possibility is to have velocity write a list of span ids to a
 hidden span, and then have your GWT component (in a startup module)
 read that span and attach widgets to each span in turn.  That's the
 way I do things.

 Thanks,
 Dan

 On Aug 6, 7:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:



  To my understanding, the compiled GWT file module-name.nocache.js
  blocks page evaluation when it is loading. When it finishes, it
  creates a hidden iframe that begins to load the module-name.cache.js
  file but it does NOT block page evaluation and loads asynchronously.

  In my GWT module I define a native Javascript function using JSNI that
  adds a widget to the page.

  I use a Velocity Template that dynamically generates divs with unique
  ids, then call my Javascript method that I defined using JSNI to
  attach the widget to the specific div.

  The problem is that when my page is loading, and the Velocity Template
  calls my Javascript method, the hidden iframe has not finished loading
  the module-name.cache.js that defines the method.

  Is there a way to make the module-name.cache.js file load
  synchronously so that it will block page evaluation until it finishes
  loading? Or make onModuleLoad() run before the page loads completely?
  Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: onModuleLoad() Before Page Load

2010-08-09 Thread mooreds
Hi Ryan,

I guess I wasn't clear about the span solution.

What I mean is for the velocity template to build a span like this:
span id=component-config
style=display:nonecomp-111,comp-112,comp-113/span

And then in the gwt component startup method, read the component-
config span, split on commas, and attach components to each id found
there (if it exists).

Does that make a bit more sense?

Dan

On Aug 9, 9:56 am, Ryan McDonald ryan.mcdona...@gmail.com wrote:
 My velocity template is in charge of dynamically creating my page.
 Basically I have a Velocity macro to create two DateBox widgets so
 that a date range may be input by a user. My macro is called whenever
 I am generating a page that requires a date range input.

 For the list of span ids, that would require all my widgets to be
 added in the same span, so be in the same place in the page. My page
 needs my widgets to be able to be embedded wherever I choose. The only
 way I could think of accomplishing this was creating a GWT JSNI method
 that takes a div id string as a parameter so it knows where to attach
 my widget.
 On Aug 9, 8:18 am, mooreds moor...@gmail.com wrote:



  Hi Ryan,

  This doesn't answer your question, but I was wondering why you had the
  velocity template initiate attaching your widgets to your spans?

  Another possibility is to have velocity write a list of span ids to a
  hidden span, and then have your GWT component (in a startup module)
  read that span and attach widgets to each span in turn.  That's the
  way I do things.

  Thanks,
  Dan

  On Aug 6, 7:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:

   To my understanding, the compiled GWT file module-name.nocache.js
   blocks page evaluation when it is loading. When it finishes, it
   creates a hidden iframe that begins to load the module-name.cache.js
   file but it does NOT block page evaluation and loads asynchronously.

   In my GWT module I define a native Javascript function using JSNI that
   adds a widget to the page.

   I use a Velocity Template that dynamically generates divs with unique
   ids, then call my Javascript method that I defined using JSNI to
   attach the widget to the specific div.

   The problem is that when my page is loading, and the Velocity Template
   calls my Javascript method, the hidden iframe has not finished loading
   the module-name.cache.js that defines the method.

   Is there a way to make the module-name.cache.js file load
   synchronously so that it will block page evaluation until it finishes
   loading? Or make onModuleLoad() run before the page loads completely?
   Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: onModuleLoad() Before Page Load

2010-08-09 Thread Ryan McDonald
Ah, that makes more sense now, thanks. While that would work, I am
trying to avoid having to hard-code a list of id's to attach my widget
to. I would like my widget to be able to be reusable and not limited
in the way it's used. My module contains a modified DateBox widget,
and my Velocity Template creates two of them to create a date range
input field. If I hard-code the list of span id's to attach my widget
to, I would have to attach both DateBox widgets inside the Java code
and eliminate the possibility of using only one DateBox widget in a
field for just a plain date picker. If I do it in the Velocity
Template, that can deal with how I lay my widget out which is the
purpose of Velocity.

On Aug 9, 9:30 am, mooreds moor...@gmail.com wrote:
 Hi Ryan,

 I guess I wasn't clear about the span solution.

 What I mean is for the velocity template to build a span like this:
 span id=component-config
 style=display:nonecomp-111,comp-112,comp-113/span

 And then in the gwt component startup method, read the component-
 config span, split on commas, and attach components to each id found
 there (if it exists).

 Does that make a bit more sense?

 Dan

 On Aug 9, 9:56 am, Ryan McDonald ryan.mcdona...@gmail.com wrote:



  My velocity template is in charge of dynamically creating my page.
  Basically I have a Velocity macro to create two DateBox widgets so
  that a date range may be input by a user. My macro is called whenever
  I am generating a page that requires a date range input.

  For the list of span ids, that would require all my widgets to be
  added in the same span, so be in the same place in the page. My page
  needs my widgets to be able to be embedded wherever I choose. The only
  way I could think of accomplishing this was creating a GWT JSNI method
  that takes a div id string as a parameter so it knows where to attach
  my widget.
  On Aug 9, 8:18 am, mooreds moor...@gmail.com wrote:

   Hi Ryan,

   This doesn't answer your question, but I was wondering why you had the
   velocity template initiate attaching your widgets to your spans?

   Another possibility is to have velocity write a list of span ids to a
   hidden span, and then have your GWT component (in a startup module)
   read that span and attach widgets to each span in turn.  That's the
   way I do things.

   Thanks,
   Dan

   On Aug 6, 7:54 pm, Ryan McDonald ryan.mcdona...@gmail.com wrote:

To my understanding, the compiled GWT file module-name.nocache.js
blocks page evaluation when it is loading. When it finishes, it
creates a hidden iframe that begins to load the module-name.cache.js
file but it does NOT block page evaluation and loads asynchronously.

In my GWT module I define a native Javascript function using JSNI that
adds a widget to the page.

I use a Velocity Template that dynamically generates divs with unique
ids, then call my Javascript method that I defined using JSNI to
attach the widget to the specific div.

The problem is that when my page is loading, and the Velocity Template
calls my Javascript method, the hidden iframe has not finished loading
the module-name.cache.js that defines the method.

Is there a way to make the module-name.cache.js file load
synchronously so that it will block page evaluation until it finishes
loading? Or make onModuleLoad() run before the page loads completely?
Something along these lines?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.