Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 22nd Aug 2011, 05:10
a.reiter a.reiter is offline
Registered Developer
 
Join Date: Mar 2010
Posts: 41
Default TreeGrid, GwtRpcDataSource and SmartGWT 2.5

Hi everybody

i did the upgrade to GWT 2.3.0 an SmartGWT 2.5 (at the moment it is a nightly build http://www.smartclient.com/builds/SmartGWT/2.x/LGPL/2011-08-16)

unfortunatelly a couple of things are not working just like before

for example: i use my own class WindowRecord which extends TreeNode in my TreeGrid

the executeFetch method of my datasource (extending GwtRpcDataSource) looks like this:

Code:
    @Override
    protected void executeFetch(final DSRequest request, final DSResponse response) {
        final String requestId = request.getRequestId();
        final WindowRecord parentNode = new WindowRecord(request.getAttributeAsJavaScriptObject("parentNode"));
        
        endpointHandler.fetch(parentNode, new AbstractAsyncCallback<WindowRecord[]>() {
            
            public void onSuccess(WindowRecord[] result) {
                response.setData(result);
                processResponse(requestId, response);
            }
            
            public void onFailure(Throwable caught, boolean alreadyHandled) {
                response.setStatus(RPCResponse.STATUS_FAILURE);
                processResponse(requestId, response);
            }
        });
    }
so the added nodes are all from type WindowRecord, if i open a folder, ths fetch is done fine, the children are added to the tree, but the node, which was opened is suddenly replaced by a ListGridRecord, so the folder is not a WindowRecord any more

all my methods handling the events try to cast the nodes to WindowRecords, which leads now to a ClassCastException...

any thoughts about this?
it looks, like i'm forced to switch back to old version
Reply With Quote
  #2  
Old 13th Sep 2011, 02:36
dead_passive dead_passive is offline
Registered Developer
 
Join Date: Jul 2010
Posts: 10
Default

I think I'm having the same issue. I've got a class which extends TreeNode which I've called DataTreeNode. Unfortunately since upgrading to SmartGWT 2.5 these nodes are not being added to my tree correctly.

The issue seems to be in the TreeNode.getOrCreateRef method:

Code:
public static TreeNode getOrCreateRef(JavaScriptObject jsObj) {
        if(jsObj == null) return null;
        RefDataClass obj = RefDataClass.getRef(jsObj);
        if(obj != null && obj instanceof TreeNode) {
            obj.setJsObj(jsObj);
            return (TreeNode) obj;
        } else {
            return new TreeNode(jsObj);
        }
    }
For me, the line

Code:
RefDataClass obj = RefDataClass.getRef(jsObj);
is returning null, so my node isn't actually being added to the tree.

At least I think this is where everything is going wrong...

Jon
Reply With Quote
  #3  
Old 5th Dec 2011, 23:33
MKunz MKunz is offline
Registered Developer
 
Join Date: Jul 2010
Posts: 44
Default

Got a similar problem after upgrading to smartGWT 2.5

-> http://forums.smartclient.com/showthread.php?t=19912
Reply With Quote
  #4  
Old 4th Feb 2013, 02:12
MKunz MKunz is offline
Registered Developer
 
Join Date: Jul 2010
Posts: 44
Default

Hi,

one of you guys with this similar problem found any solution for this? Found this in my old bookmarks and want to know if somebody made a solution in his code example :)
Reply With Quote
  #5  
Old 12th Feb 2013, 03:27
Youri Youri is offline
Registered Developer
 
Join Date: Feb 2013
Posts: 3
Default

I think I'm facing the same issue, I would be interested for a solution too especially since I will be forced to upgrade smartgwt version because of the issues with Firefox 18.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
2.5 SelectItem pick list width bug (standalone project included) sunnyl Smart GWT Technical Q&A 1 15th Aug 2011 16:02
TreeGrid and folder icons tgiaccone Smart GWT Technical Q&A 1 10th Sep 2010 12:03
Reorder within TreeGrid using Drag'n'drop barsum Smart GWT Technical Q&A 4 6th Apr 2010 15:39
Add root node to TreeGrid with GwtRpcDataSource jojky Smart GWT Technical Q&A 8 27th Feb 2010 00:42
SmartGWT and DateItem serialization sunnyl Smart GWT Technical Q&A 1 10th Jan 2010 10:53

© 2010,2011 Isomorphic Software. All Rights Reserved