How are the acceptable values of the ValueListBox populated?
The difference between scenarios 1 and 3 is that in the former the value is not changed (stored in a field in setValue, returned as-is from getValue), while in the latter it is set to the equivalent value from the list of acceptable values.
It might be related to http://code.google.com/p/google-web-toolkit/issues/detail?id=7189 but it depends how you setup your Hibernate sessions.
With RF, you're supposed to use the OpenSessionInView paradigm, and then use one transaction per service method.
On Tuesday, June 12, 2012 4:17:23 PM UTC+2, Thomas Broyer wrote:How are the acceptable values of the ValueListBox populated?A request is done specifically for that. The list of acceptable values is properly initialized on the server side before returning it to the client side.The difference between scenarios 1 and 3 is that in the former the value is not changed (stored in a field in setValue, returned as-is from getValue), while in the latter it is set to the equivalent value from the list of acceptable values.I suspected this.But the proxy that's being saved in B is not the same instance that was returned by the request I said above, which was used to populate the acceptable values. I verified that with the debugger. And it should be initialized if it was the same object of the list anyway.It might be related to http://code.google.com/p/google-web-toolkit/issues/detail?id=7189 but it depends how you setup your Hibernate sessions.I'm not touching any other field.. sure it's related?
Maybe another detail that might make some difference is that B is an abstract class. The subproxies to the concrete classes present in the ValueListBox are all properly defined in BProxy's @ExtraTypes annotation. Don't know if that might mess things up...With RF, you're supposed to use the OpenSessionInView paradigm, and then use one transaction per service method.Hum, I don't use OpenSessionInView, but regardless, the uninitialized proxy B must be set to A before my view method is called. Even if it was OpenSessionInView, the proxy comes from a previous session... right?
See http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryMovingParts#Flow for details on how a request is processed. The B domain object is created/loaded in the “All domain objects referred to by the payload will be loaded.” phase, that is, the very first thing that's being done on the server to process the request.
If you used OpenSessionInView though, it would just work; it would do some unnecessary work, but it would work.