-
28 Feb 2011 12:21 PM #11
It really works! I'm very happy. Thank you a lot! I hope you have great success in what you do! You helped me so much with this!
-
1 Mar 2011 4:05 AM #12
Today, I've tried a new thing that would make it much easier to map the server beans directly to GXT components like the TreePanel. I'm trying to use TreeLoader and TreeBeanModelReader to directly map the returned beans from server. This is the code:
The issue is that the returned list cities doesn't contain instances of CityProxy but instances of CityProxyAutoBean_com_google_gwt_requestfactory_shared_impl_EntityProxyCategory_com_google_gwt_requestfactory_shared_impl_ValueProxyCategory_com_google_gwt_requestfactory_shared_impl_BaseProxyCategory extends com.google.gwt.autobean.shared.impl.AbstractAutoBean<com.tion.shared.CityProxy>.Code:TreeBeanModelReader tbmr = new TreeBeanModelReader(); BaseTreeLoader<ModelData> treeLoader = new BaseTreeLoader<ModelData>(tbmr); TreeStore<ModelData> store = new TreeStore<ModelData>(treeLoader); treePanel = new TreePanel(store); //do a Request to return a list of CityProxy that implement BeanModelTag req.getAllCities(cp, "extra_param_value").fire( new Receiver<List<CityProxy>>() { @Override public void onSuccess(List<CityProxy> cities) { treeLoader.load(data); } });
All these instances are not implementing BeanModelTag. TreeBeanModelReader tries to do this:
and it returns NULL because beans.get(0).getClass() doesn't implement BeanModelTag.Code:BeanModelFactory factory = BeanModelLookup.get().getFactory(beans.get(0).getClass());
Is there any way to make this work?
Thank you!
-
1 Mar 2011 11:37 PM #13
-
7 Mar 2011 5:22 AM #14
I think all this is going down the "reinvent the wheel" road because GXT 3.0 will include full RequestFactory support.
@Stigrv, you said you converted your development webapplication from using GWT-RPC to using RequestFactory but did you redesign all GXT's classes like(BaseTreeLoader, BaseLoader, TreeStore) which still use GWT-RPC implementations or you just have something that works partially and you're still waiting for GXT 3.0 to be released?
I want to know this because I feel like this is no more a trivial change in GXT's code but a full implementation that is going to be released by them. So maybe it would be better to use GWT-RPC and then to switch to RequestFactory when GXT 3.0 gets released.
What was your motivation to switch to RequestFactory so early? How much time did you invest in getting GXT to be compatible with RequestFactory?
Thank you!
-
7 Mar 2011 10:37 AM #15
Sorry I didn't see your message earlier.
For the proxy that fails to be converted using the BeanModelFactory, you'll need to tag the proxy with BeanModelTag in order for the factory to know about and be able to convert it.
Loaders and stores are untouched, and are wired to RF instead of GWT-RPC in the presenter/activity layer.
For my motivation in switching to RF this early, this was mainly as an attempt to prepare our application for GXT3, mainly to reduce the work needed when it is released. It has to be noted that the application we are making is still in its early phase, and it is therefore not guaranteed that we've found all problems yet. With that being said, the only change I've done is the custom implementation of the generator. This generator solved the problem with empty beans that occured after converting the application into using RF instead og GWT-RPC.
It should also be noted that it took me over a week to convert our current codebase from GWT-RPC into RF and the rest of the GWT Bindings framework. Now that we are implementing more of the views needed, this was well spent time, as it will save us the work of doing this later, and therefore reducing duplicate work.
-
7 Mar 2011 11:33 PM #16
Thank you for helping me understand your motivation. It makes sense! I also feel this is the best option at the moment instead of going back to RPC and then, in a few months time, having to upgrade again. But I must admit I also had the feeling of not "reinventing the wheel" and I thought there were many changes to get RequestFactory integrated. I'm glad you and Colin Alworth made me feel more confident about this and go for RequestFactory. I appreciate you guys helped me!
Regarding the changes needed, I also found the need to override the TreeBeanModelReader(I'm using TreePanel mostly at this moment). I think in case I'll add components like grids, I'd have to also override BeanModelReader as well.
This is because GXT tries to get the BeanModel factory by using BeanModelFactory factory = BeanModelLookup.get().getFactory(beans.get(0).getClass()); and this returns NULL. GWT's RequestFactory generator takes the proxy interfaces(that include the ones tagged with BeanModelTag) and generates an AutoBean implementation but which isn't tagged directly with BeanModelTag. This implementation is not found by TreeBeanModelReader which returns an assertion error for such beans. Please see the whole issue here.
If this is a change that you already thought about and have an alternative fix or perhaps if you missed it, I'd be glad to know your thoughts about it.
-
23 Jul 2011 4:25 PM #17
Hi guys,
I'm also trying to implement this solution and I'm getting the following error. Any ideas?
Thanks,Code:[ERROR] [] - Line 16: No source code is available for type com.extjs.gxt.ui.rebind.core.BeanModelGenerator; did you forget to inherit a required module? [ERROR] [] - Line 19: No source code is available for type com.google.gwt.core.ext.typeinfo.JClassType; did you forget to inherit a required module? [ERROR] [] - Line 19: No source code is available for type com.google.gwt.core.ext.typeinfo.JMethod; did you forget to inherit a required module? com.google.web.bindery.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:299) at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951) at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) 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:214) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.AssertionError: No BeanModelFactory found for class com.ronin.kioos.mapdesigner.client.connectivity.proxy.MallProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory$1 at com.extjs.gxt.ui.client.data.BeanModelReader.read(BeanModelReader.java:48) at com.extjs.gxt.ui.client.data.BeanModelReader.read(BeanModelReader.java:1) at com.extjs.gxt.ui.client.data.MemoryProxy.load(MemoryProxy.java:48) at com.extjs.gxt.ui.client.data.BaseLoader.loadData(BaseLoader.java:134) at com.extjs.gxt.ui.client.data.BaseLoader.load(BaseLoader.java:98) at com.extjs.gxt.ui.client.data.BaseLoader.load(BaseLoader.java:92) at com.ronin.kioos.mapdesigner.client.views.MapCanvas$1.onSuccess(MapCanvas.java:201) at com.ronin.kioos.mapdesigner.client.views.MapCanvas$1.onSuccess(MapCanvas.java:1) at com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.onSuccess(AbstractRequest.java:123) at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:266) at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951) at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) 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:214) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:619)
Ale
-
12 Oct 2011 5:15 AM #18
-
15 Nov 2011 11:39 AM #19
That pastebin code is no longer there. I am having the same problem as Algiano. What is the solution?
Similar Threads
-
theme generation
By isit.gd in forum Community DiscussionReplies: 6Last Post: 5 Nov 2009, 12:50 AM -
Dynamic Form Generation
By jhoweaa in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 13 May 2009, 5:04 AM -
tab generation by id
By arnold07 in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 19 Dec 2008, 2:22 AM -
API doc generation
By brov0010 in forum Community DiscussionReplies: 2Last Post: 17 Dec 2007, 11:38 AM


Reply With Quote