我正在构建 2 列按钮,升级到 GWT 2.4.0 后,我的点击事件出现问题。
在 PC 上单击按钮后,您必须移动鼠标位置才能触发事件。在 iPad 上,必须再次按下该按钮。
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++;
}
}