Re: RequestFactory - Working with Enums

2011-08-29 Thread Ido
Sounds good. We will use top level classes to store the enums and sourced 
them in the gwt.xml module.

Thanks a lot for your replies!
Ido

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/_EHQTGjjHCoJ.
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.



Re: RequestFactory - Working with Enums

2011-08-29 Thread Thomas Broyer
No, Enums have to be available on the client-side. If you have them as 
top-level classes, or if their containing class is "translatable", then you 
can easily make them accessible to the client-side using a gwt.xml module 
with a  in it (with 
one  per file defining an Enum).
That's what we're doing and it works great.

If your Enums are nested and the containing class is not translatable, then 
you'll have to provide an "emulated" version of your Enums and containing 
classes, using a  in your module pointing to a subfolder 
where you'll put your emulated classes (the containing class would be empty, 
serving only as a container, and you'll copy your Enum definition there; the 
GWT Compiler –thus, the client-side code– would use the "super-source", 
whereas the server-side code would use the actual classes).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/L5IfzuP7FTsJ.
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.



Re: RequestFactory - Working with Enums

2011-08-29 Thread Ido
Thanks for the reply.

We indeed created new gwt module which contains RF classes. Our RF module 
contains proxies, services and servlet to populate Spring services through 
RF.

Then we have other gwt projects then import the above RF module. we can't 
really import the packages with the enum definition as they won't be able to 
be serialized into javascript.

I'm thinking about droping the use of enums on the backends and use ids 
instead. Enums will be defined in client side only.

Was just wondering if there is any way to define a "Proxy" like type for 
enums, apparently not.

Thanks a lot!
Ido

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/OMfnU5_yYbQJ.
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.



Re: RequestFactory - Working with Enums

2011-08-28 Thread -sowdri-

I believe you have already converted your existing code into a gwt module. 
(With that this is not possible) and finally in the module's gwt.xml file 
include the path of the package which contains the enum. 

Then it will be available on the client code!

Hope this helps!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/7RtUrJ2wbsEJ.
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.



RequestFactory - Working with Enums

2011-08-28 Thread Ido
Hi all,

We've been trying to find a way to transfer enums to client side.
David Chandler (
http://turbomanage.wordpress.com/2011/03/25/using-gwt-requestfactory-with-objectify/)
 
made it by defining enums in the proxy.

Our case is a bit different, my team has to setup a RequestFactory layer 
above existing backend system.

For example, given the following class:
class SomeObj
{
public static enum Status{Success, Failure}

Status status;
 Status getStatus()
{
  return status;
}
}

We created following proxy:
@ProxyFor(SomeObj.class)
public interface SomeObjProxy extends ValueProxy
{
Status getStatus();
}

However, and pretty obvious, we get "Could not find matching method in" 
error during run time.

Is there any other way working with enums in RF other then defining them in 
the proxies and use them in the models?

Any reply will be appreciated.

Thanks a lot in advanced,
Ido

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/e0lbzwFeo8MJ.
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.