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

  • 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

    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:

        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) {
                    processResponse(requestId, response);
                public void onFailure(Throwable caught, boolean alreadyHandled) {
                    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

  • #2
    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:

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

    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...



    • #3
      Got a similar problem after upgrading to smartGWT 2.5



      • #4

        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 :)


        • #5
          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.