Results 1 to 6 of 6

Thread: FormModel.isDirty() doesn't seem to work ...

  1. #1
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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.

  3. #3
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    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

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    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

  5. #5
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    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

  6. #6
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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

Similar Threads

  1. Replies: 4
    Last Post: Aug 19th, 2005, 02:07 PM
  2. Replies: 1
    Last Post: Aug 1st, 2005, 01:52 AM
  3. Replies: 1
    Last Post: Jul 7th, 2005, 03:49 PM
  4. Replies: 3
    Last Post: Dec 22nd, 2004, 02:30 PM
  5. Spring can't work on Eclipse
    By ryanhowai in forum Architecture
    Replies: 1
    Last Post: Nov 9th, 2004, 06:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •