Announcement

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

    Edit problem in TreeGrid - losing focus

    Version: SmartClient Version: v8.3p_2013-06-13/PowerEdition Deployment (built 2013-06-13)

    Description: If you edit a cell in a tree grid (F2 or dbl-click) and then cursor down, then next cell is opened and text is selected but then focus is lost a split second later, preventing you from typing.

    This happens only when the tree grid has a single field, if a second field is added, the focus is held properly.

    Additional note: Under IE 9 and 10, focus and selection is lost/confused even when multiple columns are visible, although you can still cursor up/down.

    Showcase sample to demonstrate:
    Code:
    /*
     * Isomorphic SmartGWT web presentation layer
     * Copyright 2000 and beyond Isomorphic Software, Inc.
     *
     * OWNERSHIP NOTICE
     * Isomorphic Software owns and reserves all rights not expressly granted in this source code,
     * including all intellectual property rights to the structure, sequence, and format of this code
     * and to all designs, interfaces, algorithms, schema, protocols, and inventions expressed herein.
     *
     *  If you have any questions, please email <sourcecode@isomorphic.com>.
     *
     *  This entire comment must accompany any portion of Isomorphic Software source code that is
     *  copied or moved from this file.
     */
    
    package com.smartgwt.sample.showcase.client.dataintegration.java.datasource;
    
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.FetchMode;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.VLayout;
    import com.smartgwt.client.widgets.tree.TreeGrid;
    import com.smartgwt.sample.showcase.client.PanelFactory;
    import com.smartgwt.sample.showcase.client.ShowcasePanel;
    import com.smartgwt.sample.showcase.client.SourceEntity;
    
    
    public class SimpleCustomDataSourceSample extends ShowcasePanel {
        private static final String DESCRIPTION = "<p>This example shows an entirely custom DataSource. It is created by extending <b>BasicDataSource</b> and implementing the four core CRUD methods. In this case, we maintain a static List of Maps that is initialized with hard-coded data every time the server starts; but of course, this code could do anything. This approach allows completely custom data operations to be simply plugged in to the SmartGWT Server framework.</p>" +
                "<p>Note also that this code deals directly with Java <code>Maps</code> and <code>Lists</code>, without worrying about format conversions - even custom code leverages the SmartGWT Server's automatic and transparent translation of request data, from JSON to Java and back to JSON.</p>";
    
        public static class Factory implements PanelFactory {
    
            private String id;
    
            public Canvas create() {
                SimpleCustomDataSourceSample panel = new SimpleCustomDataSourceSample();
                id = panel.getID();
                return panel;
            }
    
            public String getID() {
                return id;
            }
    
            public String getDescription() {
                return DESCRIPTION;
            }
        }
    
        protected boolean isTopIntro() {
            return true;
        }
    
        public Canvas getViewPanel() {
    
            DataSource customDS = DataSource.get("customDataSource_user");
    
            final TreeGrid userList = new TreeGrid();
            userList.setWidth(600);
            userList.setHeight(224);
            userList.setDataSource(customDS);
            userList.setCanEdit(true);
    //        userList.setCanRemoveRecords(true);
            userList.setLeaveScrollbarGap(false);
            userList.setDataFetchMode(FetchMode.LOCAL);
            userList.setAutoFetchData(true);
            userList.setFields(
                    new ListGridField("userName")
                    );
    
            IButton addButton = new IButton("Create User");
            addButton.setWidth(110);
            addButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    userList.startEditingNew();
                }
            });
    
            VLayout layout = new VLayout(15);
            layout.addMember(userList);
            layout.addMember(addButton);
    
            return layout;
        }
    
        public String getIntro() {
            return DESCRIPTION;
        }
    
        public SourceEntity[] getSourceUrls() {
            return new SourceEntity[] {
                    new SourceEntity("UserDataSource.java", JAVA, "source/datasource/UserDataSource.java.html", true)
            };
        }
    }
    Last edited by mattcecile; 21 Oct 2013, 12:59. Reason: Adding more details

    #2
    We're having trouble reproducing this problem.
    Can you try with the latest nightly build from your branch and let us know if the problem persists.
    If so - it sounds like you're seeing this in all browsers when you have just one column, an in IE9 and IE10, even if you have more than one column.

    Lets just focus on one reproducible (for you) case - the test case you attached with a single column.
    Just to clarify
    - can you confirm which browsers and OS you're testing this on?
    - Are you testing in compiled mode or development mode?
    - what are your steps within the example which reproduce the problem? Our assumption is that you load the page, double click on some row and then (without making any edits), use the down arrow key to move to the next row. Is that accurate, or are there any other steps to reproduce the problem.
    - is the issue 100% reproducible for you, or is it intermittent?

    Thanks
    Isomorphic Software

    Comment


      #3
      Thanks for the reply.

      Browsers: FF 17 ESR, Chrome v30, IE9, IE10
      Compiled mode and Dev mode both.
      100% reproducible

      Steps to reproduce:
      1) Load page and expand tree and edit cell with F2
      2) *Change cell contents
      3) Cursor down
      4) Next cell is selected and highlighted then loses focus

      If you don't change the cell, all is fine so I think that is the difference with our tests.

      If you change the code to add a garbage column to the tree grid (one that doesn't match a real datasource column), the issue goes away (so I have a workaround for now, except on IE).

      I haven't tried the latest nightly build as yet but the IE10 behaviour exists against your live showcase on www.smartclient.com, so I assume the issue still exists.

      Thanks, Matt

      Comment


        #4
        We had already tried such a sequence and didn't see the issue you describe.

        The Showcase shows what version it's running and it's not the latest build. So next step is to test against the latest build.

        Comment


          #5
          I've confirmed that the problem does not exist in the latest version.

          Comment


            #6
            Great, thanks.

            Comment

            Working...
            X