> We just updated to trunk to use the new AttachEvent (good timing,
> thanks!)

Temporarily retracting my previous praise, in Panel:

    @Override
    protected void onLoad() {
    }

No `super.onLoad()` means attach events don't fire for panels. I assume
this was not intended?

I'm going to patch our trunk build to add the super.onLoad call for now.

Out of curiosity, would an idiom like:

    private boolean onLoadWasCalled;

    protected void onAttach() {
      // other logic...
      onLoadWasCalled = false;
      onLoad();
      assert onLoadWasCalled == true : "a subclass did not call super.onLoad()";
    }

    protected void onLoad() {
      AttachEvent.fire(this, true);
      onLoadWasCalled = true;
    }

Be too forceful? If it's okay, it would ensure AttachEvent was always
fired. If it's not okay to break (with an assert) existing code that
does not call super.onLoad, then perhaps AttachEvent should be fired
from some place else that is less brittle?

- Stephen

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to