Yes.  You definitely want to load entire modules to make the best use
of runAsync.

I forgot to mention the inclusion of a class object in the call...  It
uses the classname of {preferable} the "root" or "control" class in
the module, the one that does all your "work"...  This, I believe, is
so that GWT KNOWS you are going to reference that particular class
{and any classes it references} in your module, but AFTER a waiting
period.  They also use the class objects getName() for namespacing; so
each call to runAsync has a unique id.  Do NOT call run async on the
same class, even if you use a different name...  It will probably
bloat your code by redownloading common material, and it's better
coding practice to create your own callback class, then use a static
function to push your callbacks into a list, and make them all wait
until the very first request calls onSuccess();.   I'll add some
extended source for the "multiple calls to the same async target" as
soon as I compile and test to make sure I know I'm on target.  Until
then, here's my shiny new entry point that loads oooooohhh soooo fast!

public class xMain implements EntryPoint{

        private int done = 0;

        private xCssFrame loador = new xCssFrame();

        @Override
        public void onModuleLoad() {
                loador.add(new Label("How Will You Save The World Today?"));
                RootPanel.get().add(loador);
                loador.xLeft(0.2);
                loador.xTop(0.4);
                loador.xWidth(0.6);
                loador.xHeight(0.2);

                GWT.runAsync(xWordWall.class, new RunAsyncCallback(){
                        @Override
                        public void onFailure(Throwable arg0) { }
                        @Override
                        public void onSuccess() {
                                done++;
                                xWordWall wall = new xWordWall();

                                wall.add("The War On Ignorance");
                                wall.add("TRUTH");
                                wall.add("Love");
                                //.....

                                RootPanel.get().add(wall);

                                wall.xPaintMe();

                                if (done>1)
                                        xAllReady();
                        }
                });
                GWT.runAsync(xTextEditor.class, new RunAsyncCallback(){
                        @Override
                        public void onFailure(Throwable reason) {}
                        @Override
                        public void onSuccess() {
                                done++;
                                xTextEditor ed = new xTextEditor(new xText("How 
Will You Save The
World Today?"));
                                ed.xCoords(new xGeneCoords(0.2,0.1,0.7,0.6));
                                RootPanel.get().add(ed);
                                ed.xPaintMe(51);

                                if (done>1)
                                        xAllReady();
                        }
                });
        }

        //Common callback to let this class know both it's dependencies are
satisfied;
        private void xAllReady() {
                xFx.$(loador).xFadeRem(1000, loador);
        }


}

// I also intend to explore any appengine compatibility issue... The
dev server already saved my text editor content though...
//So; THANK YOU GWT!!  /You rock!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to