• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

hasChanged in Editgrid for Date Picker

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hasChanged in Editgrid for Date Picker

    In an Edit grid with Date Picker, when the date picker is clicked the hasChanged app variable sets to true even if the date is not changed.

  • #2
    I assume you are using local data? Are you using cell or row editing?

    Comment


    • #3
      Local data with cell editing

      Comment


      • #4
        What we are trying to do is, we have a form and an edit grid which opens together. Changes made to the form and edit grid needs to be saved at once, hence we have an app level button which we need to disable when nothing is changed and should be enabled as soon as something changes either on form or on edit grid.
        The problem we are facing is,
        Forms hasChanged is already set to true as soon as it gets loaded. we have use program to load the form with keep data on show.
        Editgrids hasChanged sets to true if we just click the date picker even if we do not change it.

        ??image.png?

        Comment


        • #5
          We have replicated the issue with cell editing and date fields and this will be fixed for the next update.

          Comment


          • #6
            Will it also address the issue where forms hasChanged is set to true when form show up. Here a program is called which sets form field values and then form is shown with keep data option.
            Note: form has drop downs

            Comment


            • #7
              So you are programmatically changing form field values? Did this work before in that it did not set on the hasChanged property? I would think this is doing the correct thing by setting hasChanged to true when if are changing the values.

              Comment


              • #8
                We are calling a Program which sets field values using SetResponse('formFieldValue'
                On Success, we show Form with Keep Data Option
                We do this because, same field on the form may get data from different files based on certain conditions, handling that in a data source query makes the query too complex.

                Same thing if we try using appVariable which is linked to General->Data in link to appvariable of the Form, where we set the appVariable to get all the data from the grid and then show the form using keep data. in this scenario the hasChanged property is not set to true

                Comment


                • #9
                  Not sure how to best handle this one. If we change the process so that setting a value of a form field does not trigger the hasChanged this will cause problems for those who rely on the fact that the field value has changed.

                  When using "data" linkage or reloading the form from the data source this resets the process because you are loading the entire record.

                  Comment


                  • #10
                    Give an option to reset the hasChanged Property. Just setting the appVariable to false does not reset it.
                    So, when we load the form using program for 1st time, we will rest it and any changes made after that would trigger the hasChanged property to set to true

                    Comment


                    • #11
                      For now, can you try the following approach:
                      • Add a new Event Listener named "resetFormHasChanged" or similar
                      • Add an "Execute Script" to this listener
                      Code:
                      setTimeout(function(){
                         setAppVar('YOUR_APP_VARIABLE':false);
                      },500);
                      success();
                      Add a line of code to your form helper program:
                      Code:
                      SetResponse('fireEvent':'resetFormHasChanged');

                      Comment


                      • #12
                        I applied this, and hasChanged did get set to false, but it did not change to true after actual changes were made.

                        Comment


                        • #13
                          We will setup a similar scenario on our end and then determine the best path forward.

                          Comment


                          • #14
                            This will be handled in the next update. There will be a new property that may be passed to SetResponse named "formFieldValueSilent". This update the value of the form field in a manner that the form will not recognize this field as being changed.

                            Code:
                            SetResponse('formFieldValueSilent':'MY_FIELD':'MY_VALUE');

                            Comment


                            • #15
                              If using the Form Helper there will be a new procedure named "SetValueSilent".

                              Comment

                              Working...
                              X