Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1220 in a recent build.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default .validate() doesn't test un-saved fields of a retrieved model

    .validate() doesn't test un-saved fields of a retrieved model


    If I set properties via the set method on a model, they don't get picked up immediately for validation. To workaround this, I'm creating a dummy model that I don't save with the same properties. This shouldn't be necessary.

    For example, this always fails with a 'unique' validation:
    Code:
        var currentModel = getCurrentModel();
        currentModel.set('name', newName);
        var errors = currentModel.validate();
        if (!errors.isValid()) {
             error();
        }
        else {
            currentModel.save();
        }
    I have to use this workaround:
    Code:
        var currentModel = getCurrentModel();
        currentModel.set('name', newName);
        var testModel = Ext.create('MyModel', {name:newName});
        var errors = testLiftModel.validate();
        if (!errors.isValid()) {
             error();
        }
        else {
            currentModel.save();
        }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Vote Rating
    756
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thank you for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    This seems to have been fixed in the next release (Beta) as I'm not able to reproduce this bug. Please let us know if you still encounter this issue after the beta release.

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Cool


    I likely won't test this until the final release, or the first patch after, given my experience trying to port to PR3, but if this is still in issue an whatever release I eventually migrate to, my automated tests will catch it and I'll re-file a report.

    I feel good that you couldn't reproduce the problem in the beta, though. This gives me hope for a smoother migration next time!

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar