I have a handler classes, I need to inject it in the custom widgets.
I tried the bind() method in ClientModule class, but it is not getting injected.
What am I supposed to do, do get the class injected.
public class ExtendedTextBoxBase extends TextBox {
public ExtendedTextBoxBase() {
super.addBlurHandler(textBoxBlurHandler);
}
@Inject
TextBoxBlurHandler textBoxBlurHandler; /* custom handler */
}
custom handler:
public class TextBoxBlurHandler implements BlurHandler {
@Inject
public TextBoxBlurHandler() {
}
@Override
public void onBlur(BlurEvent event) {
}
}
Thanks, Bennet.
Initial reaction: did you include and @Inject statement in the method (likely constructor) where you would like to inject the handler?
If yes: could you be more specific with some code snippets?