Re: gwt and php site

2013-09-01 Thread Jens


>
>   public static native  T fromJson(String json, 
> Class 
> name) /*-{ 
> return eval(json); 
>   }-*/; 
>
>
You better use MyClass instance = JsonUtils.safeEval(json) instead. 

-- 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+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 and php site

2013-09-01 Thread Nicolas Weeger
Hello.

> I want to tie the GWT to the php server and make the php scripts return
> JSON. 

That's what I do for a medium project I work on, and it works nicely.

The whole interface is in GWT, and server only sends JSON, with a few 
exceptions.




One important point to take care of, with JSON coming from PHP, is the 
values's type, not intuitive when working with PHP which converts implicitely.



If you have a class MyClass extending JavaScriptObject, that you get through a 
simple conversion of the received JSON using eg 

  public static native  T fromJson(String json, Class 
name) /*-{
return eval(json);
  }-*/;

and this class uses native properties like:

public final native int getId() /*-{ return this.id; }-*/;


then you must ensure the PHP code correctly converts data to int before 
calling json_encode.

If you do eg

$json['id'] = $database_row['id'];

then PHP will write a string for the property, and some browsers (Chrome in 
particuler) will complain and report an exception.

You have to explicitely use

$json['id'] = intval($database_row['id'];


This also applies to boolean types, for which you need to use PHP's 
true/false, and not 0/1 or any other thing.


Apart that, you should be ok :)




> It would be really useful to have the GWT make SOAP calls to
> the SOAP server. Is this possible?

Should be possible, as you can generate and read XML with GWT, and unless I'm 
mistaking that's what SOAP uses. Not sure if there are wrappers to simplify 
reading/writing, though.


Hope this helps


Nicolas


signature.asc
Description: This is a digitally signed message part.


Re: IE10 support in Gwt

2013-09-01 Thread Andrei
RE: I ran into an issue with GWT cellTables and cellTrees using IE 10. When 
hovering over a row we used hovering styling for that row which worked fine.

Why don't you use CSS for styling (like tr:hover) instead of relying on widgets 
firing events? IE10 handles them just like other browsers.

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