Having trouble having UiHandlers register when extending from an
abstract class.
I can register UiHandlers in the abstract class fine, however the
extending class cannot register it's handles. Sample code below:
Abstract Class:
public abstract class GenericWidget extends Composite
{
@UiTemplate("template/GenericTemplate.ui.xml")
public interface GenericWidgetUiBinder extends UiBinder<Widget,
GenericWidget> {}
private static GenericWidgetUiBinder uiBinder = GWT.create
(GenericWidgetUiBinder.class);
@UiField FlowPanel chromePane;
@UiField Panel contentPane;
@UiField Label title;
@UiField Button toggleButton;
public GenericWidget(boolean hasChrome, String chromeTitle)
{
initWidget(uiBinder.createAndBindUi(this));
contentPane.add(initContent());
}
@UiHandler("toggleButton")
public void handleClick(ClickEvent event)
{
//do stuff
}
protected abstract Widget initContent();
}
Extending class:
public class AddPersonWidget extends GenericWidget {
@UiTemplate("template/AddPersonTemplate.ui.xml")
public interface AddPersonUiBinder extends UiBinder<Widget,
Widget> {}
private static AddPersonUiBinder uiBinder = GWT.create
(AddPersonUiBinder.class);
@UiField private TextBox firstname;
@UiField private TextBox lastname;
@UiField private HTML errorMsg;
@UiField private Button submit;
public AddPersonWidget()
{
super(true, ADD_PERSON_WIDGET_TITLE);
}
@Override
protected Widget initContent()
{
Widget content = new Widget();
content = uiBinder.createAndBindUi(content);
return content;
}
@UiHandler("submit")
public void submitButtonIsClicked(ClickEvent event)
{
submit.setVisible(false);
}
}
The UiHandler in the extending class does not register? Thanks GWT
Users.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.