On 2/4/10 9:35 AM, Jacek Kałucki wrote: >>> 2) Why control is validated twice, when got and when lost focus? >>> I think there is no need to validate it when got focus, >>> since each value change is flushed either, within >>> _afterValueChanged() method >>> or in lost focus event. >>> >> If data is being validated on GotFocus, I believe it must be unintentional. >> Where are >> you seeing this? >> >> Note that activeControlValid() doesn't really run validation (so it has a >> bad name). >> It simply flushes the value of the active control which has the side-effect >> of >> running field validation. >> >> > > I know, but flushValue() calls form validateField() method. > On GotFocus, data is flushed in dControlMixinBase. > There is call chain: > __onGotFocus() -> > Form.activeControlValid() -> > ActiveControl.flushValue()
The assumption being that at that time, the old control is still the active control. We found this to be true[1] in the past; if you are finding it not to be true anymore let us know! [1] Specifically, we found that GotFocus of the new control fires before LostFocus of the old control. And some controls don't fire LostFocus at all. So we are probably adding redundancy in the name of safety. I've never noticed a performance problem. Paul _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
