1. #11
    Sencha User
    Join Date
    Jan 2011
    Posts
    30
    Vote Rating
    0
    mxhn is on a distinguished road

      0  

    Default


    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!

  2. #12
    Sencha User
    Join Date
    Jan 2011
    Posts
    30
    Vote Rating
    0
    mxhn is on a distinguished road

      0  

    Default


    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:

    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);
    					}
    
    				});
    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>.

    All these instances are not implementing BeanModelTag. TreeBeanModelReader tries to do this:

    Code:
    BeanModelFactory factory = BeanModelLookup.get().getFactory(beans.get(0).getClass());
    and it returns NULL because beans.get(0).getClass() doesn't implement BeanModelTag.


    Is there any way to make this work?


    Thank you!

  3. #13
    Sencha User
    Join Date
    Jan 2011
    Posts
    30
    Vote Rating
    0
    mxhn is on a distinguished road

      0  

    Default


    Any ideas?

  4. #14
    Sencha User
    Join Date
    Jan 2011
    Posts
    30
    Vote Rating
    0
    mxhn is on a distinguished road

      0  

    Default


    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!

  5. #15
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksæterøra, Norway
    Posts
    53
    Vote Rating
    2
    stigrv is on a distinguished road

      0  

    Default


    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.

  6. #16
    Sencha User
    Join Date
    Jan 2011
    Posts
    30
    Vote Rating
    0
    mxhn is on a distinguished road

      0  

    Default


    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.

  7. #17
    Sencha User
    Join Date
    Jul 2008
    Posts
    89
    Vote Rating
    0
    Algiano is on a distinguished road

      0  

    Default


    Hi guys,

    I'm also trying to implement this solution and I'm getting the following error. Any ideas?

    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)
    Thanks,
    Ale

  8. #18
    Sencha User
    Join Date
    Oct 2011
    Posts
    1
    Vote Rating
    0
    Twigger is on a distinguished road

      0  

    Default


    Quote Originally Posted by mxhn View Post
    Thank you so much. It helped me to resolve my problem. Code is fine!

  9. #19
    Sencha User abshnasko's Avatar
    Join Date
    Sep 2011
    Posts
    44
    Vote Rating
    0
    abshnasko is on a distinguished road

      0  

    Default


    That pastebin code is no longer there. I am having the same problem as Algiano. What is the solution?

Similar Threads

  1. theme generation
    By isit.gd in forum Community Discussion
    Replies: 6
    Last Post: 5 Nov 2009, 12:50 AM
  2. Dynamic Form Generation
    By jhoweaa in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 13 May 2009, 5:04 AM
  3. tab generation by id
    By arnold07 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 19 Dec 2008, 2:22 AM
  4. API doc generation
    By brov0010 in forum Community Discussion
    Replies: 2
    Last Post: 17 Dec 2007, 11:38 AM

Thread Participants: 4

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar