Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • mouchard
    replied
    I'll reply to myself.

    After reading a little bit more the documentation, I can see that the Id of the selected node is set into the DSRequest within a criteria which is called "parentId".

    Here is a piece of the GenericGwtRpcDataSource class

    Code:
    	@Override
    	protected void executeFetch(final String requestId,
    			final DSRequest request, final DSResponse response) {
    		
    		//The ResultTree's DSRequests ask for the immediate children of a node only (by specifying parentId in the criteria).
    		String parentId = request.getCriteria().getAttribute("parentId");
                    //... take the parentId to pass it to the fetch method...
    		
    		serviceAsync.fetch(parentId,
    				new AsyncCallback<List<D>>() {
    			public void onFailure(Throwable caught) {
    				response.setStatus(RPCResponse.STATUS_FAILURE);
    				processResponse(requestId, response);
    			}
    
    			public void onSuccess(List<D> result) {
    				List<R> records = new ArrayList<R>();
    				for (D data : result) {
    					R newRec = getNewRecordInstance();
    					copyValues(data, newRec);
    					records.add(newRec);
    				}
    
    				response.setData(records.toArray(new Record[records.size()]));
    				processResponse(requestId, response);
    			}
    		});
    	}

    Leave a comment:


  • mouchard
    replied
    Is it possible to do load on demand with this kind of architecture and using treeGrid without changing fetch method?

    Or do I need to change the fetch method in order to identify which node has been selected and return children of this node?

    Thanks :-)

    Leave a comment:


  • Nikd
    replied
    Please can someone post an example with TileGrid and DataSourceImageField to display images?

    Leave a comment:


  • Nikd
    replied
    Hi Marbot, i just imported the ListGridTest project to test in Eclipse and i get the following errors:

    Code:
    [ERROR][listgridtest] - 00:19:24.292:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj,status: -1,context: undef,startRow: 0,endRow: 0,totalRows: 0}
    [ERROR][listgridtest] - 00:19:24.295:RDQ8:WARN:ResultSet:isc_ResultSet_0 (created by: isc_OID_1):get: invalid index -1
    [ERROR][listgridtest] - 00:20:18.956:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: undef,status: -1,context: undef,startRow: 0,endRow: 0,totalRows: 0}
    [ERROR][listgridtest] - 00:20:25.590:RDQ9:WARN:ResultSet:isc_ResultSet_0 (created by: isc_OID_1):get: invalid index -1
    Code:
    00:19:24.281 [ERROR][listgridtest] 00:19:24.292:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj,
    status: -1,
    context: undef,
    startRow: 0,
    endRow: 0,
    totalRows: 0}
    
    com.smartgwt.client.core.JsObject$SGWT_WARN: 00:19:24.292:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj,
    status: -1,
    context: undef,
    startRow: 0,
    endRow: 0,
    totalRows: 0}
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        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.invokeNativeVoid(ModuleSpace.java:289)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.data.DataSource.processResponse(DataSource.java)
        at mytest.client.lib.GenericGwtRpcDataSource$1.onFailure(GenericGwtRpcDataSource.java:158)
        at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:237)
        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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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(Unknown Source)
    Code:
    Initializing AppEngine server
    Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
    Successfully processed C:\Documents and Settings\Nikd\Desktop\ListGridTest\ListGridTest\war\WEB-INF/appengine-web.xml
    Successfully processed C:\Documents and Settings\Nikd\Desktop\ListGridTest\ListGridTest\war\WEB-INF/web.xml
    The server is running at http://localhost:3373/
    [WARN] No file found for: /favicon.ico
    [WARN] No file found for: /favicon.ico
    [ERROR] javax.servlet.ServletContext log: yourServlet: An IncompatibleRemoteServiceException was thrown while processing this call.
    com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Expecting version 5 from client, got 7. )
    	at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:432)
    	at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:236)
    	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:186)
    	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
    	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    	at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:94)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:326)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    
    [ERROR] javax.servlet.ServletContext log: yourServlet: An IncompatibleRemoteServiceException was thrown while processing this call.
    com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Expecting version 5 from client, got 7. )
    	at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:432)
    	at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:236)
    	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:186)
    	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
    	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    	at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:94)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:326)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    I can't find the error, since i have not altered any file from the file i downloaded.

    edit: I just changed some parameters on project's options and worked! Though still i get some errors ( sometimes like WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj,status: -1,context: undef,startRow: 0,endRow: 0,totalRows: 0} ).
    Last edited by Nikd; 21 Jun 2011, 06:22.

    Leave a comment:


  • mouchard
    replied
    Hello guys!
    This is an old post but I hope that someone is going to reply :-)

    I've adapted the zip project to fit with TreeGrid instead of ListGrird.

    So only the "YourEntryPoint" class has changed.

    and within the "YourDataSource' class I changed the "getDataSourceFields" to fit with my object.

    Code:
    	@Override
    	public List<DataSourceField> getDataSourceFields() {
    
    		List<DataSourceField> fields = new ArrayList<DataSourceField>();
    
    		DataSourceIntegerField riskIdField = new DataSourceIntegerField("riskId", "riskId");
    		riskIdField.setHidden(true);
    		riskIdField.setPrimaryKey(true);
    
    		DataSourceTextField labelField = new DataSourceTextField("label", "Label");
    		labelField.setRequired(true);
    
    		DataSourceIntegerField parentIdField = new DataSourceIntegerField("parentId", "parentId");
    		parentIdField.setRequired(true);
    		parentIdField.setForeignKey("riskId");
    		parentIdField.setRootValue("1");
    
    		setClientOnly(true);
    		
    		setFields(riskIdField,labelField,parentIdField);
    
    		return fields;
    	}
    As far as I don't set the "setForeignKey", the treegrid works fine.
    I can see the element appearing within the table but without parent/child node structure. They are all at the same leve. (that's normal)

    But as soon as I set the "setForeignKey", I receive an uncaugh exception and my browser send me message saying smth like the script is running slowly. Would you like to stop the script.

    Code:
    14:58:30.593 [ERROR][listgridtest] Uncaught exception escaped
    com.google.gwt.core.client.JavaScriptException: (Error): Unknown failure
     description: Unknown failure
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
        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:188)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
        at java.lang.Thread.run(Unknown Source)
    Thanks in advance for your help :-)
    Last edited by mouchard; 23 May 2011, 05:20.

    Leave a comment:


  • nritouet
    replied
    All right, I found the answer.
    The data I used were not enough, he was already getting all of them.
    When I use more than 60 results, it works.

    Leave a comment:


  • nritouet
    replied
    Hi Marbot,

    Thanks a lot for your work, it helped a lot.

    I'm trying to implement server side paging using your code, but I have a small problem, paging seems to be disabled (data loaded entirely at launch) although I followed your procedure.

    - the fetch method in the Service returns a GenericGwtRpcList and totalRows is also correctly set
    - clientOnly set to false in GwtRpcDataSource
    - Here's where I build the listgrid :
    Code:
            statisticsGrid.setWidth(1000);
            statisticsGrid.setHeight(400);
            statisticsGrid.setHeaderHeight(50);
            statisticsGrid.setAutoFetchData(true);
            statisticsGrid.setDataFetchMode(FetchMode.PAGED);
            statisticsGrid.setShowAllRecords(false);
            statisticsGrid.setDataPageSize(20);
            statisticsGrid.setShowGridSummary(false);
            statisticsGrid.setAlternateRecordStyles(true);
            // no menu button on hover
            statisticsGrid.setShowHeaderMenuButton(false);
            // context menu?
            statisticsGrid.setShowHeaderContextMenu(true);
    		
            statisticsGrid.setDataSource(ReportDS.getInstance());
            statisticsGrid.setFields(tstArray.toArray(new ListGridField[0]));
    What's weird is that there's a few ajax requests made at launch (without scrolling) and each of them have a different startrow and endrow.
    1st request : startrow 0, endrow 20
    2nd : 0, 30
    3rd : 20, 48
    4th : 38, 49
    The total rows is always 49.

    This happens with IE8, FF 3.6, Chrome 8.
    I use SmartGWT LGPL 2.1 but same problem occurs with 2.2 and 2.4 nightly build.

    Any idea ?

    Thanks in advance for your help, Nico.

    Leave a comment:


  • dekely
    replied
    Nice work :)
    I'm working with hibernate, is it possible to work with complex entity?
    For example, Employee that has a set of Address (Set<Address>).

    Thanks
    Dekel

    Leave a comment:


  • ron.lawrence
    replied
    marbot,

    Thanks, I got it.

    Isomorphic,

    I hadn't though of this, and I'll see if that is reasonable to do. I'll be sure to let them know about the licensing.

    Leave a comment:


  • Isomorphic
    replied
    Gotcha. However, note that:

    1) depending on how well factored the GWT-RPC services are, you might be able to just call them via DMI, leaving all the downstream code intact. This is likely to be lower effort.

    2) licenses are scoped to the developer, so, as long as it's only you building and maintaining this portion of the new application, you can introduce Pro/EE into the project. But yes, if they then wanted to maintain it without you, then they'd need a license.

    Leave a comment:


  • marbot
    replied
    Hi Ron

    ListGridTest.zip is back online.

    Of course, Isomophic is right: it's really basic functionality, and it would be MUCH better to go for the EE/Pro version, which is worth every penny.

    enjoy
    marbot
    Last edited by marbot; 4 Oct 2010, 12:51.

    Leave a comment:


  • ron.lawrence
    replied
    The short answer is that there is another project I've been tasked to work on here that is pure GWT and it could really use a trivial ListGrid, but we really don't have the time to re-engineer it to use pro/ee on the server side. I was hoping to throw together something quick with smartgwt to show the benefit of this approach, but don't have the blessing to get another license just yet.

    Leave a comment:


  • Isomorphic
    replied
    Hi Ron,

    Just wondering why you'd pursue this? This would force you to build DTOs, create your own server validation, re-invent declarative security, and lots of similar extra effort.

    Leave a comment:


  • ron.lawrence
    replied
    Hi marbot,

    I just tried to access your zip file at http://www.marbot.org/ListGridTest.zip and I get a page stating "Sorry, the page you are looking for is not found.". Is there any way you can post it elsewhere? Alternatively, if anyone still has this file from above, can they post it somewhere? maybe on http://code.google.com/p/smartgwt/ ?

    Leave a comment:


  • jrich
    replied
    Hi Marbot,

    I have been using your code perfectly for a while now, thank you.
    I was just wondering if you had ever looked at file uploads form a form using it and if so, if you had any pointers?

    Kind Regards
    Jen

    Not to worry, I have used a servlet!
    Last edited by jrich; 27 Aug 2010, 02:12.

    Leave a comment:

Working...
X