Announcement Announcement Module
Collapse
No announcement yet.
FormModel.isDirty() doesn't seem to work ... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FormModel.isDirty() doesn't seem to work ...

    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

  • #2
    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.

    Comment


    • #3
      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

      Comment


      • #4
        Keith, Amad,

        there is indeed a bug in the is dirty checking code.

        This is the code from DefaultFormModel:

        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; }
            }
        }
        But as SwingFormModel uses ValidatingFormModels by default and they wrap the BufferedValueModel in a ValidatingFormValueModel the instanceof check will always fail.

        Ollie

        Comment


        • #5
          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

          Comment


          • #6
            Amad,

            Yes I will be taking care of it - hopefully today. I am back in Melbourne working on rich client right now.

            Comment

            Working...
            X