Ollie,
I have NestingFormModel and when I edit one of textfield on of the forms I do expect that my formModel.isDirty() would return true but it never returns true infact, no matter what i change.
Is it a bug or do I need to enable something.
Amad
Ollie,
I have NestingFormModel and when I edit one of textfield on of the forms I do expect that my formModel.isDirty() would return true but it never returns true infact, no matter what i change.
Is it a bug or do I need to enable something.
Amad
Amad,
Can you work with me on getting the dirty support up to par? I haven't yet integrated dirty support completely, mainly because I haven't had the requirement in my application. However, as you've found, there is some initial support there now, and the design seems right/to make sense.
Can you confirm you're using a Buffered form model? That is; bufferChangesDefault = true and all your form model value models are buffered? If so, they will maintain a dirty state, and the form model will iterate through all value models checking that state--if any buffered models are dirty, the form value model reports it is also dirty. This should work, if not, it is indeed a bug.
BTW; I should be available off and on; I am in Tampa -- we had to evacuate Melbourne -- and have internet here, but won't have access to it all the time.
Sure Keith, I will look be working on this later today, and will keep you posted. Also good luck during "Frances", you guys had enough already this year.
Amad
Keith, Amad,
there is indeed a bug in the is dirty checking code.
This is the code from DefaultFormModel:
But as SwingFormModel uses ValidatingFormModels by default and they wrap the BufferedValueModel in a ValidatingFormValueModel the instanceof check will always fail.Code:Iterator it = formValueModels.values().iterator(); while (it.hasNext()) { ValueModel model = (ValueModel)it.next(); if (model instanceof BufferedValueModel) { BufferedValueModel bufferable = (BufferedValueModel)model; if (bufferable.isDirty()) { return true; } } }
Ollie
Keith,
Would be looking at this problem? I understand that due to hurricane 'Frances' you are out in Tampa but I don't know if you are getting these messages are not...
Amad
Amad,
Yes I will be taking care of it - hopefully today. I am back in Melbourne working on rich client right now.
Keith Donald
Core Spring Development Team