Announcement

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

    Using setOptionDataSource and autoFetchData together clears edited values

    SmartGWT Version: 8.2/LGPL Development Only (built 2011-12-05)
    IE9, GWT 2.4, Dev Mode

    When using setOptionDataSource (in this example, on a ComboBox) together with setAutoFetchData, any edited values disappear when editing another column in the same row.

    Let me break it down:

    - there is a listgrid with two columns, both of which have a combobox editor
    - the comboboxes have setOptionDataSource set to the datasource where it should get values
    - the comboboxes have setAutoFetchData set to true so that we don't need to click twice to edit

    Steps to replicate:
    1) edit the first column
    2) exit the editor
    3) try to edit the second column
    4) observe that the value from the first column has been erased and lost completely

    When un-setting setAutoFetchData, behavior works as expected.

    I've attached a standalone test case demonstrating the issue.

    Thanks,
    Brian
    Attached Files

    #2
    Please try a recent patched build and let us know if you still see an issue.

    Comment


      #3
      Hi Isomorphic,

      I just tried using Version: v8.2p_2012-08-06/LGPL Development Only (built 2012-08-06) and the problem still exists.

      Thanks,
      Brian

      Comment


        #4
        You're setting autoSaveEdits:false with no DataSource and data provided as a simple Array of Records. In this situation, the only possible meaning of autoSaveEdits:false is - please discard my edits, I have some other way of saving them.

        So that's what's happening.

        Comment


          #5
          Then why does it work when I set autoFetchData to false?

          In the real application I have an actual DataSource backing the component and the same problem occurs. How are we supposed to use autoSaveEdits:false and autoFetchData:false together, then? We don't want to save the record until the user clicks on "save", and we don't want the user to have to click twice to open a combo box that pulls its data from an optionDataSource.

          Edits shouldn't be discarded when you start editing another field.

          Comment


            #6
            This doesn't seem to be a problem in the normal case (actual DataSource and autoSaveEdits:false) so far as we can tell.

            Comment


              #7
              Originally posted by Isomorphic View Post
              This doesn't seem to be a problem in the normal case (actual DataSource and autoSaveEdits:false) so far as we can tell.
              I just modified my example to add a clientOnly DataSource to the ListGrid, with setTestData being called with the initial data.

              Here's the erroneous behavior:

              1) If the user starts editing the cell, but cancels without changing, then tries to edit again, all values disappear. This doesn't make any sense at all, as there are no edited values.
              2) If the user edits the cell, exits the editor, then starts editing again, all values disappear.

              Both behaviors go away when setting setAutoFetchData to false on the combo box.

              I don't believe this has anything to do with setAutoSaveEdits:false or lack of DataSources. The only change I'm making is setAutoFetchData on the combo box and the behavior goes away. Even with setAutoSaveEdits:true the behavior occurs.

              Thanks for your attention,
              Brian
              Attached Files
              Last edited by bschrameck; 6 Aug 2012, 12:33. Reason: forgot the attachment

              Comment


                #8
                OK, we'll take a look at this revised test case and see if we can reproduce the issue.

                Comment


                  #9
                  We have now made a change which we believe resolves this. Please try the next nightly build (3.1d branch)

                  Thanks
                  Isomorphic Software

                  Comment

                  Working...
                  X