Friday, November 1, 2013

Re: gwt date B U G

Ok, I will try to debug it, maybe do a mini app. read doc etc... and think a little more etc... but now I also have other pending things to do...
Quickly, here is my context :
.....
//FUNCTIONS
public static Date set___Str___To___Date(String s) // convert STRING (format ENGLISH = EN = 2013-08-15)  to DATE
{
  String y = s.substring(0, 4); String m = s.substring(5, 7); String d = s.substring(8, 10);
  Date date = new Date();
  date.setYear(Integer.valueOf(y) - 1900);
  date.setMonth(Integer.valueOf(m) - 1);                                         // month start at 0 (HORRIBLE to debug ;(   )
  date.setDate(Integer.valueOf(d));
  return date;
}

public static String set____Date____To____Str(Date date)                            // convert DATE to STRING
{return  DateTimeFormat.getFormat("yyyy-MM-dd").format(date);}     // EN = 2013-08-15 

//CODE
String         str_dateHoy____EN     = "2013-11-02";
Date          date_tomorrow                     = set___Str___To___Date(str_dateHoy____EN);       // 
date_2m.setDate(date_2m.getDate() + 1);                                                                             // I increment +1 (so I have the 'tomorrow' date)
final String  str_date_tomorrow ____EN   = set____Date____To____Str(date_tomorrow  );   
.....


What I have seen, is that, I have various call to the method set___Str___To___Date()....It works the first time (when my initial page is loading), but the second time (when I use the datepicker to go to the 2nd NOV, 2013), then I have precisely see the 'crazy' behavior... Yesturday, I was not able to explain well what was happening (and today, I just do not want to see theses line of code, so sorry if it is not clear where the error is...), but I suspect one of the 2 red lines to be responsible for the error.

regards,

@Jens: "SuperDevMode works entirely inside the browser while DevMode works in a JVM."
So I suppose that in production, it should works in a JVM (if I upload a version without using SUPER dev)....but the paradox was that the error in production mode was similar to SUPER DEV MODE...the only way it was working fine, was in dev mode, in LOCALHOST.




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

HTMLPanel cannot remove DivElement inside its node ?

Hi,

HTMLPanel panel = new HTMLPanel("");        // class attribute

public void function()
{
 panel.clear();
 Element d3 = DOM.createDiv();                       d3.setClassName(N.NN.N().resultSearch_category_title());   d3.setInnerHTML(name);
 panel.getElement().appendChild(d3);
}

The issue is that panel will not remove the divElement...The only thing I am happy with is that, if I use another HTMLPanel instead of the divElement, so then YES, .clear() will remove it.
So this involve that I use a lot of HTMLPanel instead of DivElement and I am sure it costs me (the DOM or code will be heavier).

Is it possible that the clear() method REALLY remove all child elements (and not only others HTMLPanel) ? Which alternative I have ?

Thanks you,




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Re: gwt date B U G

You really need indicate the manner in which you're calculating the "tomorrow date" before anyone can actually do much other than speculate to help you here. 

I would imagine you should be able to determine what the code is doing differently just by stepping through your code in the browser's debugger  after compiling using -style DETAILED and deploy the app locally and then compare it to the java Date calls.  I'd guess there's some sort of javascript difference in date handling poking through the java abstraction.

On Friday, November 1, 2013 4:11:59 AM UTC-5, Axel R wrote:
Hi,

Yesturday, Oct 31th, 2013, I had a bug with "gwt date" (I do not understand if the java.util.date has something to do with GWT but well...).

I have an 'event application', and when I was using the gwt datepicker to go the the 2nd NOV, 2013, my application has also to calculate the date of the following day.
In this example, the "tomorrow" date was indicating 3rd DEC 2013 instead of 3rd NOV 2013... (so the issue is that the date is giving me one month more).

This error was in production mode. Then I try to debug it in local mode. And I can observe something strange:
 - with SUPER DEV MODE: I have the same error than in production.
 - withOUT SUPER DEV MODE (normal debug): I can see that the "tomorrow" date is OK (cf. 3rd NOV 2013)

Then I go home to sleep, sooo frustrated to lose time debuging incoherent thing, and most of all, not allowing my team to update events in production due to the bug...I weak up this morning, and well, everything seems alright. I mean, the "tomorrow" date is well calculated, without a month more...

So where this bug comes from ? Is it my fault or not ? I think that GWT can do great thing, but for example, or sometime, it is bad in doing simple things...Which serious EVENT / CALENDAR application could we develop without a COOL and BUGGYLESS way of maniplating dates in the client side ? Moreover, the GWT datepicker widget has bugs that have not been corrected for 3 years...I have to do some ugly hack for this. Frustating answers are talking about using JODA or Calendar, but it does not work in the client side, and in my country the internet connexion is very slow, I do not want to do an RPC just to do some date calculations each time I need it. 

Now, which garantee I have that the bug that happened yesturday will not happen another day ? 

Axel,

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Re: gwt date B U G


Yesturday, Oct 31th, 2013, I had a bug with "gwt date" (I do not understand if the java.util.date has something to do with GWT but well...).

I have an 'event application', and when I was using the gwt datepicker to go the the 2nd NOV, 2013, my application has also to calculate the date of the following day.
In this example, the "tomorrow" date was indicating 3rd DEC 2013 instead of 3rd NOV 2013... (so the issue is that the date is giving me one month more).

This error was in production mode. Then I try to debug it in local mode. And I can observe something strange:
 - with SUPER DEV MODE: I have the same error than in production.
 - withOUT SUPER DEV MODE (normal debug): I can see that the "tomorrow" date is OK (cf. 3rd NOV 2013)

Thats not such a surprise. SuperDevMode works entirely inside the browser while DevMode works in a JVM. While in SuperDevMode you get JavaScript behavior and while in DevMode you get ordinary Java behavior.

Is Oct 31th or Nov 2nd a special date in your timezone? Is it maybe a day on which Daylight Saving Time (DST) is switched? 

GWT uses the following emulated Date class during GWT compilation and thus in production mode:

https://gwt.googlesource.com/gwt/+/master/user/super/com/google/gwt/emul/java/util/Date.java

At the very bottom there is a method to fix daylight saving times and maybe this method has done something wrong in your case (or your own calculation has a bug, or both). If you can still reproduce the issue (maybe put your computer time back to Oct 31) then I would debug it using SuperDevMode in Chrome and without source maps so you can see the actual JavaScript.

If you can write a mini app with your described behavior then please file a bug and attach the app along with a description how to reproduce the bug.


 
So where this bug comes from ? Is it my fault or not ? I think that GWT can do great thing, but for example, or sometime, it is bad in doing simple things...Which serious EVENT / CALENDAR application could we develop without a COOL and BUGGYLESS way of maniplating dates in the client side ? Moreover, the GWT datepicker widget has bugs that have not been corrected for 3 years...I have to do some ugly hack for this. Frustating answers are talking about using JODA or Calendar, but it does not work in the client side, and in my country the internet connexion is very slow, I do not want to do an RPC just to do some date calculations each time I need it. 

With GWT 3.0 and Java 8 support its very likely that JSR 310 aka. java.time.* will be emulated by GWT sooner or later. But even with such an emulation it may cause issues if the emulation uses JavaScript date internally because browsers behave differently and IMHO its difficult to figure out how exactly they differ from each other.

 

Now, which garantee I have that the bug that happened yesturday will not happen another day ? 

Currently, none :(


-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

gwt date B U G

Hi,

Yesturday, Oct 31th, 2013, I had a bug with "gwt date" (I do not understand if the java.util.date has something to do with GWT but well...).

I have an 'event application', and when I was using the gwt datepicker to go the the 2nd NOV, 2013, my application has also to calculate the date of the following day.
In this example, the "tomorrow" date was indicating 3rd DEC 2013 instead of 3rd NOV 2013... (so the issue is that the date is giving me one month more).

This error was in production mode. Then I try to debug it in local mode. And I can observe something strange:
 - with SUPER DEV MODE: I have the same error than in production.
 - withOUT SUPER DEV MODE (normal debug): I can see that the "tomorrow" date is OK (cf. 3rd NOV 2013)

Then I go home to sleep, sooo frustrated to lose time debuging incoherent thing, and most of all, not allowing my team to update events in production due to the bug...I weak up this morning, and well, everything seems alright. I mean, the "tomorrow" date is well calculated, without a month more...

So where this bug comes from ? Is it my fault or not ? I think that GWT can do great thing, but for example, or sometime, it is bad in doing simple things...Which serious EVENT / CALENDAR application could we develop without a COOL and BUGGYLESS way of maniplating dates in the client side ? Moreover, the GWT datepicker widget has bugs that have not been corrected for 3 years...I have to do some ugly hack for this. Frustating answers are talking about using JODA or Calendar, but it does not work in the client side, and in my country the internet connexion is very slow, I do not want to do an RPC just to do some date calculations each time I need it. 

Now, which garantee I have that the bug that happened yesturday will not happen another day ? 

Axel,

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Using hammer.js for handling touch events/gesture recognitions?

Of course you can, just write a tinny jsni wrapper around it and you can use any js lib.
I just wrote one for GreenSock GSAP, just search in the forum, you will find info about it.
Also look at the GWT Google API wapper source for info, 
Or look at the Mgwt project, it's already handling touches and contains al the required Gesture Recognizers.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Re: GWT RPC AsyncCallBack is always failing persistently.

com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Blocked attempt to access interface 'com.mycompany.project.client.Connection', which is not implemented by 'com.mycompany.project.server.MySQLConnection'; this is either misconfiguration or a hack attempt )
at com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.instantiate(IncompatibleRemoteServiceException_FieldSerializer.java:16)
at com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.create(IncompatibleRemoteServiceException_FieldSerializer.java:25)
at com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBase.java:115)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:396)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:216)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)

This is the entire error code which appeared at the console and I'm so confused about all these errors. I have google about the error on mismatching but with no aid.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.