Announcement

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

    Best practice: Forcing a Form with just DefaultValues to save / valuesHaveChanged=Yes

    Hi Isomorphic,

    I'm in a situation where I have a form I show on selecting a Tab. The FormItems have default values. When the user sees the default values and accepts them by just not changing them I want to treat the form as "dirty"/have form.valuesHaveChanged() return true.

    How is this best done? There is no method setValuesHaveChanged().

    Related question: Should setting a value to a HiddenItem via hiddenItem.setValue(x) make form.valuesHaveChanged() return true?

    Thank you & Best regards
    Blama

    #2
    The API is returning a correct value, you seem to be saying you want it to return an incorrect value?

    In this case, we would recommend you solve your problem another way. If you have code that is calling valuesHaveChanged() and you need it to return true in this case, instead of directly calling valuesHaveChanged(), call your own API And arrange for it to return true in this case.

    Comment


      #3
      Hi Isomorphic,

      thanks for the advice. I solved it differently. If I show only default values I do
      Code:
      boundForm.rememberValues();
      idHiddenItem.setValue(id);
      now.

      Best regards
      Blama

      Comment

      Working...
      X