GWT Custom Event Handler

后端 未结 8 568
慢半拍i
慢半拍i 2020-12-07 16:44

Can someone give me an example of creating a custom set of an Event and a Handler. Say you have a Person object that you want your widgets to know if it got updated.

相关标签:
8条回答
  • 2020-12-07 17:28

    You might want to have a look at the ValueChangeHandler and ValueChangeEvent in GWT 1.6. Those might work for what you're trying to do.

    0 讨论(0)
  • 2020-12-07 17:31

    One additional comment: if you try do to something similar to react in a main application to an event fired from a custom GUI component (like a composite etc.), I think you have to wire the main app explicitly to handle the component's event:

    yourComponent.addHandler(this, YourEvent.TYPE);
    

    where "this" is the class that implements your custom handler interface.

    0 讨论(0)
提交回复
热议问题