PDA

View Full Version : BasicForm isDirty() works unexpected when using combo.setValue(XXX) after AJAX call



toolware
21 Oct 2010, 7:08 PM
I have a form with a bunch of fields and a combo box.

When I initialize the form, I use setValue(xxx) in quite a few places. When I check formPanel.getForm().isDirty() - it works as expected (in a scenario where I submit the form).

I added another element to my form (combo), that triggers an AJAX call, which, when it returns, does combo.setValue(xxx).

It seems that this action marks my form as dirty, since after this, isDirty() always returns true.

Please advise - I thought using setValue() sets a new "clean" state var for the field?

Thanks!

toolware
22 Oct 2010, 2:05 PM
I saw in this thread:
http://www.sencha.com/forum/showthread.php?24164-IsDirty-amp-BasicForm.load()
...that setting
trackResetOnLoad: true
...would fix this issue.

However, my form is still marked dirty when my ajax method returns and does setValue() on the combo.

No clues???

toolware
25 Oct 2010, 6:53 AM
Oops I just realized I posted this in the wrong forum. Please close.