Version(s) of Ext GWT
GXT 3.0 RC

Browser versions and OS
(and desktop environment, if applicable)
  • Firefox 10, Windows 7 (32bit)
Virtual Machine
No

Description

On drag&drop uncommitted data is lost.

Run mode

both

Steps to reproduce the problem
  • Fill values into editable grid (inline editor)
  • Drad and drop into the same table (self target).
  • All your uncommitted data is gone.
Expected result
No data loss.

Actual result
Data loss.

Test case
Code:
     public void onModuleLoad()
    {
        ListStore<Proxy> store;
        Grid<Proxy> grid;

        Window window = new Window();
        window.setPixelSize(540, 360);
        window.setModal(true);
        window.setBlinkModal(true);
        window.setHeadingText("Test");

        VerticalLayoutContainer c = new VerticalLayoutContainer();
        window.setWidget(c);

        // --- grid ---
        ColumnConfig<Proxy, String> ccCountry = new ColumnConfig<Proxy, String>(ProxyProperties.INSTANCE.country(), 100, "C1");
        ColumnConfig<Proxy, String> ccDepartment = new ColumnConfig<Proxy, String>(ProxyProperties.INSTANCE.department(), 100, "C2");
        ColumnConfig<Proxy, String> ccInstitute = new ColumnConfig<Proxy, String>(ProxyProperties.INSTANCE.institute(), 100, "C3");
        ColumnConfig<Proxy, String> ccState = new ColumnConfig<Proxy, String>(ProxyProperties.INSTANCE.state(), 100, "C4");
        ColumnConfig<Proxy, String> ccUniversity = new ColumnConfig<Proxy, String>(ProxyProperties.INSTANCE.university(), 60, "C5");

        // row numbering
        RowNumberer<Proxy> numberer = new RowNumberer<Proxy>(new IdentityValueProvider<Proxy>());

        List<ColumnConfig<Proxy, ?>> ccl = new ArrayList<ColumnConfig<Proxy, ?>>();
        ccl.add(numberer);
        ccl.add(ccCountry);
        ccl.add(ccDepartment);
        ccl.add(ccInstitute);
        ccl.add(ccState);
        ccl.add(ccUniversity);

        store = new ListStore<Proxy>(ProxyProperties.INSTANCE.id());
        grid = new Grid<Proxy>(store, new ColumnModel<Proxy>(ccl));
        grid.getView().setAutoFill(true);
        grid.getView().setEmptyText("Empty");
        grid.getView().setShowDirtyCells(true);
        grid.getStore().setAutoCommit(false);
        grid.setBorders(true);
        grid.setSelectionModel(new GridSelectionModel<Proxy>());
        grid.getSelectionModel().setSelectionMode(Style.SelectionMode.SINGLE);

        // reordering
        final GridDragSource<Proxy> source = new GridDragSource<Proxy>(grid);
        final GridDropTarget<Proxy> dropTarget = new GridDropTarget<Proxy>(grid);
        dropTarget.setAllowSelfAsSource(true);
        dropTarget.setFeedback(DND.Feedback.INSERT);

        // editing
        final GridEditing<Proxy> editing = new GridInlineEditing<Proxy>(grid);
        editing.addEditor(ccCountry, new TextField());
        editing.addEditor(ccDepartment, new TextField());
        editing.addEditor(ccInstitute, new TextField());
        editing.addEditor(ccState, new TextField());
        editing.addEditor(ccUniversity, new TextField());

        // start row numbering
        numberer.initPlugin(grid);

        c.add(grid, new VerticalLayoutContainer.VerticalLayoutData(-18, -1));
        window.show();

        store.add(new Proxy("-", "A", "-", "", "-", 1));
        store.add(new Proxy("-", "B", "-", "", "-", 2));
        store.add(new Proxy("-", "C", "-", "", "-", 3));
        store.add(new Proxy("-", "D", "-", "", "-", 4));
        store.add(new Proxy("-", "E", "-", "", "-", 5));
        store.add(new Proxy("-", "F", "-", "", "-", 6));
    }

    public static class Proxy
    {

        private String country;
        private String department;
        private String institute;
        private String state;
        private String university;
        private Integer id;

        public Proxy(String country, String department, String institute, String state, String university, Integer id)
        {
            this.country = country;
            this.department = department;
            this.institute = institute;
            this.state = state;
            this.university = university;
            this.id = id;
        }

        public Integer getId()
        {
            return id;
        }

        public void setId(Integer id)
        {
            this.id = id;
        }

        public String getCountry()
        {
            return country;
        }

        public void setCountry(String country)
        {
            this.country = country;
        }

        public String getDepartment()
        {
            return department;
        }

        public void setDepartment(String department)
        {
            this.department = department;
        }

        public String getInstitute()
        {
            return institute;
        }

        public void setInstitute(String institute)
        {
            this.institute = institute;
        }

        public String getState()
        {
            return state;
        }

        public void setState(String state)
        {
            this.state = state;
        }

        public String getUniversity()
        {
            return university;
        }

        public void setUniversity(String university)
        {
            this.university = university;
        }

    }

    public interface ProxyProperties extends PropertyAccess<Proxy>
    {

        ProxyProperties INSTANCE = GWT.create(ProxyProperties.class);

        ValueProvider<Proxy, String> country();

        ValueProvider<Proxy, String> department();

        ValueProvider<Proxy, String> institute();

        ValueProvider<Proxy, String> state();

        ValueProvider<Proxy, String> university();

        ModelKeyProvider<Proxy> id();

    }
Workaround Enable auto-commit.