Announcement

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

    5.1p: ListGrid editValues behaves differently depending on RowExit method

    Hi Isomorphic,

    I'm still trying to reproduce to create a testcase and found this different behavior depending on the way you exit an rowEditor.
    I used this testcase (v10.1p_2017-10-05 Classic Dev Mode, because it needs to be slow), but any ListGrid with editing should do it.
    • Exiting via key-up waits for the request to return.
    • Exiting via click outside accepts the change directly.
    In the video, the 1st change is via arrow-up, the 2nd via outside click (SmartGWT, one click is enough). See how long it takes after the 2nd click for the request to show in the Developer Console. The GUI already shows it as changed before the request returns - possibly with an error.

    Click image for larger version

Name:	ListGrid saved and displayes values in transition differently.gif
Views:	139
Size:	105.4 KB
ID:	249940

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.Version;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.GroupStartOpen;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS extends VLayout implements EntryPoint {
        private IButton recreateBtn;
    
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            setWidth100();
            setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    new MyWindow().show();
                }
            });
            addMember(recreateBtn);
            new MyWindow().show();
            draw();
        }
    
        private class MyWindow extends Window {
            public MyWindow() {
                setWidth("95%");
                setHeight("95%");
                setMembersMargin(0);
                setModalMaskOpacity(70);
                setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                setTitle("ListGrid editValues behaves differently depending on RowExit method" + getTitle());
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                centerInPage();
                ListGrid animalsLG = new AnimalsLG();
                addItem(animalsLG);
            }
        }
    
        private class AnimalsLG extends ListGrid {
            public AnimalsLG() {
                super(DataSource.get("animals"));
                setWidth(1000);
                setHeight100();
                setCanEdit(true);
                setAutoFetchData(false);
                setAutoFitExpandField("commonName");
                ListGridField lifeSpanLGF = new ListGridField("lifeSpan");
                ListGridField commonNameLGF = new ListGridField("commonName");
                ListGridField statusLGF = new ListGridField("status");
                statusLGF.setCanEdit(true); // Why is this needed?
                ListGridField dietLGF = new ListGridField("diet");
                setFields(commonNameLGF, lifeSpanLGF, statusLGF, dietLGF);
                setShowFilterEditor(true);
                setSortField("commonName");
                setGroupByField("status", "diet");
                setGroupStartOpen(GroupStartOpen.ALL);
                fetchData();
            }
        }
    }
    Best regards
    Blama


    #2
    We believe this is related to the other issue you reported in this thread, so it will be investigated after that is sorted out.

    Comment


      #3
      Hi Isomorphic

      this might be related to this similar issue, where the effect is different depending on the key used to exit the row editor.

      Best regards
      Blama

      Comment

      Working...
      X