Results 1 to 4 of 4

Thread: [ENHANCEMENT] Field.onBlur() repeatedly calls getValue

  1. #1

    Default [ENHANCEMENT] Field.onBlur() repeatedly calls getValue

    In Field.onBlur() is the following fragment:

    if ((focusValue == null && getValue() != null)
    || (focusValue != null && !focusValue.equals(getValue()))) {
    fireChangeEvent(focusValue, getValue());
    }


    getValue() is called 3 times where it could be called just once with:

    Object currentValue = getValue();
    if ((focusValue == null && currentValue != null)
    || (focusValue != null && !focusValue.equals(currentValue))) {
    fireChangeEvent(focusValue, currentValue);
    }

    Inconsequential when getValue() is trivial. I've got a pretty complicated getValue() in a custom class and I'm not sure that it is consequential there, but no reason to do unnecessary work.

  2. #2

    Default Only called twice, but still extra work

    Okay, getValue() is only called twice, but that still one more than necessary.

    Code fragment from 2.0 M2.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Thanks for investigating. Will be changed with my next commit.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Changed in SVN

Posting Permissions

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