Announcement

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

    Highlight edited values in a form

    I have a DynamicForm and sometimes I change the values programatically. The user is also able to change the values of the form.
    Is there any way to visually show the changed (but not saved) values in a different way? To somehow highlight unsaved changes in a form? (no matter if manual or programmatic unsaved changes).

    Using smartgwt 6.1p power
    Last edited by edulid; 7 Nov 2017, 05:15.

    #2
    You may have missed dynamicForm/FormItem.showPending.

    Comment


      #3
      Hi Isomorphic,

      I (not the OP) did not about with, either. It seems there is no showcase sample showing it. Perhaps you can add it, as it is a nice feature and would potentially be more used if it were better known.

      Best regards
      Blama


      PS: To test, just add showPending:true here.

      Comment


        #4
        Thanks, yes, I previously searched the showcase for this and did not find anything... it is an interesting feature so I also think the showcase should include this example.

        Comment


          #5
          Currently, you can see this feature in action in the "Pending Values" example in the Feature Explorer. However, as of tomorrow's build (November 9) in both the 12.0 and 11.1 branches, you will find the same example in the SmartGWT Showcase.

          Regards
          Isomorphic Software

          Comment


            #6
            what is the "Feature Explorer"? If I google for "smartgwt feature explorer" I get the showcase. What exactly do you mean?

            Comment


              #7
              Feature Explorer is the "SmartClient showcase", here for 11.1p, here for 12.0d.
              Interesting thing about it is that you can edit the samples code live, to it's very good to test features or to create small testcases.

              Best regards
              Blama

              Comment


                #8
                Hi Isomorphic,

                obviously minor, but in pendingValues Tahoe sample (now v11.1p_2017-11-08), the pending-Buttons for "Favorite Music Genres" and "Favorite Department" don't look nice dark-blue on lighter-dark-blue.

                Best regards
                Blama

                Comment


                  #9
                  Hi Isomorphic,

                  I can see the sample in the SmartGWT showcase now as well, thanks.
                  Please note that in addition to #8, changed values in "Favorite Cuisines" (cellPending*-styles) use Times New Roman as font (Tahoe v11.1p_2017-11-09).

                  Best regards
                  Blama

                  Comment


                    #10
                    Does this only work with manual changes to the form ? If I set a value programmatically the style doesn't change. Is this intended? And how to set the style manually if this is necessary ?

                    Comment


                      #11
                      See formItem.showPending(): pending values are shown if the item's currently value differs from what would be set by resetValues().

                      So if you call eg df.setValues() or setValue() you are establishing values that would be applied with resetValues(). Not true if you setValue() on an individual FormItem.

                      Comment


                        #12
                        I tried with both:
                        form.setValue(fieldName, (Date)value);
                        and
                        form.getField(fieldName).setValue((Date)value);

                        and both did not work.
                        If I change the value manually I see the new style, but the above is not working. Is this a bug? Since you say form.setValue() should work.
                        Using 6.1-p20171105 power

                        Comment


                          #13
                          We're not seeing the problem. If you download the latest SGWT LGPL Showcase, you can tweak PendingValuesSample.java to execute
                          Code:
                           favoritesForm.getItem("favoriteAnimal").setValue("Larry");
                          when the surrounding widget is clicked (say). Then you'll see that it changes the "Favorite Animal" item from "Lemur" to "Larry" with "Larry" now having a blue font indicating the pending value (like unsaved edits in a ListGrid).

                          If you're comfortable with JavaScript you can do the same think more quickly by going to the SmartClient 11.1p Showcase Pending Values Sample, opening a JavaScript console for your browser, and executing the code above (which is also valid JavaScript) in the console.

                          Comment


                            #14
                            We've made a change which should address the text color issue in pending values. Please try the next nightly build, dated Nov 23 or above.

                            Regards
                            Isomorphic Software

                            Comment


                              #15
                              Hi Isomorphic,

                              I can see that the color-issue is fixed in v11.1p_2017-11-23.
                              From your fix-post I'm not sure if you also saw the issue in #9.

                              Thank you & Best regards
                              Blama

                              Comment

                              Working...
                              X