Pages

Monday, May 5, 2014

Difference between "modified" and "dataChanged" form data methods on datasource fields

When overriding methods on a form data object, it is important to know what they do exactly!  Two methods in particular, formdataobject.modified() and formdataobject.dataChanged(), sound very similar but are different.


The important difference is that dataChanged() runs EVERY time the data is changed, while modified() only runs after successful validation!

This may seem like a "duh" post for some, but I was surprised at the number of people who couldn't tell me the difference.

So if a user changes data on a form, it may fail validation and modified() would never run.  This is often where you would prefer to hook your code since if the field doesn't truly change, you don't want anything triggered.

8 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Another difference is that dataChanged() event is invoked even when control value is not changed manually. I mean for example, when you init fieldValue in the process and the control value will change due to that init, dataChanged event is invoked, when modified event is only invoked when you manually change value.

    ReplyDelete
  3. Another difference is that dataChanged() event is invoked even when control value is not changed manually. I mean for example, when you init fieldValue in the process and the control value will change due to that init, dataChanged event is invoked, when modified event is only invoked when you manually change value.

    ReplyDelete
  4. Individual data must not be moved to nations outside the European pengeluaran hk

    ReplyDelete
  5. Pasarqq tempat Bermain judi bandarq online tentunya menjadi di antara pilihan yang tidak sedikit dipilih oleh pemain website bandarq .Bisa anda lihat profile terkait pasarqq ternama melalui metode klik link https://findery.com/pasarqq , lalu https://www.thebaynet.com/profile/noverakasanti888 kemudian https://fontlibrary.org/en/member/pasarqq/ dan juga http://www.myfolio.com/pasarqq.
    Selain itu juga pasarqq ini memiliki homepage personal seperti https://pasarqq.cabanova.com/
    http://rebuildingtogethernb.org/selamat-datang-di-situs-poker-online-pasarqq/
    http://sonidoslibertarios.org/selamat-datang-di-situs-poker-online-pasarqq/
    http://jonnymugwump.com/selamat-datang-di-situs-poker-online-pasarqq/

    ReplyDelete