Fixing Internet Explorer specific memory leaks (circular references, etc)

2010-11-07 Thread Paul McLachlan
I’d like to chronicle my experiences fixing a memory leak in our
enterprise GWT application when running on Internet Explorer.

A few facts getting started:

  1. Using a click-recording tool, QA could get our application to
leak hundreds of megabytes of memory in Internet Explorer.
  2. No leak measured using Java memory analysis tools in hosted mode.
  3. Non-trivial application - we have over 100K SLOC just for GWT
(ie, not counting server side or any non .java files)

Reproducibility was handled by QA, but the first problem was working
out what was going on.  We didn't see these kinds of problems with
Firefox  this strongly implies some kind of Internet Explorer
circular reference strangeness between DOM elements and javascript.

We spent some time playing with Drip and sIEve, but we were advised
not to use these tools (misleading output) and didn't have wonderful
success with them in any case.

A bit more googling found a javascript memory leak analyzer from
Microsoft at: 
http://blogs.msdn.com/b/gpde/archive/2009/08/03/javascript-memory-leak-detector-v2.aspx
.  That's actually the v2 and most google hits send you to a (now
removed v1), so it's a little difficult to find.

In any case, the results of using Microsoft's javascript memory leak
detector are basically unintelligible in a regular production mode GWT
compile.  I had more luck when compiling with -style PRETTY
(obviously), and I also turned on -draftCompile.  I think I remember
that -draftCompile did less inlining, which made the generated
javascript closer to our Java code.  This was important because the
output of the tool is basically a series of leaks, like:

 DIV leaked due to onclick from stack XYZ

where XYZ is a javascript stack trace of where the onclick event
handler was set.  By clicking back up the stack you can generally get
a reasonable idea of which widget in your application is causing the
problem.

At this point, I didn't actually trust the tool - so from a
methodology perspective my first step was to validate the tools
output.

I commented out code and otherwise configured our application down to
a bare-bones login, display a couple of things, logout script that I
could run in a loop.  Having done so, I could demonstrate that:

a) that operational loop actually leaked in IE
b) the tool reported about 15 elements as being leaked

Then, I proceeded to ... try to fix those leaks.

First attempt was to click the ClickListener (or ClickHandler or
KeyPressHandler or whatever).  I mean, calling Handler.remove(), or
removeClickListener() during onDetach().  My theory was that my
ClickHandler was a Java inner class and it somehow just had an inline
reference to the parent object and etc.

No joy.  The tool still reported it as a leak.  I've since spent a lot
more time going through GWT's implementation of event handling and
it's pretty clear that:

a) the intent is to not have to do this; and
b) it doesn't set element.onclick = null

I understand the argument with b) is that you don't have to.  I wasn't
feeling very trusting at this point (I had a memory leak tool from
Microsoft that seemed to disagree with that), so I thought I'd test
it.

Reading http://javascript.crockford.com/memory/leak.html gave me an
idea, so I wrote a little helper method:

  public native static void purgeEventHooks( Element elem, boolean
recurse ) /*-{
try {
  elem.onclick = null;
  elem.ondblclick = null;
  elem.onmousedown = null;
  elem.onmouseup = null;
  elem.onmouseover = null;
  elem.onmouseout = null;
  elem.onmousemove = null;
  elem.onkeydown = null;
  elem.onkeypress = null;
  elem.onkeyup = null;
  elem.onchange = null;
  elem.onfocus = null;
  elem.onblur = null;
  elem.onlosecapture = null;
  elem.onscroll = null;
  elem.onload = null;
  elem.onerror = null;
  elem.onmousewheel = null;
  elem.oncontextmenu = null;
  elem.onpaste = null;

  if (recurse) {
var a = elem.childNodes;
if (a) {
l = a.length;
for (i = 0; i  l; i += 1) {
purgeEventHooks(elem.childNodes[i], recurse);
}
}
  }
} catch( e ) {
  //  ignore
}
  }-*/;


And then proceeded to call it from onDetach() on the leaked element.

Aha - magic -- the Microsoft javascript leak tool no longer reports
that element as a leak!

However, it seems quite possible that all I've managed to do is fool
the leak tool, as opposed to actually fix any leak.  So I resolve to
fix all of the leaks on this code path.  I eventually managed to do
this (gosh, it was painful -- mostly because it's very difficult from
a javascript stacktrace to where onclick was called to work out which
custom GWT widget is ultimately involved).

Now I have the leak tool reporting no leaks.  So, I turn it off and
put the application back into a loop in Internet Explorer --- half
expecting to see it still leaking tens of megabytes and being back

Re: GWT + JDO (GAE)

2010-11-07 Thread Didier Durand
Hi Caio,

You should post this in Google App Engine group: better chance for
responses.

regards
didier

On Nov 7, 2:42 am, Caio caio.nery1...@yahoo.com.br wrote:
 Hello, guys.

 I've been using JDO these weeks. I've followed the tutorial at GAE
 Docs, and I learned how to create and get entity objects.

 I've created a class 'User' for my system. This class has the
 attributes username(String), password(String), isOnline(boolean) and
 score(int).

 I've succeeded at updating the isOnline attribute, but when I tried to
 update the score attribute, I've failed. The return value of the
 setter is always true, but the score value is not updated. Could you
 give any help?

 @Override

 public boolean setScore(String userName, int increment) {

 PersistenceManager pm = PMF.get().getPersistenceManager();

 Transaction tx = pm.currentTransaction();

 User user;

 boolean returnValue;

 try {

 tx.begin();

 user = pm.getObjectById(User.class, userName);

 //--detaching-attaching

 pm.makePersistent(user);

 User auxUser = (User) pm.detachCopy(user);

 auxUser.setScore(increment);

 pm.makePersistent(auxUser);

 returnValue = true;

 tx.commit();

 //--detaching-attaching

 } catch (NullPointerException ex) {

 returnValue = false;

 } catch (JDOObjectNotFoundException ex) {

 user = null;

 returnValue = false;

 } finally {

 if (tx.isActive()) {

 tx.rollback();

 }

 pm.close();

 }

 return returnValue;

-- 
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 + JDO (GAE)

2010-11-07 Thread Shawn Brown
 Hi,

 I've been using JDO these weeks. I've followed the tutorial at GAE
 Docs, and I learned how to create and get entity objects.

It just my opinion based on struggling with JDO that objectify is much
easier to use.  Much much much easier.

http://code.google.com/p/objectify-appengine/

Shawn

-- 
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 MVP Roo - where are custom events and their handlers?

2010-11-07 Thread Thomas Broyer


On 7 nov, 06:46, zixzigma zixzi...@gmail.com wrote:
 in MVP samples: Contact 1 and Contact 2,
 eventBus is used  for communicating application level events.
 with eventBus, one part of application informs other interested parts
 of certain events, so they can take appropriate action. code:
 public class AddContactEvent extends GwtEventAddContactEventHandler
 

 for example: when an item is selected in left panel, an event can be
 fired with the ID of selected item, so the center panel can update
 with relavant info.
 we had to write custom Event classes extending GwtEvent, and firing
 events.

 however, in Roo generated GWT MVP, Expenses App, i don't see events
 being used in manner i described above.
 the eventBus mainly is in charge of Navigation/Activity/Place/
 History ... that i can see,
 but custom events, to facilitate communication between different part
 of the app, i dont see.
 there are packages for ui, activity, but not for event.

 can someone please help ?

There's no need for custom events in the scaffold application, they're
replaced with navigation-oriented events (PlaceController#goTo,
which fires PlaceChangeRequestEvent and PlaceChangeEvent, handled by
the ActivityManager to switch Activities) and RequestFactory's
EntityProxyChange data-oriented events.

-- 
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 MVP ROO getBackButtonPlace()

2010-11-07 Thread Thomas Broyer

On 7 nov, 06:35, zixzigma zixzi...@gmail.com wrote:
 can someone please explain what exactly is this? (in Roo generated GWT
 MVP code, expenses app)

         public Place getBackButtonPlace() {
                 return ScaffoldMobileApp.ROOT_PLACE;
         }

 i see it in all generated Activities.
 why is there a reference to ScaffoldMobileApp ?
 normal web/desktop applications use backbutton too,
 why only mobile is in there ?

I haven't checked, but I believe this is because the Scaffold
desktop app shows both master and details activities on the
screen at the same time, whereas the mobile app shows either one or
the other, with a link from the details activity back to the
master one. This place is related to this link, not to browser
history handling (where the place comes from the URL)

-- 
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: Dynamic EntityManagerFactory creation and RequestFactory service stubs problem

2010-11-07 Thread Thomas Broyer


On 7 nov, 02:56, Jack mlsubscri...@gmail.com wrote:
 Ok it works like a charm with a custom RequestTransport and a custom
 header. Thanks for that tip!

 But RequestFactory docs should really mention what to add to web.xml
 and that you need a json implementation from json.org and a
 javax.validation implementation in your server classpath to make
 things work with Eclipse + GWT Plugin + Jetty. Otherwise you got some
 nice java.lang.NoClassDefFoundError from jetty.

You can use the gwt-servlet-deps.jar which includes those required
dependencies (unless you're using Maven, in which case you'd add
dependencies to javax.validation and json in your pom)

-- 
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: Dynamic EntityManagerFactory creation and RequestFactory service stubs problem

2010-11-07 Thread Thomas Broyer


On 7 nov, 00:46, Jack mlsubscri...@gmail.com wrote:
 Oh that sounds pretty nice. Haven't realized that its possible that
 way.. hehe..and its not nasty at all :)
 I'll give it a try. Thanks!

 And a second question that comes to my mind:
 When using RequestFactory our domain objects are only defined by
 interfaces. Is there a class in the framework that posts some sort of
 PropertyChangeEvent on the provided EventBus whenever a property is
 changed on client-side (This event should be fired whenever a setter
 method is called on client side). If not is there a way to integrate
 such a feature?

On each setter call, no (this is because a RequestContext is a kind of
transaction: it accumulates changes to entity proxies and method
calls on the RequestContext –currently limited to a single method call
AFAIK– to later send them all in one go to the server when you call
fire()).
When the server responds, it tells the client to fire
EntityProxyChange events on the event bus, those are the ones you'll
listen to to update the rest of your app.
At least this is how I understand how it's supposed to be!

-- 
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.1 Activities + Code splitting + Gin

2010-11-07 Thread Nicolas Antoniazzi
Hi Phillipe.
i am going to try ProviderBundle.

I tried to migrate my application to gwtp just before the 2.1 release but I
reverted my changes for 3 reasons :

1 - I prefer to not depend too much on an external framework. I love all new
things that come in every new release of gwt and I am afraid that frameworks
become unsupported or do not follow new features. I had the exemple of a
friend who has prefered to use GXT instead of Pure GWT, and today, he cannot
use UiBinder or the new Handler mechanism. He is still using the old
listener way.
Today, GWT has released the new Activity ~ MVP part, with their own Place
system. At the moment, MVP of GWT seems less powerfull than the GWTP's one,
but the syntax is different. And tomorrow, maybe that directions will be
more different. So I prefer not taking the risk to have a situation like
with GXT.

2 - Declaration of Presenter / View looks too much complicated to me (but it
is a pure subjective vision :) ).
All the generation of ProxyPlace are too magical for me or not enough... By
instance, The automatic generation of a Place is something interesting, but
in the same time, it is too complicated to generate. I do not like the fact
to have to declare an interface which extends ProxyPlace, and references it
in a type litteral. I would have prefered to just have something like :

@Place(login);
@RunAsync
public class LoginActivity implement GwtpActivityLoginActivity.Presenter

public inteface Presenter {
 public void onLogin();
 ...
}

or something similar.
Today I prefer to stay on a manual code for this part instead of a half
generation that is (in my opinion) too complicated to declare.
Finally (for the code style part), I did not like the fact that we have to
use a local Widget variable in View and returns it with a asWidget() method
for UiBinder Views.
Today with GWT 2.1, all widgets implements IsWidget and provides a
asWidget(). But since we have to store a local instance of Widget inside of
view for UiBinder, it cannot be done automatically, we have to override it.
However, I understand that IsWidget was not ready when you first implemented
it. But today, it does not solve the problem of the local Widget variable.

3 - My application has two top div. One called root for the main part of
my application, and one called overlay for all elements that comes like a
filter over my root elements (to display overlay help, ...). They have both
some css declaration on them.
I did not find any way to reuse this system with GWTP. GWTP come with a
RootPresenter and I wanted to use a second RootPresenter plugged on overlay
div but it is not possible.
ActivityManager are more flexible for this, they have a setDisplay() method
to setup the top element to use.

Well, Phillipe, all those things are just my personal feelings for my
specifical needs. I think that GWTP is a great framework for a lot of
people.
Unfortunatly, in my case, I had to fight against it (maybe that it was a
design problem, but I am not sure), and there was all the more subjective
aspects (abouts framework overlay and code style) that made me go away.

In any case, Phillipe and Christian, thanks for your great work .
I am going to try ProviderBundle, maybe that I will be more comfortable with
it :)

Nicolas.

2010/11/7 PhilBeaudoin philippe.beaud...@gmail.com

 Hi Nicolas,

 If you start using AsyncProvider, you might be interested in GWTP's
 ProviderBundle at some point. The problem of AsyncProvider is that it
 may introduce too many split points, and you will often want to do
 some manual optimization and group a few things together behind the
 same split point. ProviderBundle makes that really easy to do.

 ProviderBundle is totally usable without the rest of GWTP. (Although
 I'd love to hear your reason for not using it. ;))

 Cheers,

   Philippe

 On Nov 6, 4:40 pm, Nicolas Antoniazzi nicolas.antonia...@gmail.com
 wrote:
  Thanks Thomas, I implemented something similar to what you said (I think)
  and it works fine ! All my activities are code splitted automatically
 now.
 
  I used the AsyncProviderT.
  I used a gin version compiled by gwtp team that include the AsyncProxy
  (althouth that I do not use gwtp for severals resons, thanks to gwtp dev
 for
  this :) ) .
 
  @Ashton, you can get it from here :
 http://code.google.com/p/gwt-platform/http://code.google.com/p/gwt-platform/downloads/detail?name=gin-r137.jar
 
  The usage of AsyncProviderT is very simple. It's exactly like a normal
  ProviderT instead that you have to give an AsyncCallback to the get()
  method.
  example :
 
  @Inject
  ProviderMyClass myProvider;
 
  @Inject
  AsyncProviderMyClass myAsyncProvider;
 
  private MyClass instance1;
  private MyClass instance2;
 
  public void myMethod() {
// To get an instance without code splitting
instance1 = myProvider.get();
 
// To get an instance with code splitting
myAsyncProvider.get(new AsyncCallbackMyClass() {
   @Override
  public void onSuccess(MyClass result) {
 

Re: GWT + MySQL

2010-11-07 Thread Paul Robinson
Is the mysql driver jar file in the server's runtime classpath? It ought 
to be in your war file.


On 05/11/10 13:23, Ross McKinnon wrote:

Hi there,

I've spent numerous hours this week trying to get my existing GWT
application to connect with an existing MySQL database with no luck.

I've created my code to connect to the database using JDBC and is kept
in the server package to ensure it remains as java code.  Also i have
included the mySQL jar file in the build path for the project but
still get an error

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver ...

I have tried numerous ways of getting the database and have ran out of
ideas now so thought I would consult the experts to see if any kind
person can lend a hang..

Thanks for any help,

Ross

   


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



Importing hellomvp

2010-11-07 Thread hezjing
Hi

I have downloaded Tutorial-hellomvp-2.1.zip, but there is no Eclipse project
metadata (the .project and .classpath files) in the archive.

May I know how to import and run hellomvp into Eclipse?


I think it would be very useful to include the Eclipse project metadata into
the archive, just like the Tutorial-Contacts.zip :-)


Thank you!

-- 

Hez

-- 
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.1 Activities + Code splitting + Gin

2010-11-07 Thread Christian Goudreau
I just want to answer some of your concern :D

1- We want to introduce and follow every release of Gwt. We already
introduced Gwt's evenbus instead of using ours and there's more changes on
the way. That's a long term engagement, even our contributor guideline
follows gwt.
2- You don't like the proxy's magic ? You can create them :D Proxy are used
for lasy instantiation of presenters and to facilitate code splitting while
keeping everything decoupled.
3- There's some way to do that with gwtp (PresenterWidget, proxy events).
But there's no reason  to only use Gwtp, even though we encourage it. I
think that activity manager can become handy for cases that we don't fully
support yet.

Cheers,

On Sun, Nov 7, 2010 at 6:49 AM, Nicolas Antoniazzi 
nicolas.antonia...@gmail.com wrote:

 Hi Phillipe.
 i am going to try ProviderBundle.

 I tried to migrate my application to gwtp just before the 2.1 release but I
 reverted my changes for 3 reasons :

 1 - I prefer to not depend too much on an external framework. I love all
 new things that come in every new release of gwt and I am afraid that
 frameworks become unsupported or do not follow new features. I had the
 exemple of a friend who has prefered to use GXT instead of Pure GWT, and
 today, he cannot use UiBinder or the new Handler mechanism. He is still
 using the old listener way.
 Today, GWT has released the new Activity ~ MVP part, with their own Place
 system. At the moment, MVP of GWT seems less powerfull than the GWTP's one,
 but the syntax is different. And tomorrow, maybe that directions will be
 more different. So I prefer not taking the risk to have a situation like
 with GXT.

 2 - Declaration of Presenter / View looks too much complicated to me (but
 it is a pure subjective vision :) ).
 All the generation of ProxyPlace are too magical for me or not enough... By
 instance, The automatic generation of a Place is something interesting, but
 in the same time, it is too complicated to generate. I do not like the fact
 to have to declare an interface which extends ProxyPlace, and references it
 in a type litteral. I would have prefered to just have something like :

 @Place(login);
 @RunAsync
 public class LoginActivity implement GwtpActivityLoginActivity.Presenter

 public inteface Presenter {
  public void onLogin();
  ...
 }

 or something similar.
 Today I prefer to stay on a manual code for this part instead of a half
 generation that is (in my opinion) too complicated to declare.
 Finally (for the code style part), I did not like the fact that we have to
 use a local Widget variable in View and returns it with a asWidget() method
 for UiBinder Views.
 Today with GWT 2.1, all widgets implements IsWidget and provides a
 asWidget(). But since we have to store a local instance of Widget inside of
 view for UiBinder, it cannot be done automatically, we have to override it.
 However, I understand that IsWidget was not ready when you first
 implemented it. But today, it does not solve the problem of the local Widget
 variable.

 3 - My application has two top div. One called root for the main part of
 my application, and one called overlay for all elements that comes like a
 filter over my root elements (to display overlay help, ...). They have both
 some css declaration on them.
 I did not find any way to reuse this system with GWTP. GWTP come with a
 RootPresenter and I wanted to use a second RootPresenter plugged on overlay
 div but it is not possible.
 ActivityManager are more flexible for this, they have a setDisplay() method
 to setup the top element to use.

 Well, Phillipe, all those things are just my personal feelings for my
 specifical needs. I think that GWTP is a great framework for a lot of
 people.
 Unfortunatly, in my case, I had to fight against it (maybe that it was a
 design problem, but I am not sure), and there was all the more subjective
 aspects (abouts framework overlay and code style) that made me go away.

 In any case, Phillipe and Christian, thanks for your great work .
 I am going to try ProviderBundle, maybe that I will be more comfortable
 with it :)

 Nicolas.

  2010/11/7 PhilBeaudoin philippe.beaud...@gmail.com

 Hi Nicolas,

 If you start using AsyncProvider, you might be interested in GWTP's
 ProviderBundle at some point. The problem of AsyncProvider is that it
 may introduce too many split points, and you will often want to do
 some manual optimization and group a few things together behind the
 same split point. ProviderBundle makes that really easy to do.

 ProviderBundle is totally usable without the rest of GWTP. (Although
 I'd love to hear your reason for not using it. ;))

 Cheers,

   Philippe

 On Nov 6, 4:40 pm, Nicolas Antoniazzi nicolas.antonia...@gmail.com
 wrote:
  Thanks Thomas, I implemented something similar to what you said (I
 think)
  and it works fine ! All my activities are code splitted automatically
 now.
 
  I used the AsyncProviderT.
  I used a gin version compiled by gwtp team that include the 

Re: Gwt 2.1 Activities + Code splitting + Gin

2010-11-07 Thread Christian Goudreau
More info on my number 3 comment.
I just saw a comment from Philippe saying that mixing activity and place is
discouraged for the  moment. Comming from what I say in one, I think this
comment will be more appropriate for future release :D

Cheers,

On Sun, Nov 7, 2010 at 7:42 AM, Christian Goudreau 
goudreau.christ...@gmail.com wrote:

 I just want to answer some of your concern :D

 1- We want to introduce and follow every release of Gwt. We already
 introduced Gwt's evenbus instead of using ours and there's more changes on
 the way. That's a long term engagement, even our contributor guideline
 follows gwt.
 2- You don't like the proxy's magic ? You can create them :D Proxy are used
 for lasy instantiation of presenters and to facilitate code splitting while
 keeping everything decoupled.
 3- There's some way to do that with gwtp (PresenterWidget, proxy events).
 But there's no reason  to only use Gwtp, even though we encourage it. I
 think that activity manager can become handy for cases that we don't fully
 support yet.

 Cheers,

 On Sun, Nov 7, 2010 at 6:49 AM, Nicolas Antoniazzi 
 nicolas.antonia...@gmail.com wrote:

 Hi Phillipe.
 i am going to try ProviderBundle.

 I tried to migrate my application to gwtp just before the 2.1 release but
 I reverted my changes for 3 reasons :

 1 - I prefer to not depend too much on an external framework. I love all
 new things that come in every new release of gwt and I am afraid that
 frameworks become unsupported or do not follow new features. I had the
 exemple of a friend who has prefered to use GXT instead of Pure GWT, and
 today, he cannot use UiBinder or the new Handler mechanism. He is still
 using the old listener way.
 Today, GWT has released the new Activity ~ MVP part, with their own Place
 system. At the moment, MVP of GWT seems less powerfull than the GWTP's one,
 but the syntax is different. And tomorrow, maybe that directions will be
 more different. So I prefer not taking the risk to have a situation like
 with GXT.

 2 - Declaration of Presenter / View looks too much complicated to me (but
 it is a pure subjective vision :) ).
 All the generation of ProxyPlace are too magical for me or not enough...
 By instance, The automatic generation of a Place is something interesting,
 but in the same time, it is too complicated to generate. I do not like the
 fact to have to declare an interface which extends ProxyPlace, and
 references it in a type litteral. I would have prefered to just have
 something like :

 @Place(login);
 @RunAsync
 public class LoginActivity implement GwtpActivityLoginActivity.Presenter

 public inteface Presenter {
  public void onLogin();
  ...
 }

 or something similar.
 Today I prefer to stay on a manual code for this part instead of a half
 generation that is (in my opinion) too complicated to declare.
 Finally (for the code style part), I did not like the fact that we have to
 use a local Widget variable in View and returns it with a asWidget() method
 for UiBinder Views.
 Today with GWT 2.1, all widgets implements IsWidget and provides a
 asWidget(). But since we have to store a local instance of Widget inside of
 view for UiBinder, it cannot be done automatically, we have to override it.
 However, I understand that IsWidget was not ready when you first
 implemented it. But today, it does not solve the problem of the local Widget
 variable.

 3 - My application has two top div. One called root for the main part of
 my application, and one called overlay for all elements that comes like a
 filter over my root elements (to display overlay help, ...). They have both
 some css declaration on them.
 I did not find any way to reuse this system with GWTP. GWTP come with a
 RootPresenter and I wanted to use a second RootPresenter plugged on overlay
 div but it is not possible.
 ActivityManager are more flexible for this, they have a setDisplay()
 method to setup the top element to use.

 Well, Phillipe, all those things are just my personal feelings for my
 specifical needs. I think that GWTP is a great framework for a lot of
 people.
 Unfortunatly, in my case, I had to fight against it (maybe that it was a
 design problem, but I am not sure), and there was all the more subjective
 aspects (abouts framework overlay and code style) that made me go away.

 In any case, Phillipe and Christian, thanks for your great work .
 I am going to try ProviderBundle, maybe that I will be more comfortable
 with it :)

 Nicolas.

  2010/11/7 PhilBeaudoin philippe.beaud...@gmail.com

 Hi Nicolas,

 If you start using AsyncProvider, you might be interested in GWTP's
 ProviderBundle at some point. The problem of AsyncProvider is that it
 may introduce too many split points, and you will often want to do
 some manual optimization and group a few things together behind the
 same split point. ProviderBundle makes that really easy to do.

 ProviderBundle is totally usable without the rest of GWTP. (Although
 I'd love to hear your reason for not using 

Re: GWT + JDO (GAE)

2010-11-07 Thread Jeff Schwartz
+1

On Sun, Nov 7, 2010 at 5:46 AM, Shawn Brown big.coffee.lo...@gmail.comwrote:

  Hi,

  I've been using JDO these weeks. I've followed the tutorial at GAE
  Docs, and I learned how to create and get entity objects.

 It just my opinion based on struggling with JDO that objectify is much
 easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

 Shawn

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
Jeff

-- 
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: Importing hellomvp

2010-11-07 Thread ciosbel
Simply create a new java project from existing sources.
Once imported, modify the project properties in order to use gwt 2.1
sdk and the project build path in order to have something like
hellomvp/war/WEB-INF/classes as output directory.

On 7 Nov, 13:04, hezjing hezj...@gmail.com wrote:
 Hi

 I have downloaded Tutorial-hellomvp-2.1.zip, but there is no Eclipse project
 metadata (the .project and .classpath files) in the archive.

 May I know how to import and run hellomvp into Eclipse?

 I think it would be very useful to include the Eclipse project metadata into
 the archive, just like the Tutorial-Contacts.zip :-)

 Thank you!

 --

 Hez

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



when doing async re-use htc pre-downloaded

2010-11-07 Thread asianCoolz
my css body {
 behavior: url(csshover3.htc);
}


i using async uibinder to get portion of the html. those portion html
are not hover enabled .  i try put

.outerloop_asynchmlt {

 behavior: url(csshover3.htc);

}


this make the async request become very slow. i guess, it was due to
time take to re-download the csshover3.htc.   how to re-use  htc file
when using async?

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



Help needed for [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag at startup (java -Xss1M ...)

2010-11-07 Thread Jeff Schwartz
When running in development mode I get the following error:

[ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag
at startup (java -Xss1M ...)

1) Is this error common or does it indicate something seriously wrong with
my application?

2) What  how do I configure to avoid this error?

Thanks in advance.

Jeff

-- 
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.1.0 maven asks for com.google.gwt:gwt-dev:jar:windows:2.1.0??

2010-11-07 Thread Jeff Larsen
I get the same error.

I tried added gwt-dev 2.1.0 as a test dependency, but then it wants me
go to URLs in a browser... I just want it to run my test suite.

On Nov 6, 8:08 pm, Yaakov yaakov.chai...@gmail.com wrote:
 Well, I tried that. It now fails with this in the testing phase:

 *
 [INFO] [gwt:test {execution: test}]
 [ERROR] java.lang.NoClassDefFoundError: com/google/gwt/dev/cfg/
 Condition
 [ERROR]         at
 com.google.gwt.junit.client.GWTTestCase.createStrategy(GWTTestCase.java:
 355)
 [ERROR]         at
 com.google.gwt.junit.client.GWTTestCase.getStrategy(GWTTestCase.java:
 272)
 [ERROR]         at
 com.google.gwt.junit.client.GWTTestCase.getSyntheticModuleName(GWTTestCase. 
 java:
 290)
 [ERROR]         at
 com.google.gwt.junit.client.GWTTestCase.setName(GWTTestCase.java:336)
 [ERROR]         at junit.framework.TestSuite.createTest(TestSuite.java:
 63)
 [ERROR]         at
 junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
 [ERROR]         at junit.framework.TestSuite.init(TestSuite.java:
 146)
 [ERROR]         at junit.framework.TestSuite.init(TestSuite.java:
 175)
 [ERROR]         at
 junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:117)
 [ERROR]         at junit.textui.TestRunner.start(TestRunner.java:179)
 [ERROR]         at
 org.codehaus.mojo.gwt.test.MavenTestRunner.main(MavenTestRunner.java:
 63)
 [ERROR] Caused by: java.lang.ClassNotFoundException:
 com.google.gwt.dev.cfg.Condition
 [ERROR]         at java.net.URLClassLoader$1.run(URLClassLoader.java:
 202)
 [ERROR]         at java.security.AccessController.doPrivileged(Native
 Method)
 [ERROR]         at
 java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 [ERROR]         at java.lang.ClassLoader.loadClass(ClassLoader.java:
 307)
 [ERROR]         at sun.misc.Launcher
 $AppClassLoader.loadClass(Launcher.java:301)
 [ERROR]         at java.lang.ClassLoader.loadClass(ClassLoader.java:
 248)
 [ERROR]         ... 11 more
 [ERROR] com/google/gwt/dev/cfg/Condition
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] There was test failures.
 *

 On Nov 5, 6:49 pm, Thomas Broyer t.bro...@gmail.com wrote:







  On 5 nov, 22:01, Yaakov Chaikin yaakov.chai...@gmail.com wrote:

   Never mind... It was the version of the gwt-maven-plugin... However,
   now, I can't get it to install. What version of the gwt-maven-plugin
   am I supposed to use with the latest 2.1.0 release of GWT and which
   repository does it reside in?

  You can use either the 1.3.2.google version from 
  thehttp://google-web-toolkit.googlecode.com/svn/2.1.0/gwt/maven/
  repository, or the 2.1.0 version from Maven Central (released today)

-- 
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: Help needed for [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag at startup (java -Xss1M ...)

2010-11-07 Thread Jeff Chimene
It's not an unusual condition. It is entirely possible that your compiled
project code exceeds the default stack allocation. One thing I've found is
that simply adding an element or two to a UI XML will cause this exception.
Increase the stack size. Also, this has been discussed previously on this
list.

Cheers,
jec


On Sun, Nov 7, 2010 at 8:10 AM, Jeff Schwartz jefftschwa...@gmail.comwrote:

 When running in development mode I get the following error:

 [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag
 at startup (java -Xss1M ...)

 1) Is this error common or does it indicate something seriously wrong with
 my application?

 2) What  how do I configure to avoid this error?

 Thanks in advance.

 Jeff

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
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 + JDO (GAE)

2010-11-07 Thread nacho
+1

On 7 nov, 11:17, Jeff Schwartz jefftschwa...@gmail.com wrote:
 +1

 On Sun, Nov 7, 2010 at 5:46 AM, Shawn Brown big.coffee.lo...@gmail.comwrote:



   Hi,

   I've been using JDO these weeks. I've followed the tutorial at GAE
   Docs, and I learned how to create and get entity objects.

  It just my opinion based on struggling with JDO that objectify is much
  easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

  Shawn

  --
  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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 Jeff

-- 
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 + MySQL

2010-11-07 Thread nacho
Are you running the app in the Jetty server provided by the Google
plugin?

This server emulates appengine enviroment and you must use classes
that are in the appengine whitelist:
http://code.google.com/intl/es-AR/appengine/docs/java/jrewhitelist.html

Try running your app in a Tomcat.

On 7 nov, 08:52, Paul Robinson ukcue...@gmail.com wrote:
 Is the mysql driver jar file in the server's runtime classpath? It ought
 to be in your war file.

 On 05/11/10 13:23, Ross McKinnon wrote:

  Hi there,

  I've spent numerous hours this week trying to get my existing GWT
  application to connect with an existing MySQL database with no luck.

  I've created my code to connect to the database using JDBC and is kept
  in the server package to ensure it remains as java code.  Also i have
  included the mySQL jar file in the build path for the project but
  still get an error

  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver ...

  I have tried numerous ways of getting the database and have ran out of
  ideas now so thought I would consult the experts to see if any kind
  person can lend a hang..

  Thanks for any help,

  Ross

-- 
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 + JDO (GAE)

2010-11-07 Thread Didier Durand
Hi,

Also agree about Objectify: use it with great satisfaction.
didier

On Nov 7, 11:46 am, Shawn Brown big.coffee.lo...@gmail.com wrote:
  Hi,

  I've been using JDO these weeks. I've followed the tutorial at GAE
  Docs, and I learned how to create and get entity objects.

 It just my opinion based on struggling with JDO that objectify is much
 easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

 Shawn

-- 
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: Help needed for [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag at startup (java -Xss1M ...)

2010-11-07 Thread Jeff Chimene
On 11/07/2010 09:17 AM, Jeff Schwartz wrote:
 Thanks, Jeff. I modified my run configuration in Eclipse adding -Xss1M
 (please see the attached image). I still get the same error. Also, using
 Google Reader I searched the group for similar messages but I couldn't
 find any.
 
 BTW I am running on Windows Vista and using Eclipse Helios.
 
 Maybe I am configuring this incorrectly. Any suggestions?
 
 Thanks.
 
 Jeff

I found this reference:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/79edcc887785a283

It talks about -Xmx, not -Xss

Have you tried increasing the -Xmx setting?

-- 
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 debugging under Linux is much slower than under Windows - what's wrong with my configuration?

2010-11-07 Thread ussuri
Hello!

I recently switched from Windows 7 to Ubuntu for GWT development, and
I am seriously considering moving back, as GWT debugging under Linux
(Debug as Web Application in Eclipse) is painful - much slower than
under Windows.

My test: same project/code (GWT front-end, GAE back-end). While on the
project page (fully loaded), I hit browser's refresh button, type
login credentials into the login dialog (part of my GWT app) and then
wait until I see my page with some data from GAE (also in the
debugger, in the same Eclipse workspace, different project). Measure
time. Then I hit refresh and login and wait until I see full page
with data. Measure time. And again. And again.

In Linux, it consistently takes about 21-28 seconds from refresh to
destination page. Sometimes refresh never finishes, so I have to
close the tab and open a new one. Even typing credentials is slow, as
there is a noticeable delay (~1sec) between a key press and a symbol
appearing in the text box (only under the debugger/plugin; compiled
javascript is relatively fast).

In Windows, it consistently takes 6-8 seconds (mostly typing) from
hitting refresh to the after login page. If I exclude 3-4 secs it
takes me to type credentials, linux will be ~8x times slower than
Windows.

What can I do to speed up GWT's debugger/plugin performance in Linux?

My set-up:

Linux: 64bit Ubuntu, desktop edition with linux-server kernel; the
latest sun java x64 jdk/jre; Eclipse 3.6, GWT 2.1, AppEngine 1.8. GWT
plugin for Google Chrome (Firefox plugin fails to install, probably
because of x64 environment).

Windows: 64bit Win 7; latest Java, same eclipse/gwt/appengine. GWT
plugin for Firefox.

Same computer (Intel i3 quad core, 7200 rpm hdd, 4GB RAM) - dualboot,
no VMs.

What's wrong with my set-up? Is there anything I can do to improve GWT
debugging performance under Linux?

Regards,
MG

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



ProxyPlace: converting a token to EntityProxy

2010-11-07 Thread Y2i
I'd like to implement something similar to non-existent ProxyPlace:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?com/google/gwt/app/place/ProxyPlace.html

Is there a standard way to convert a token to a sub-class of
EntityProxy in PlaceTokenizerP.getPlace(String token)?
Should I use my own sub-class of AbstractPlaceHistoryMapperF instead
of combination of PlaceTokenizerP and PlaceHistoryMapper?
If AbstractPlaceHistoryMapperF is the best alternative, what would
be the best candidate for a token?  Should it be a string
representation of Entity's ID or something else?

Your thoughts will be greatly appreciated!
Yuri

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



Expenses sample failure

2010-11-07 Thread har_shan
i just checked out expenses sample project from trunk and seeing
compilation errors in eclipse:
http://google-web-toolkit.googlecode.com/svn/trunk/samples/expenses

In class Styles, Line 120, 163, 166 etc.

com.google.gwt.sample.expenses.client.style.Styles can not be found in
source packages. Check the inheritance chain from your module; it may
not be inheriting a required module or a module may not be adding its
source path entries properly.

1 quick fix available, Import GWT module
com.google.gwt.sample.expenses.client.style.Style

Similarly lots of classes in package
com.google.gwt.sample.expenses.shared has compilation errors.

com.google.gwt.sample.expenses.server.domain.Employee can not be found
in source packages. Check the inheritance chain from your module; it
may not be inheriting a required module or a module may not be adding
its source path entries properly.

My env:

Eclipse Helios with latest GPE 1.4 which correctly (automatically)
configured GWT 2.1 and GAE 1.3.7 (to SDKs that are there in local
repo) as specified in expenses POM.

Am i missing sth?

-- 
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: SelectionModel and ListDataProvider are out of synch

2010-11-07 Thread Mirco Dotta
Hi John,


 The SelectionModel shouldn't depend on the data in the ListDataProvider
 because it is independent of the data source.  Consider a SelectionModel
 that has an option to select all unread messages.  You probably don't have
 all of the user messages loaded on the client, but the unread messages
 should be selected as you page through the table, without having to update
 the SelectionModel each time you load a new page.  

Your point makes sense and I see now why the SelectionModel
has been designed not to be tighted to the data provider. It is about
flexibility
and by having this design, it is easier (and feasible) to integrate a
selection model
when data is loaded asynchronously.

 Can you deselect the value in the SelectionModel when you remove the row in
 your onClick handler?

Yes, this is what I'm currently doing... it is just that, at first
thought, it didn't
feel right. I was believing that removing an item from the data list
should have automagically
removed the item from the selection model. I just thought that the
operation should have been
transparent to API's clients. But I see that data pagination is a hard
problem if you set a hard link
between the selection model and the data provider, which gives me an
explanation of the current
design.

Thank you again for your answer and, please, feel free to correct me
if my comments are wrong (or just
not understandable :).

-- Mirco

-- 
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: extending PushButton results in invalid child namespace error in UIBinder

2010-11-07 Thread KaffeineComa
Ah, so simple.  Thanks!

On Nov 5, 2:53 am, Amir Kashani amirkash...@gmail.com wrote:
 Instead of g:upFace use widgets:upFace

 The namespace of the child element must match that of its parent.

 - Amir

 On Nov 4, 5:47 pm,KaffeineComakaffeinec...@gmail.com wrote:



  I have a simple class that extends PushButton to add a tooltip-like
  popup. It seems that if I try to use this class in UIBinder with
  PushButton's upFace, I get an invalid child namespace error:

   widgets:PushButtonWithToolTip ui:field=prevButton
  toolTipText=previous lesson
        g:upFace image='{res.back}'
              previous lesson
        /g:upFace
    /widgets:PushButtonWithToolTip

  I have the namespace defined properly as
  xmlns:widgets='urn:import:com.example.widgets', and this works fine
  until I add the g:upFace child element.

  It was also working fine as:

   g:PushButton ui:field=prevButton toolTipText=previous lesson
        g:upFace image='{res.back}'
              previous lesson
        /g:upFace
    /g:PushButton

  It seems to only be a problem with a custom PushButton subclass that
  also specifies a child element.

  Thanks for any pointers.

-- 
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: Show Hide Reorder Columns like adwords UI

2010-11-07 Thread ycol
Anybody?
Seems like the basic features one would require for a data based
application.

On Nov 6, 8:36 am, ycol y...@hotmail.com wrote:
 Hi,
 I would like to know how to implementshow,hideand reorder columns
 for a cellTable.
 I see the ability on the UI for the adwords/key word tool.
 There is a 'Columns' button on top of a datatable.
 Clicking the button allows the user to customize the columns.
 Thank you
 GWTNewbie

-- 
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: Invalid version number errror after upgrading from 2.1 M2 to M3

2010-11-07 Thread Gustavo Insaurralde
clean the cache worked for me too.

Thanx

On 8 oct, 14:58, David Chandler (Google) drfibona...@google.com
wrote:
 This is only an issue running in hosted mode, so your production
 clients won't be affected.

 --
 David Chandler
 Developer Programs Engineer, Google Web Toolkit
 Atlanta, GA USA

 On Oct 8, 11:45 am, Kashif kashifshaikh...@gmail.com wrote:







  This also worked for me.  I wonder though - if I deploy GWT app in
  Production and need to downgrade - how will my clients be forced to
  refresh the file?

  On Sep 24, 5:54 pm, bohemian glen.edmo...@gmail.com wrote:

   FYI clearing the browser cache worked for me.

-- 
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: Help needed for [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag at startup (java -Xss1M ...)

2010-11-07 Thread Jeff Schwartz
Thanks, Jeff. Xmx was and is currently set at 512m. I upped my stack memory
to 50m but still throws the same error.

Ideas, anyone?

Jeff

On Sun, Nov 7, 2010 at 12:22 PM, Jeff Chimene jchim...@gmail.com wrote:

 On 11/07/2010 09:17 AM, Jeff Schwartz wrote:
  Thanks, Jeff. I modified my run configuration in Eclipse adding -Xss1M
  (please see the attached image). I still get the same error. Also, using
  Google Reader I searched the group for similar messages but I couldn't
  find any.
 
  BTW I am running on Windows Vista and using Eclipse Helios.
 
  Maybe I am configuring this incorrectly. Any suggestions?
 
  Thanks.
 
  Jeff

 I found this reference:

 http://groups.google.com/group/google-web-toolkit/browse_thread/thread/79edcc887785a283

 It talks about -Xmx, not -Xss

 Have you tried increasing the -Xmx setting?

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
Jeff

-- 
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: ProxyPlace: converting a token to EntityProxy

2010-11-07 Thread Thomas Broyer


On 7 nov, 18:59, Y2i yur...@gmail.com wrote:
 I'd like to implement something similar to non-existent 
 ProxyPlace:http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?c...

 Is there a standard way to convert a token to a sub-class of
 EntityProxy in PlaceTokenizerP.getPlace(String token)?

RequestFactory#getProxyId
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/requestfactory/shared/RequestFactory.html#getProxyId(java.lang.String)
(if you used getHistoryToken to generate the token, of course)

 Should I use my own sub-class of AbstractPlaceHistoryMapperF instead
 of combination of PlaceTokenizerP and PlaceHistoryMapper?

No, you have to create a PlaceTokenizer for the ProxyPlace, which
you'll initialize with a RequestFactory instance (which means you have
to use PlaceHistoryMapperWithFactory with a method in your factory
creating the PlaceTokenizer with the RequestFactory)

You can actually find the code for ProxyPlace et al. if you go back in
history in the SVN repository.
(or download GWT 2.1 M3 for example, which contained them)

-- 
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: Fixing Internet Explorer specific memory leaks (circular references, etc)

2010-11-07 Thread Slava Lovkiy
Thanks Paul for sharing your experience with resolving memory leaks, I
think it worth a separate blog post.

Few questions:
1. what version of IE did you use during the testing ?
2. was the performance of the app improved after resolving the memory
leaks ?

Best regards,
Slava Lovkiy

On Nov 7, 7:10 pm, Paul McLachlan pmclach...@gmail.com wrote:
 I’d like to chronicle my experiences fixing a memory leak in our
 enterprise GWT application when running on Internet Explorer.

 A few facts getting started:

   1. Using a click-recording tool, QA could get our application to
 leak hundreds of megabytes of memory in Internet Explorer.
   2. No leak measured using Java memory analysis tools in hosted mode.
   3. Non-trivial application - we have over 100K SLOC just for GWT
 (ie, not counting server side or any non .java files)

 Reproducibility was handled by QA, but the first problem was working
 out what was going on.  We didn't see these kinds of problems with
 Firefox  this strongly implies some kind of Internet Explorer
 circular reference strangeness between DOM elements and javascript.

 We spent some time playing with Drip and sIEve, but we were advised
 not to use these tools (misleading output) and didn't have wonderful
 success with them in any case.

 A bit more googling found a javascript memory leak analyzer from
 Microsoft 
 at:http://blogs.msdn.com/b/gpde/archive/2009/08/03/javascript-memory-lea...
 .  That's actually the v2 and most google hits send you to a (now
 removed v1), so it's a little difficult to find.

 In any case, the results of using Microsoft's javascript memory leak
 detector are basically unintelligible in a regular production mode GWT
 compile.  I had more luck when compiling with -style PRETTY
 (obviously), and I also turned on -draftCompile.  I think I remember
 that -draftCompile did less inlining, which made the generated
 javascript closer to our Java code.  This was important because the
 output of the tool is basically a series of leaks, like:

  DIV leaked due to onclick from stack XYZ

 where XYZ is a javascript stack trace of where the onclick event
 handler was set.  By clicking back up the stack you can generally get
 a reasonable idea of which widget in your application is causing the
 problem.

 At this point, I didn't actually trust the tool - so from a
 methodology perspective my first step was to validate the tools
 output.

 I commented out code and otherwise configured our application down to
 a bare-bones login, display a couple of things, logout script that I
 could run in a loop.  Having done so, I could demonstrate that:

 a) that operational loop actually leaked in IE
 b) the tool reported about 15 elements as being leaked

 Then, I proceeded to ... try to fix those leaks.

 First attempt was to click the ClickListener (or ClickHandler or
 KeyPressHandler or whatever).  I mean, calling Handler.remove(), or
 removeClickListener() during onDetach().  My theory was that my
 ClickHandler was a Java inner class and it somehow just had an inline
 reference to the parent object and etc.

 No joy.  The tool still reported it as a leak.  I've since spent a lot
 more time going through GWT's implementation of event handling and
 it's pretty clear that:

 a) the intent is to not have to do this; and
 b) it doesn't set element.onclick = null

 I understand the argument with b) is that you don't have to.  I wasn't
 feeling very trusting at this point (I had a memory leak tool from
 Microsoft that seemed to disagree with that), so I thought I'd test
 it.

 Readinghttp://javascript.crockford.com/memory/leak.htmlgave me an
 idea, so I wrote a little helper method:

   public native static void purgeEventHooks( Element elem, boolean
 recurse ) /*-{
     try {
       elem.onclick = null;
       elem.ondblclick = null;
       elem.onmousedown = null;
       elem.onmouseup = null;
       elem.onmouseover = null;
       elem.onmouseout = null;
       elem.onmousemove = null;
       elem.onkeydown = null;
       elem.onkeypress = null;
       elem.onkeyup = null;
       elem.onchange = null;
       elem.onfocus = null;
       elem.onblur = null;
       elem.onlosecapture = null;
       elem.onscroll = null;
       elem.onload = null;
       elem.onerror = null;
       elem.onmousewheel = null;
       elem.oncontextmenu = null;
       elem.onpaste = null;

       if (recurse) {
         var a = elem.childNodes;
         if (a) {
             l = a.length;
             for (i = 0; i  l; i += 1) {
                 purgeEventHooks(elem.childNodes[i], recurse);
             }
         }
       }
     } catch( e ) {
       //  ignore
     }
   }-*/;

 And then proceeded to call it from onDetach() on the leaked element.

 Aha - magic -- the Microsoft javascript leak tool no longer reports
 that element as a leak!

 However, it seems quite possible that all I've managed to do is fool
 the leak tool, as opposed to actually fix any leak.  So I resolve to
 fix all of the leaks on this 

Re: Help needed for [ERROR] [lmv] Stack overflow; to increase the stack size, use the -Xss flag at startup (java -Xss1M ...)

2010-11-07 Thread Jeff Schwartz
Resolved  my bad (head slapping sound)!

I fell for an old trap: I made numerous changes to my code and 1st test
raised the error. Instead of checking for the new code causing the problem I
believed the exception  I blamed the environment.

The short of it is that I refactored a class to use an adapter to make
handling the numerous events easier. The problem is that originally my class
implemented the event listener's interface methods, overriding all of them
but  when I refactored the class to use the new adapter I couldn't extend it
from the adapter because it already was extending Composite so instead I
in-lined it as follows:

someClass.addSomeListener(new SomeModifiedListenerAdapter(){

@Override
public void somethingCreated(SomethingCreatedEvent
somethingCreatedEvent) {
somethingCreated(somethingCreatedEvent);
}

});

My class already had a somethingCreated(SomethingCreatedEvent
somethingCreatedEvent) method which I originally implemented to override the
listener's interface method so when I refactored the code to use the adapter
I intended to reuse that method but I forgot to rename it - BINGO - hence
the stack overrun and the thrown error.

I've now renamed the method in my class to
_somethingCreated(somethingCreatedEvent) and corrected the code as follow:
someClass.addSomeListener(new SomeModifiedListenerAdapter(){

@Override
public void somethingCreated(SomethingCreatedEvent
somethingCreatedEvent) {
_somethingCreated(somethingCreatedEvent);
}

});

Of course this fixed the problem  I've reset my JVM  parameters back to the
state they were in prior to having been so stupid.

:)

Jeff

On Sun, Nov 7, 2010 at 3:28 PM, Jeff Schwartz jefftschwa...@gmail.comwrote:

 Thanks, Jeff. Xmx was and is currently set at 512m. I upped my stack memory
 to 50m but still throws the same error.

 Ideas, anyone?

 Jeff


 On Sun, Nov 7, 2010 at 12:22 PM, Jeff Chimene jchim...@gmail.com wrote:

 On 11/07/2010 09:17 AM, Jeff Schwartz wrote:
  Thanks, Jeff. I modified my run configuration in Eclipse adding -Xss1M
  (please see the attached image). I still get the same error. Also, using
  Google Reader I searched the group for similar messages but I couldn't
  find any.
 
  BTW I am running on Windows Vista and using Eclipse Helios.
 
  Maybe I am configuring this incorrectly. Any suggestions?
 
  Thanks.
 
  Jeff

 I found this reference:

 http://groups.google.com/group/google-web-toolkit/browse_thread/thread/79edcc887785a283

 It talks about -Xmx, not -Xss

 Have you tried increasing the -Xmx setting?

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




 --
 Jeff




-- 
Jeff

-- 
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: Show Hide Reorder Columns like adwords UI

2010-11-07 Thread Gal Dolber
Are you using the new CellWidgets?

If so, you can add and remove columns... with those functions you will be
able to do it.

Best

On Sun, Nov 7, 2010 at 3:16 PM, ycol y...@hotmail.com wrote:

 Anybody?
 Seems like the basic features one would require for a data based
 application.

 On Nov 6, 8:36 am, ycol y...@hotmail.com wrote:
  Hi,
  I would like to know how to implementshow,hideand reorder columns
  for a cellTable.
  I see the ability on the UI for the adwords/key word tool.
  There is a 'Columns' button on top of a datatable.
  Clicking the button allows the user to customize the columns.
  Thank you
  GWTNewbie

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
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: server push

2010-11-07 Thread Ray Tayek

At 08:33 PM 11/3/2010, you wrote:
hi, trying to do this:: 
http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ#Server_Push_in_GWT.

...
i know there may be other options, but i want to roll my own for demo.


the basic idea seems to work. but my server threads are waiting. 
trying to do some load testing.


does anyone know the state of 
http://docs.codehaus.org/display/JETTY/Continuations and 
http://tomcat.apache.org/tomcat-6.0-doc/aio.html?


thanks


---
co-chair http://ocjug.org/

--
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 MVP Roo - xxxEditActivityWrapper

2010-11-07 Thread zixzigma

Hello Everyone,

in Roo generated Expenses app:

in EmployeeEditActivityWrapper , there is this view interface
defined :
can anyone please explain what is this Interface for, why we need it,
and under what circumstances ?
whats the purpose of this interface ?

  public interface ViewV extends ProxyEditViewEmployeeProxy, V
  extends ProxyEditViewEmployeeProxy, V {

void setGenderPickerValues(CollectionGender values);


void setSupervisorPickerValues(CollectionEmployeeProxy values);

  }

private final View? view;

-- 
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 debugging under Linux is much slower than under Windows - what's wrong with my configuration?

2010-11-07 Thread Chris Conroy
Your slowness is not a Linux vs. Windows issue: it is a Chrome plugin
vs. Firefox plugin issue.

The Chrome NPAPI based plugin is known to be a lot slower than the
Firefox XPCOM plugin. This is partly due to the out of process nature
of plugins in chrome: each JS-Java boundary crossing incurs extra
IPC latency. Also, there are some object identity issues in the Chrome
plugin model that require us to do some performance harming
workarounds for the sake of correctness. We hope the object identity
issues will be worked out, and we should get a speedup from that.
There isn't a lot to be done for the out of process problem, and
Firefox will probably head in that direction in future versions (just
a guess).

The Firefox plugin should install just fine on 64 bit ubuntu--I use it
myself all the time. Some other distros have some shared library
conflicts. FWIW, there are some troubleshooting tips in this thread:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/9e0c72621846bb45/9daf57fd972c5fe4?lnk=gstq=LD_DEBUG#9daf57fd972c5fe4

On Sun, Nov 7, 2010 at 12:52 PM, ussuri michael.glas...@gmail.com wrote:
 Hello!

 I recently switched from Windows 7 to Ubuntu for GWT development, and
 I am seriously considering moving back, as GWT debugging under Linux
 (Debug as Web Application in Eclipse) is painful - much slower than
 under Windows.

 My test: same project/code (GWT front-end, GAE back-end). While on the
 project page (fully loaded), I hit browser's refresh button, type
 login credentials into the login dialog (part of my GWT app) and then
 wait until I see my page with some data from GAE (also in the
 debugger, in the same Eclipse workspace, different project). Measure
 time. Then I hit refresh and login and wait until I see full page
 with data. Measure time. And again. And again.

 In Linux, it consistently takes about 21-28 seconds from refresh to
 destination page. Sometimes refresh never finishes, so I have to
 close the tab and open a new one. Even typing credentials is slow, as
 there is a noticeable delay (~1sec) between a key press and a symbol
 appearing in the text box (only under the debugger/plugin; compiled
 javascript is relatively fast).

 In Windows, it consistently takes 6-8 seconds (mostly typing) from
 hitting refresh to the after login page. If I exclude 3-4 secs it
 takes me to type credentials, linux will be ~8x times slower than
 Windows.

 What can I do to speed up GWT's debugger/plugin performance in Linux?

 My set-up:

 Linux: 64bit Ubuntu, desktop edition with linux-server kernel; the
 latest sun java x64 jdk/jre; Eclipse 3.6, GWT 2.1, AppEngine 1.8. GWT
 plugin for Google Chrome (Firefox plugin fails to install, probably
 because of x64 environment).

 Windows: 64bit Win 7; latest Java, same eclipse/gwt/appengine. GWT
 plugin for Firefox.

 Same computer (Intel i3 quad core, 7200 rpm hdd, 4GB RAM) - dualboot,
 no VMs.

 What's wrong with my set-up? Is there anything I can do to improve GWT
 debugging performance under Linux?

 Regards,
 MG

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



-- 
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 MVP Roo - Changing Default History Tokens

2010-11-07 Thread zixzigma

How can we change history tokens in Roo generated app ?
currently it is like this : #ProxyPlace:
1...@no@org.springsource.roo.extrack.client.managed.request.EmployeeProxy!
DETAILS

is it in Tokenizer class ? (Tokenizer inner class inside Place
classes)

is so called REST like URLs possible ? /employees/1

does it mean we have to write custom getPlace, getToken, to convert
tokens to places ?

-- 
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.1 Activities + Code splitting + Gin

2010-11-07 Thread PhilBeaudoin
Thanks Nicolas for your answer. Most of the feedback we get from GWTP
users is very positive, but it's the opinion of people who decided not
to use it that will help us improve it!

Christian summarized it well when he said we want to keep following
GWT. We will support the IsWidget interface soon and remove the need
for view to support custom interfaces, so you will be able to use any
GWT widget (or your own Composite) as a view.

Regarding GWTP's uses of GWT generators, I haven't looked at the
mechanism GWT 2.1 uses to decouple event plumbing from presenter
instances. In my experience, this is required to allow lazy
instantiation and code splitting of presenters. I remember reading T.
Broyer saying he didn't care too much about this since his presenters
were small but, in my experience, presenters can sometime include
quite a bit of logic. In my opinion, being able to lazily instantiate
them and wake them up on specific events is necessary for scalability.
In GWTP this is done through proxys, in MVP4G it is done by defining
events within the global event bus, and I still have to look into the
precise way GWT 2.1 solves this problem.

Also, I think it's a bit unfair to call GWTP's code generation magic
when GWT relies on it for so many different things... But if you
really want to write proxys yourself, GWTP's allows it.

Out of curiosity, which version of GWTP did you try?

Cheers,

   Philippe


On Nov 7, 5:46 am, Christian Goudreau goudreau.christ...@gmail.com
wrote:
 More info on my number 3 comment.
 I just saw a comment from Philippe saying that mixing activity and place is
 discouraged for the  moment. Comming from what I say in one, I think this
 comment will be more appropriate for future release :D

 Cheers,

 On Sun, Nov 7, 2010 at 7:42 AM, Christian Goudreau 







 goudreau.christ...@gmail.com wrote:
  I just want to answer some of your concern :D

  1- We want to introduce and follow every release of Gwt. We already
  introduced Gwt's evenbus instead of using ours and there's more changes on
  the way. That's a long term engagement, even our contributor guideline
  follows gwt.
  2- You don't like the proxy's magic ? You can create them :D Proxy are used
  for lasy instantiation of presenters and to facilitate code splitting while
  keeping everything decoupled.
  3- There's some way to do that with gwtp (PresenterWidget, proxy events).
  But there's no reason  to only use Gwtp, even though we encourage it. I
  think that activity manager can become handy for cases that we don't fully
  support yet.

  Cheers,

  On Sun, Nov 7, 2010 at 6:49 AM, Nicolas Antoniazzi 
  nicolas.antonia...@gmail.com wrote:

  Hi Phillipe.
  i am going to try ProviderBundle.

  I tried to migrate my application to gwtp just before the 2.1 release but
  I reverted my changes for 3 reasons :

  1 - I prefer to not depend too much on an external framework. I love all
  new things that come in every new release of gwt and I am afraid that
  frameworks become unsupported or do not follow new features. I had the
  exemple of a friend who has prefered to use GXT instead of Pure GWT, and
  today, he cannot use UiBinder or the new Handler mechanism. He is still
  using the old listener way.
  Today, GWT has released the new Activity ~ MVP part, with their own Place
  system. At the moment, MVP of GWT seems less powerfull than the GWTP's one,
  but the syntax is different. And tomorrow, maybe that directions will be
  more different. So I prefer not taking the risk to have a situation like
  with GXT.

  2 - Declaration of Presenter / View looks too much complicated to me (but
  it is a pure subjective vision :) ).
  All the generation of ProxyPlace are too magical for me or not enough...
  By instance, The automatic generation of a Place is something interesting,
  but in the same time, it is too complicated to generate. I do not like the
  fact to have to declare an interface which extends ProxyPlace, and
  references it in a type litteral. I would have prefered to just have
  something like :

  @Place(login);
  @RunAsync
  public class LoginActivity implement GwtpActivityLoginActivity.Presenter

  public inteface Presenter {
   public void onLogin();
   ...
  }

  or something similar.
  Today I prefer to stay on a manual code for this part instead of a half
  generation that is (in my opinion) too complicated to declare.
  Finally (for the code style part), I did not like the fact that we have to
  use a local Widget variable in View and returns it with a asWidget() method
  for UiBinder Views.
  Today with GWT 2.1, all widgets implements IsWidget and provides a
  asWidget(). But since we have to store a local instance of Widget inside of
  view for UiBinder, it cannot be done automatically, we have to override it.
  However, I understand that IsWidget was not ready when you first
  implemented it. But today, it does not solve the problem of the local 
  Widget
  variable.

  3 - My application has two top div. One 

Re: Fixing Internet Explorer specific memory leaks (circular references, etc)

2010-11-07 Thread Paul McLachlan
I was using IE7 after the first few steps.  I didn't observe a
difference in behavior between IE6 and IE7.  IE8 leaked as well, but I
didn't subject that version to the same science - our customers are
all IE6  7.

I didn't observe any difference in performance just from using the
application - no scientific measurements, although the code I added
into onDetach doesn't look terribly expensive.

Cheers,
Paul

On Nov 7, 1:27 pm, Slava Lovkiy slava.lov...@gmail.com wrote:
 Thanks Paul for sharing your experience with resolving memory leaks, I
 think it worth a separate blog post.

 Few questions:
 1. what version of IE did you use during the testing ?
 2. was the performance of the app improved after resolving the memory
 leaks ?

 Best regards,
 Slava Lovkiy


-- 
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: ProxyPlace: converting a token to EntityProxy

2010-11-07 Thread Y2i
Thomas,

Thanks a lot for your response, it was very helpful!

Yuri

On Nov 7, 11:57 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On 7 nov, 18:59, Y2i yur...@gmail.com wrote:

  I'd like to implement something similar to non-existent 
  ProxyPlace:http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?c...

  Is there a standard way to convert a token to a sub-class of
  EntityProxy in PlaceTokenizerP.getPlace(String token)?

 RequestFactory#getProxyIdhttp://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/g...)
 (if you used getHistoryToken to generate the token, of course)

  Should I use my own sub-class of AbstractPlaceHistoryMapperF instead
  of combination of PlaceTokenizerP and PlaceHistoryMapper?

 No, you have to create a PlaceTokenizer for the ProxyPlace, which
 you'll initialize with a RequestFactory instance (which means you have
 to use PlaceHistoryMapperWithFactory with a method in your factory
 creating the PlaceTokenizer with the RequestFactory)

 You can actually find the code for ProxyPlace et al. if you go back in
 history in the SVN repository.
 (or download GWT 2.1 M3 for example, which contained them)

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



EditTextCell and RPC worked in 2.1m1 but not in 2.1

2010-11-07 Thread Henry H.
hi,
when i was using 2.1.m1 i was able to extend an EditTextCell to make
an rpc call to update the database after the cell is updated. i just
inserted the rpc call right before commit() method in the cell.
when i made the switch to 2.1, this no longer works. the cell just
remains in edit mode and the onFailure() of the rpc doesn't show. the
viewdata is updated though.
i haven't messed with the new mvp framework yet , but is there another
way to make rpc calls after a cell has been edited?

thanks.

-- 
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: Image Update Memory Leak

2010-11-07 Thread Paul McLachlan
See my post earlier on memory leaks - I had trouble with Images like
this in IE as well.

I suggest you try:

1) re-creating the Image every time instead of using setUrl()
2) when removing the Image, call into a purge references method like
this:

  /**
   * Gratefully taken from http://javascript.crockford.com/memory/leak.html
   */
  public native static void purge( Element d ) /*-{
var a = d.attributes, i, l, n;
if (a) {
l = a.length;
for (i = 0; i  l; i += 1) {
n = a[i].name;
if (typeof d[n] === 'function') {
d[n] = null;
}
}
}
a = d.childNodes;
if (a) {
l = a.length;
for (i = 0; i  l; i += 1) {
purge(d.childNodes[i]);
}
}
  }-*/;

3) I do that with a special Image subclass:

public class NoMemLeakImage extends Image {

  public NoMemLeakImage() {
super();
  }

  public NoMemLeakImage( String imageURL ) {
super( imageURL );
  }

  @Override protected void onDetach() {
try {
  super.onDetach();
} finally {
  //  IE7 seems to leave onabort, __kids and __cleanup pointing
  //  into javascript  causing a circular reference here.  Just
  //  wipe everything.on detach.
  DOMHelpers.purge( getElement() );

  // TODO: This seems a little unsafe.  Specifically - if you re-
attach
  // TODO: the image later, we don't re-set-up the event handlers.
}
  }
}

Regards,
Paul


On Nov 1, 10:06 am, hermis ermis.h...@gmail.com wrote:
 Hello,

 I have written a simple application which fills a FlexTable with a set
 of images. There is a timer which updates the URL of each image every
 second. The URL points to a Servlet which in turn generates a random
 PNG image on its doGet() method and writes it to the response output
 stream. The servlet sets the Cache-Control header to No-Cache.

 When I run the webapp in IE7 / 8 the memory gradually increases.
 Leaving it overnight can get it close to 1Gb.

 Here is the client code:

 #

 public class LeakyApp implements EntryPoint
 {
         public static final String IMAGE_SERVLET_NAME = imageServlet;

         public void onModuleLoad()
         {
                 leak();
         }

         private void leak()
         {
                 UrlBuilder urlBuilder = createUrlBuilder();

                 final FlexTable table = new FlexTable();

                 final ListImage lstImages = createAndAddImages(5,10 ,table 
 );

                 final String strURL = urlBuilder.buildString();

                 final Timer timer = new Timer(){

                         int nCounter = 0;

                         @Override
                         public void run()
                         {
                                 for (Image img : lstImages)
                                 {
                                         img.setUrl( strURL + ? + 
 nCounter++) ;
                                 }
                         }
                 };

                 final Button btnStartLeak = new Button(Leak);
                 btnStartLeak.addClickHandler( new ClickHandler()
                 {
                         @Override
                         public void onClick(ClickEvent event)
                         {
                                 RootPanel.get().remove( btnStartLeak );
                                 RootPanel.get().add( table );
                                 timer.scheduleRepeating( 1000 );
                         }
                 });

                 RootPanel.get().add( btnStartLeak );
         }

         private ListImage createAndAddImages(int rowCount, int colCount,
 FlexTable table)
         {
                 ListImage lstImages = new ArrayListImage();

                 for(int row = 0; rowrowCount; row++)
                 {
                         for(int col = 0; colcolCount; col++)
                         {
                                 Image image = new Image();
                                 lstImages.add( image );
                                 table.setWidget(row, col, image);
                         }
                 }

                 return lstImages;
         }

         private UrlBuilder createUrlBuilder()
         {
                 UrlBuilder urlBuilder = null;

                 if( GWT.isScript() )
         {
                 urlBuilder = new UrlBuilder();
             urlBuilder.setHost( Window.Location.getHost() );
             urlBuilder.setPath( Window.Location.getPath() +
 IMAGE_SERVLET_NAME );
         }
         else
         {
                 urlBuilder = Window.Location.createUrlBuilder();
             urlBuilder.setPath( IMAGE_SERVLET_NAME );
         }

                 return urlBuilder;
         }

 }

 

 Here is the servlet code:

 

Re: [gwt-contrib] First-pass for adding HTML5's Canvas. (issue1082801)

2010-11-07 Thread Johan Rydberg



This is not the final version yet (among other issues, the location is
up for debate) but I would like to give people a chance to comment on it
at this stage.

Is there a reason not to put it in com.google.gwt.user.canvas ?

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: First-pass for adding HTML5's Canvas. (issue1082801)

2010-11-07 Thread t . broyer


http://gwt-code-reviews.appspot.com/1082801/diff/1/10
File user/src/com/google/gwt/html5/canvas/client/CssColor.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/10#newcode23
user/src/com/google/gwt/html5/canvas/client/CssColor.java:23: public
class CssColor implements IsFillStyle, IsStrokeStyle {
On 2010/11/06 00:20:30, cromwellian wrote:

Perhaps a union-type scenario would be better. In my Chronoscope

library, I had

both a setStrokeStyle(String) and setStrokeStyle(StrokeStyle). The

problem is,

you can't just use strings, because patterns and gradients are also

allowed.  An

overload would give you the best of both worlds.


...and is already there, which is why I questioned the existence of this
CssColor class (the setStrokeStyle(IsStrokeStyle) has an explicit
instanceof CssColor check, which is what bothered me).
I missed (and didn't think about) the getters though: a union-type is
probably the best option, or maybe an added getStrokeStyleType or
isStrokeStyleACssColor and getStrokeStyleAsGradient,
getStrokeStyleAsPattern and getStrokeStyleAsString.
But the generic method doesn't look good as you have to know before hand
which type of value has been set, or you risk a ClassCastException (or
having issues using the returned object).

http://gwt-code-reviews.appspot.com/1082801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: First-pass for adding HTML5's Canvas. (issue1082801)

2010-11-07 Thread jlabanca

All of the JSO/Element methods should have JavaDoc.  Its a lot of work,
but its better than forcing users to look up the HTML5 specs to figure
out what each value means, especially return values.


http://gwt-code-reviews.appspot.com/1082801/diff/1/3
File user/src/com/google/gwt/html5/canvas/client/Canvas.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/3#newcode37
user/src/com/google/gwt/html5/canvas/client/Canvas.java:37:
setElement(Document.get().createElement(canvas));
Define and use Document.get().createCanvasElement().

http://gwt-code-reviews.appspot.com/1082801/diff/1/3#newcode72
user/src/com/google/gwt/html5/canvas/client/Canvas.java:72: public
boolean isSupported() {
isSupported should be part of an interface IsSupportable (or some other
name) if we plan to use it in other features.

http://gwt-code-reviews.appspot.com/1082801/diff/1/3#newcode102
user/src/com/google/gwt/html5/canvas/client/Canvas.java:102:
extra spaces

http://gwt-code-reviews.appspot.com/1082801/diff/1/4
File user/src/com/google/gwt/html5/canvas/client/CanvasElement.java
(right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/4#newcode70
user/src/com/google/gwt/html5/canvas/client/CanvasElement.java:70:
return typeof this.getContext != undefined;
+1 we use !! in many other native methods.

http://gwt-code-reviews.appspot.com/1082801/diff/1/4#newcode96
user/src/com/google/gwt/html5/canvas/client/CanvasElement.java:96:
public final native String toDataUrl() /*-{
I agree with tbroyer on both comments.  Even though toJpegDataUrl is not
in the spec, its better than adding toDataUrl(String type, String arg)
where arg may or may not be used, and practically speaking is always a
double.

According to the spec, if the specified type is not supported, it should
be returned as a PNG, so the fallback is defined by the browser.

http://gwt-code-reviews.appspot.com/1082801/diff/1/7
File user/src/com/google/gwt/html5/canvas/client/CanvasPixelArray.java
(right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/7#newcode41
user/src/com/google/gwt/html5/canvas/client/CanvasPixelArray.java:41:
return this[i];
This could return undefined if i is not set.  It should be:
return this[i] || -1.  Update the javadoc to note that -1 means
undefined.

http://gwt-code-reviews.appspot.com/1082801/diff/1/7#newcode43
user/src/com/google/gwt/html5/canvas/client/CanvasPixelArray.java:43:
extra spaces

http://gwt-code-reviews.appspot.com/1082801/diff/1/9
File user/src/com/google/gwt/html5/canvas/client/Context2D.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode43
user/src/com/google/gwt/html5/canvas/client/Context2D.java:43: public
static final String REPETITION_REPEAT = repeat;
+1 for using an enum, but the method should take a String just in case
the user wants to use a value that we don't define in the enum.

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode238
user/src/com/google/gwt/html5/canvas/client/Context2D.java:238: boolean
anticlockwise) /*-{
For optional args, I think we want to use overloads.  So, have a version
that does not take the anticlockwise arg.

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode470
user/src/com/google/gwt/html5/canvas/client/Context2D.java:470: return
this.lineCap;
For any of these getters, if they can return undefined, you have to
convert undefined to a value:
Ex: return this.lineCap || null;

I don't know which can return undefined though.

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode633
user/src/com/google/gwt/html5/canvas/client/Context2D.java:633:
setFillStyle(new CssColor(cssColor));
No need to wrap it.  Just use setFillStyleimpl(cssColor).

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode728
user/src/com/google/gwt/html5/canvas/client/Context2D.java:728:
setStrokeStyle(new CssColor(cssColor));
setStrokeStyleImpl(cssColor)

http://gwt-code-reviews.appspot.com/1082801/diff/1/10
File user/src/com/google/gwt/html5/canvas/client/CssColor.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/10#newcode23
user/src/com/google/gwt/html5/canvas/client/CssColor.java:23: public
class CssColor implements IsFillStyle, IsStrokeStyle {
The problem with using a String is that Context2D#getStrokeStyle wants
to return a String, Gradient, or Pattern.  If we use Strings without
wrapping them in CssColor, then we would need both IsStrokeStyle
getStrokeStyle and String getStrokeStyle methods.

That requires that the user actually know what the stroke style is.
Under the current API, a user can get the Stroke Style and use it
without know whether it is a String, Gradient, or Pattern.

http://gwt-code-reviews.appspot.com/1082801/diff/1/14
File user/src/com/google/gwt/html5/canvas/client/MediaElement.java
(right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/14#newcode48
user/src/com/google/gwt/html5/canvas/client/MediaElement.java:48: public
final native double getCurrentTime() /*-{
We should document the return value of 

[gwt-contrib] Re: First-pass for adding HTML5's Canvas. (issue1082801)

2010-11-07 Thread t . broyer


http://gwt-code-reviews.appspot.com/1082801/diff/1/7
File user/src/com/google/gwt/html5/canvas/client/CanvasPixelArray.java
(right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/7#newcode41
user/src/com/google/gwt/html5/canvas/client/CanvasPixelArray.java:41:
return this[i];
On 2010/11/07 17:06:05, jlabanca wrote:

This could return undefined if i is not set.  It should be:
return this[i] || -1.  Update the javadoc to note that -1 means

undefined.

this[i] || -1 wont work, as it will also return -1 if this[i]==0.
You have to use this[i] == null ? -1 : this[i]; to preserve 0
values.

http://gwt-code-reviews.appspot.com/1082801/diff/1/9
File user/src/com/google/gwt/html5/canvas/client/Context2D.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/9#newcode43
user/src/com/google/gwt/html5/canvas/client/Context2D.java:43: public
static final String REPETITION_REPEAT = repeat;
On 2010/11/07 17:06:05, jlabanca wrote:

+1 for using an enum, but the method should take a String just in case

the user

wants to use a value that we don't define in the enum.


Maybe it's what you're proposing but to make it clear: I'd propose
having both overloads: with String and with the enum, just like in
c.g.g.dom.client.Style. And the getters return String of course.

http://gwt-code-reviews.appspot.com/1082801/diff/1/10
File user/src/com/google/gwt/html5/canvas/client/CssColor.java (right):

http://gwt-code-reviews.appspot.com/1082801/diff/1/10#newcode23
user/src/com/google/gwt/html5/canvas/client/CssColor.java:23: public
class CssColor implements IsFillStyle, IsStrokeStyle {
On 2010/11/07 17:06:05, jlabanca wrote:

The problem with using a String is that Context2D#getStrokeStyle wants

to return

a String, Gradient, or Pattern.  If we use Strings without wrapping

them in

CssColor, then we would need both IsStrokeStyle getStrokeStyle and

String

getStrokeStyle methods.



That requires that the user actually know what the stroke style is.

Under the

current API, a user can get the Stroke Style and use it without know

whether it

is a String, Gradient, or Pattern.


Except that it cannot actually use it (apart from passing it around)
because IsStrokeStyle and IsFillStyle are just marker interfaces
(without methods) and you cannot differentiate a pattern from a
gradient(they're both JSOs, so instanceof doesn't work).
Also, the getters are currently defined with a generic return type, so
if you call context.CssColorgetStrokeStyle() while the value currently
is a gradient or pattern, it'll throw a ClassCastException.
Which makes me conclude that a union-type is the best option (with
isCssColor, isPattern and isGradient, returning either a
String/pattern/gradient or null, similar to
c.g.g.json.client.JSONValue's methods for instance). The only other
workable solution would be to return Object so you can do
instanceof String for css colors, and use CanvasPattern.is(...) to
check if it's a pattern (similar for gradient)

http://gwt-code-reviews.appspot.com/1082801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Fix issue with FF3.5 and below not having readyState (issue1087801)

2010-11-07 Thread unnurg

Reviewers: jgw,

Description:
Fix issue with FF3.5 and below not having readyState


Please review this at http://gwt-code-reviews.appspot.com/1087801/show

Affected files:
  M  
dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoadedNull.js

  M dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js


Index:  
dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoadedNull.js

===
---  
dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoadedNull.js	 
(revision 9194)
+++  
dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoadedNull.js	 
(working copy)

@@ -1,8 +1,3 @@
-// Check whether the body is loaded.
-function isBodyLoaded() {
-  return true;
-}
-
 // Setup code which waits for the body to be loaded and then calls the
 // callback function
 function setupWaitForBodyLoad(callback) {
Index: dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js
===
--- dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js	 
(revision 9194)
+++ dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js	 
(working copy)

@@ -23,6 +23,12 @@
 
***/


   function isBodyLoaded() {
+if (typeof $doc.readyState == undefined) {
+  // FF 3.5 and below does not have readyState, but it does allow us to
+  // append to the body before it has finished loading, so we return  
whether

+  // the body element exists.
+  return (typeof $doc.body != undefined);
+}
 return (/loaded|complete/.test($doc.readyState));
   }



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors