Re: Support for GWT 2.0.3, com.extjs.gxt 2.2.0-gwt2 with IE 11

2018-02-22 Thread Tony BenBrahim
With a few changes, it will also work with Java 8 and GWT 2.8.2
See https://github.com/bedatadriven/gxt for an example.
I have several GXT projects on GWT 2.8.2

On Wednesday, August 26, 2015 at 1:35:00 AM UTC-5, Narasimhulu Bysani wrote:
>
> Hi All,
>
> Currently my application was developed with the combination of GWT 2.0.3, 
> com.extjs.gxt 2.2.0-gwt2 . Now we got a new requirement saying that it 
> should support for IE 11. Please let me know the simple work around to 
> achieve this task.
>
> Thanks in Advance.
>
> Regards,
> Narasimhulu BB
>
>
>

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


Re: ClassCastException in generics

2017-08-23 Thread Tony BenBrahim
public static native FileReader newFileReader() /*-{
return new *$wnd*.FileReader();
}-*/;


On Wed, Aug 23, 2017 at 6:36 AM, Kirill Prazdnikov 
wrote:

> ArrayBuffer arrayBuffer = fileReader2.resultArrayBuffer();
>>
>> Logger.log("instanceOfArrayBuffer for file = " + 
>> isInstanceOfArrayBuffer(arrayBuffer));
>>
>> ArrayBuffer good = new ArrayBuffer(arrayBuffer.getByteLength());
>>
>> new Int8Array(good).set(new Int8Array(arrayBuffer));
>>
>> Logger.log("instanceOfArrayBuffer for good copy = " + 
>> isInstanceOfArrayBuffer(good));
>>
>> handleJetFile(name, arrayBuffer);
>>
>>
> Oh, my bad, that was the typo, should be
>
> handleJetFile(name, good);
>
>
> Now it works. Oh magic. GWT rtti is a hard rock.
>
> I think I do not need to have two buffers to workaround that issue.
> (better to box_
> Also I do not want to make a copy of all JsType classes, one with "name =
> Object" and other with good names.
> The best would be still to use a boxing class.
>
> -Kirill
>
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GWT Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-web-toolkit/jiHnLPfUQhc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: ClassCastException in generics

2017-08-21 Thread Tony BenBrahim
Take the object you get back from the file reader and run it through the
JSNI method below and GWT,log the result. .Let's see if it really is an
ArrayBuffer.(I would note the FileReader result is sometimes a String and
sometimes an ArrayBuffer).

private native String getType(Object x)/*-{
return Object.prototype.toString.call(x);
}-*/

​

On Mon, Aug 21, 2017 at 10:07 AM, Kirill Prazdnikov 
wrote:

> This is perfectly fine ArrayBuffer which I got from the system call to
> FileReader.onLoad callback.
> It correct, it loads and I finally read a 3d ojbect form it.
>
> What else can it be if not ArrayBuffer (hence the need of generic)? An
>> ArrayBuffer extension?
>
>
> I`m trying to generalize the drag-drop code across GWT and JVM clients.
> We have a portable UI code and it is fine to move as much code as possible
> to portable segment in order to reduce deplicates and bugs.
>
> And I think one expect native JsType`s to be working for generic
> arguments.
>
> These ought to work.
>>
>>> public abstract class ArrayBuffer { ... }
>>
>> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
>>
>
>
> Yes and this is the problem I can not understand.
> With the default name and name=ArrayBuffer the generic crashes in
> generated call to castToNative.
> With name=Object the GWT does not generate type checking, instead it
> generates call to castToJsObject.
>
> What am I doing wrong ?
>
> And again, I hope using name=Object is not the best way to solve it. It
> looks like a hack to fool the GWT to avoid the crash.
>
> Any suggestions ?
>
> Thanks
>
>
> понедельник, 21 августа 2017 г., 17:06:26 UTC+3 пользователь Vassilis
> Virvilis написал:
>>
>> Oh I see. I forgot about that.
>>
>> These ought to work.
>>
>>> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
>>> public abstract class ArrayBuffer { ... }
>>
>>
>>
>>
>>> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
>>> "ArrayBuffer")
>>
>>
>> I don't know what else may be the problem.
>>
>> What else is it going on java side?
>> Maybe the instance you are trying to cast is null?
>> What else can it be if not ArrayBuffer (hence the need of generic)? An
>> ArrayBuffer extension?
>> If you print the variable you are trying to cast in the console? Does it
>> says that's an ArrayBuffer?
>>
>> I jave been fighting with jsinterop exceptions for some time and I know
>> that it can be very frustrating.
>>
>>  Vassilis
>>
>>
>>
>> On Mon, Aug 21, 2017 at 4:52 PM, Kirill Prazdnikov 
>> wrote:
>>
>>> Im talking about standard ArrayBuffer
>>>
>>> https://developer.mozilla.org/en/docs/Web/JavaScript/Referen
>>> ce/Global_Objects/ArrayBuffer
>>>
>>> From the console of the web browser: What is it required to create a new
 ArrayBuffer?


>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GWT Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-web-toolkit/jiHnLPfUQhc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Accessing "basic" JS Object in JsInterop callback

2017-08-20 Thread Tony BenBrahim


regarding 1) It would be nice to initialize Objects from json. What would 
happen if the json text specifies members not in class though?

You could always do this, if you just need to pass something to JavaScript 
and do not need to read it...

@JsType(isNative=true, name="JSON", namespace=@JsPackage.GLOBAL)
public class JSON {
   Object parse(String json);
}

Object config=JSON.parse("{foo:1, bar: ["a","b","c"], baz: {a: true, b: 
false}}");

You c​
You could even do this if Config is a JsType with name Object and namespace 
GLOBAL:

Config config=(Config) JSON.parse("{foo:1, bar: ["a","b","c"], baz: {a: 
true, b: false}}");

In that case, any properties that do not exist in Config would simply not 
be readable or writable from your Java code, without using JSNI...




On Sunday, August 13, 2017 at 10:46:59 AM UTC-5, Vassilis Virvilis wrote:
>
>
> I had this problem with DataTables Config. DataTables is a nice javascript 
> library for tables https://datatables.net/ and Config is the 
> initialization object like yours. So here is what I did:
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
> public static class Config {
> String name;
> TimeStamp timestamp;   // TimeStamp needs to be jsinteropified too 
> or elementat2 needs to be used.
> String msg;
>  
> @JsOverlay
> public static Config create(String name, TimeStamp timestamp, 
> String msg) {
>final Config config = new Config()
>config.name = name;
>config.timestamp = timestamp;
>config.msg = msg;
> }
>  }
>
> Hope that helps.
>
> 1) It would be nice to initialize Objects from json. What would happen if 
> the json text specifies members not in class though?
>
> 2) It would be interesting if JavaScriptObject was below Object in the GWT 
> inheritance and expose .__set() for all java objects. I don't know if that 
> is is possible but I find the thought intriguing. It would be break javac 
> compilation though...
>
> Vassilis
>
>
>
>
> On Sat, Aug 12, 2017 at 11:59 AM, Andrea Martino  > wrote:
>
>> Hi all,
>> I have recently started testing JsInterop for our GWT 2.8.1 application 
>> and I have encountered a situation I could not solve without using the old 
>> style JSNI approach.
>>
>> Consider the following minimal JS library I would like to use in Java/GWT:
>>
>> (function (window, document, undefined) {
>>
>> function WatchDog(name) {
>> this._name = name;
>> };
>>
>> WatchDog.prototype.register = function(callback) {
>> this._callback = callback;
>> };
>>
>> WatchDog.prototype.broadcast = function(msg) {
>> if (this._callback) {
>> this._callback({
>> 'name' : this._name,
>> 'timestamp' : new Date().getTime(),
>> 'msg' : msg
>> });
>> }
>> };
>>
>> window.Dummy = {
>> watchDog : function(name) {
>> return new WatchDog(name); 
>> }
>> };
>>
>> }(window, document));
>>
>> Please note that the broadcast function passes a "basic" JS Object {} 
>> (i.e. without a specific prototype) to the callback function.
>>
>> Here below my JsInterop mappings:
>>
>> package xxx;
>>
>> import jsinterop.annotations.JsPackage;
>> import jsinterop.annotations.JsType;
>>
>> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
>> public class Dummy {
>> private Dummy() {}
>> public static native WatchDog watchDog(String name);
>> }
>>
>> package xxx;
>>
>> import jsinterop.annotations.JsMethod;
>> import jsinterop.annotations.JsType;
>>
>> @JsType(isNative = true)
>> public class WatchDog {
>> private WatchDog() {}
>> @JsMethod
>> public native void register(Callback callback);
>> @JsMethod
>> public native void broadcast(String msg);
>> }
>>
>> package xxx;
>>
>> import jsinterop.annotations.JsFunction; 
>>
>> @JsFunction 
>> public interface Callback { 
>> void call(Object event); 
>> }
>>
>>
>> In my Java code, when the callback function is invoked, the event 
>> parameter is an instance of com.google.gwt.core.client.JavaScriptObject.
>>
>> Without using JSNI I am not able to access/read the object's properties. 
>> Does JsInterop addresses this scenario without falling-back to old style 
>> JSNI?
>>
>> Thanks a lot in andvance
>> Andrea
>>
>>
>
>
> -- 
> Vassilis Virvilis
>

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


Re: ClassCastException in generics

2017-08-20 Thread Tony BenBrahim


My, understanding, because I have noticed the same many times in the past 
few weeks.

@JsType *may* (and that is a very weak may) work for a native type as long 
as you do not use it as you do not use it as a generic type argument. As 
soon as you do, for example, adding it to List, , cast checking 
kicks in and you end up with a class cast exception if SomeType is only 
annotated with @JsType. There is another case when it kicks in also. I have 
noticed also a couple times that code with just @JsType worked fine in 
superdev mode when not used in a generic context, but failed with a class 
cast exception, once compiled for release. As Vassillis mentioned, I am now 
conditioned to *always* specify the type name and package when isNative=true. 
Object is most commonly the name, but it could be different. However, 
Object will always be correct. The casting code in GWT is in Cast.java 

 
and the failure typically happens in the jsintanceof method, called from 
castToNative, with one of the parameters being null because the type name 
specified in the @JsType annotation is incorrect or missing. In your case 
since ArrayBuffer is an instance of Object, either Object or ArrayBuffer 
should work for the type name.

You can disable cast checking, but only when compiling for production, and 
not in superdev mode, by using the -XdisableCastChecking flag. For most 
applications that get data from the network and display it on the page, 
this will have no noticeable effect whatsoever, so it is best avoided. 
There is also the @UnecheckedCast 

 
annotation, which can be applied to selected methods in the critical path 
of performance sensitive code, and again, only takes effect in code compile 
for release, not superdev mode.

You would not want to disable cast checking in superdev mode anyways. I 
just finished porting an AngularJS/TypeScript application to GWT, and found 
a number of silent bugs in the old typescript (bugs that doe generate any 
output in the dev console) thanks to GWT cast checking. Typescript gives 
the *illusion* of types, but there is no runtime type checking when you 
cast something, GWT really does check, and that is a major advantage you 
would not want to lose.
​



On Friday, August 18, 2017 at 9:01:47 AM UTC-5, Kirill Prazdnikov wrote:

> Hi, I`m always getting ClassCastException if I use @JsType(isNative = 
> true) object as a generic template argument. 
>
> Is it possbile to do something with that ? 
> Is it possbile to avoid check-cast generation if the generic is used with 
> @JsType type ? 
>
> Thanks
>
>

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


Continuous Delivery with GWT

2014-08-11 Thread Tony BenBrahim
Has anyone successfully implemented Continuous Delivery with GWT. The 
biggest obstacle I see is GWT RPC, that seems to check that the client 
version matches the server version, so that when a new version of a backend 
is deployed, users will get an error message about an incorrect version and 
be asked to refresh the browser. I will look at disabling this check, but 
if it is not possible or has negative consequences, may have to switch to 
REST+JSON from GWT RPC? Anyone tried this successfully?

Thanks in advance

-- 
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+unsubscr...@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/d/optout.


FIX: Problem with Firefox 22 and GWT Dev Plugin? Upgrade to Firefox 23

2013-08-12 Thread Tony BenBrahim
Go to Help About, an update from 22 to 23 should automatically start 
downloading. It fixed the problem for me.

-- 
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+unsubscr...@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 AsyncCallback failing

2009-11-30 Thread tony,benbrahim
Does your server side methid return 200 status code?

--

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 hosted mode in infinity loop when debugging

2009-01-05 Thread tony,benbrahim

Had the same problem, in my case, the hang was 5 minutes of 50% CPU,
since the project is barely started (3000 LOC)

A full rebuild fixed the problem

Tony

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---