I’m building 2 columns of buttons, and after upgrading to GWT 2.4.0 I’m having problems with my click event.
On a pc after clicking the button, you have to move the mouse position to get the event to fire. On an iPad, the button has to be pressed a second time.
int rows = (int) Math.ceil( (double)alphaLettersList.size() / 2);
Grid toolbarGrid = new Grid(rows, 2);
int numRows = toolbarGrid.getRowCount();
int numColumns = toolbarGrid.getColumnCount();
int i = 0;
for (int col = 0; col < numColumns; col++) {
for (int row = 0; row < numRows; row++) {
if (i < alphaLettersList.size()) {
final String letter = (String) alphaLettersList.get(i).toUpperCase();
PushButton letterButton = new PushButton();
letterButton.setHTML("<div class='googleLetterBtn'>"+letter+"</div>");
letterButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
LocalSurveyManager2.getInstance().getArticlesForLetter(letter, RoomPanelArticleForLetterListener.getInstance());
}
});
toolbarGrid.setWidget(row, col, letterButton);
}
i++;
}
}
I solved this by using the MouseDownHandler and the TouchStartHandler instead of the ClickHandler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With