Re: GWT 2.0 runAsync code works fine in development mode but fails in normal mode

2010-01-15 Thread Matt Moriarity
I'm not sure about this, but I would guess that GWT doesn't actually
do any code-splitting when in development mode because there isn't
much point. It's really only useful when you compile.

On Jan 14, 12:07 pm, mably fm2...@mably.com wrote:
 Oops, sorry...  It's asynchronous, so my list object is most probably
 always null when I read it.

 What is strange is why it's not null in development mode

 Is runAsync running synchronously in dev mode ?

 On 14 jan, 13:29, mably fm2...@mably.com wrote:

  Hi everybody,

  I have some GWT 2.0 runAsync code that works perfectly fine in dev
  mode but fails in normal mode.

  Is it a GWT bug or am I doing something wrong ?

  Is there some way to identify where the probleme comes from exactly ?

  The only information I have is a Chrome Developer Tools javascript
  error that says : Uncaught TypeError: Cannot call method 'Lc' of
  null.  And nothing in Eclipse while running in dev mode.

  Here is my java code using runAsync :

  public class GwtListHelper {

          private MapString, GwtList lists = new HashMapString, GwtList();

          public GwtList getList(String type) {
                  GwtList list = lists.get(type);
                  if (list == null) {
                          ListWrapper lw = new ListWrapper();
                          getListAsync(type, lw);
                          list = lw.getList();
                          lists.put(type, list);
                  }
                  return list;
          }

          private void getListAsync(final String type, final ListWrapper lw) {
                  if (user.equals(type)) {
                          GWT.runAsync(new RunAsyncCallback() {
                                  public void onSuccess() {
                                          lw.setList(new UserList());
                                  }
                                  public void onFailure(Throwable reason) {
                                          Window.alert(type +  list not 
  loaded !);
                                  }
                          });
                  }
          }

          private class ListWrapper {
                  GwtList list;
                  public void setList(GwtList list) {
                          this.list = list;
                  }
                  public GwtList getList() {
                          return this.list;
                  }
          }

  }
-- 
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: GWT 2.0 runAsync code works fine in development mode but fails in normal mode

2010-01-15 Thread mably
Ok, you're certainly right, thanx for the answer.

On 15 jan, 15:45, Matt Moriarity matt.moriar...@gmail.com wrote:
 I'm not sure about this, but I would guess that GWT doesn't actually
 do any code-splitting when in development mode because there isn't
 much point. It's really only useful when you compile.

 On Jan 14, 12:07 pm, mably fm2...@mably.com wrote:



  Oops, sorry...  It's asynchronous, so my list object is most probably
  always null when I read it.

  What is strange is why it's not null in development mode

  Is runAsync running synchronously in dev mode ?

  On 14 jan, 13:29, mably fm2...@mably.com wrote:

   Hi everybody,

   I have some GWT 2.0 runAsync code that works perfectly fine in dev
   mode but fails in normal mode.

   Is it a GWT bug or am I doing something wrong ?

   Is there some way to identify where the probleme comes from exactly ?

   The only information I have is a Chrome Developer Tools javascript
   error that says : Uncaught TypeError: Cannot call method 'Lc' of
   null.  And nothing in Eclipse while running in dev mode.

   Here is my java code using runAsync :

   public class GwtListHelper {

           private MapString, GwtList lists = new HashMapString, 
   GwtList();

           public GwtList getList(String type) {
                   GwtList list = lists.get(type);
                   if (list == null) {
                           ListWrapper lw = new ListWrapper();
                           getListAsync(type, lw);
                           list = lw.getList();
                           lists.put(type, list);
                   }
                   return list;
           }

           private void getListAsync(final String type, final ListWrapper 
   lw) {
                   if (user.equals(type)) {
                           GWT.runAsync(new RunAsyncCallback() {
                                   public void onSuccess() {
                                           lw.setList(new UserList());
                                   }
                                   public void onFailure(Throwable reason) {
                                           Window.alert(type +  list not 
   loaded !);
                                   }
                           });
                   }
           }

           private class ListWrapper {
                   GwtList list;
                   public void setList(GwtList list) {
                           this.list = list;
                   }
                   public GwtList getList() {
                           return this.list;
                   }
           }

   }
-- 
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.




GWT 2.0 runAsync code works fine in development mode but fails in normal mode

2010-01-14 Thread mably
Hi everybody,

I have some GWT 2.0 runAsync code that works perfectly fine in dev
mode but fails in normal mode.

Is it a GWT bug or am I doing something wrong ?

Is there some way to identify where the probleme comes from exactly ?

The only information I have is a Chrome Developer Tools javascript
error that says : Uncaught TypeError: Cannot call method 'Lc' of
null.  And nothing in Eclipse while running in dev mode.

Here is my java code using runAsync :

public class GwtListHelper {

private MapString, GwtList lists = new HashMapString, GwtList();

public GwtList getList(String type) {
GwtList list = lists.get(type);
if (list == null) {
ListWrapper lw = new ListWrapper();
getListAsync(type, lw);
list = lw.getList();
lists.put(type, list);
}
return list;
}

private void getListAsync(final String type, final ListWrapper lw) {
if (user.equals(type)) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
lw.setList(new UserList());
}
public void onFailure(Throwable reason) {
Window.alert(type +  list not loaded 
!);
}
});
}
}

private class ListWrapper {
GwtList list;
public void setList(GwtList list) {
this.list = list;
}
public GwtList getList() {
return this.list;
}
}
}
-- 
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: GWT 2.0 runAsync code works fine in development mode but fails in normal mode

2010-01-14 Thread mably
Oops, sorry...  It's asynchronous, so my list object is most probably
always null when I read it.

What is strange is why it's not null in development mode

Is runAsync running synchronously in dev mode ?

On 14 jan, 13:29, mably fm2...@mably.com wrote:
 Hi everybody,

 I have some GWT 2.0 runAsync code that works perfectly fine in dev
 mode but fails in normal mode.

 Is it a GWT bug or am I doing something wrong ?

 Is there some way to identify where the probleme comes from exactly ?

 The only information I have is a Chrome Developer Tools javascript
 error that says : Uncaught TypeError: Cannot call method 'Lc' of
 null.  And nothing in Eclipse while running in dev mode.

 Here is my java code using runAsync :

 public class GwtListHelper {

         private MapString, GwtList lists = new HashMapString, GwtList();

         public GwtList getList(String type) {
                 GwtList list = lists.get(type);
                 if (list == null) {
                         ListWrapper lw = new ListWrapper();
                         getListAsync(type, lw);
                         list = lw.getList();
                         lists.put(type, list);
                 }
                 return list;
         }

         private void getListAsync(final String type, final ListWrapper lw) {
                 if (user.equals(type)) {
                         GWT.runAsync(new RunAsyncCallback() {
                                 public void onSuccess() {
                                         lw.setList(new UserList());
                                 }
                                 public void onFailure(Throwable reason) {
                                         Window.alert(type +  list not loaded 
 !);
                                 }
                         });
                 }
         }

         private class ListWrapper {
                 GwtList list;
                 public void setList(GwtList list) {
                         this.list = list;
                 }
                 public GwtList getList() {
                         return this.list;
                 }
         }



 }
-- 
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.