I have an @Templated class which extends composite. In the Errai-UI documentation https://docs.jboss.org/author/display/ERRAI/Errai+UI#ErraiUI-Concepts is says:
Event handler methods annotated with a bare @EventHandler annotation (no annotation parameter) are wired to receive events on the @Templated component itself.
If I try to use a base @EventHandler My IDE shows this as an error and the build fails with
annotation org.jboss.errai.ui.shared.api.annotations.EventHandler is missing value
Strangely, devmode doesn't give me an error, but the page never loads--it just shows a blank page.
Is there a way to add and EventHandler to my templated class?
Which version of Errai are you using? This feature (@EventHandlers without parameters defaulting to this) was introduced in Errai 2.2.0.CR1.
Here's an example using the feature:
That's it, Christian. I am still on 2.1.0. I didn't realize that the docs are available like that for the next release. I'll have to see if I can restrict myself to reading only published docs.
Would it be possible for the docs to indicate when a feature was introduced? I love that feature of the Java javadocs. If I end up reading the 1.7 docs I can tell if the feature is in 1.5.
Yes, we started adding "since" annotations to chapters in confluence at some point, but removed them when we realized that we had to process them manually in the exported docs for releases (because e.g. all chapters in the released docs should refer to functionality that's actually available in that release). I still think having these annotations is a good idea but we need to automate our doc export more.