Assuming the following *.ui.xml file:
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<g:VerticalPanel>
<g:Label ui:field="Label1"></g:Label>
<g:Label ui:field="Label2"></g:Label>
<g:Label ui:field="Label3"></g:Label>
</g:VerticalPanel>
If I now want to add ClickHandlers to all three Labels like this:
@UiHandler("Label1")
void handleClick(ClickEvent event) {
//do stuff
}
@UiHandler("Label2")
void handleClick(ClickEvent event) {
//do stuff
}
@UiHandler("Label3")
void handleClick(ClickEvent event) {
//do stuff
}
I get an error, because I have 3 methods with the same name. Is there a way around this, other than creating custom widgets and add those to the VerticalPanel?