这是我对话框的类别:
public class Question extends DialogBox {
public Question(int row, FlexTable flex) {
super (true);
setText( "Choose Action");
String outputString = flex.getWidget(row, 0).toString();
VerticalPanel panel = new VerticalPanel();
panel.add(new Label ("" + outputString));
panel.add(new Button( "edit"));
this.setWidget(panel);
}
}
这是我在flex表中的某些行上单击后创建我的盒子实例的方式,但是问题是我什么也没得到,单击任何行后都没有影响。
flex.addClickHandler(new ClickHandler() {
public void onClick (ClickEvent event){
int rowlndex = flex.getCellForEvent(event).getRowIndex();
// Window.alеrt("Row Clicked " + rowlndex); --- Works Properly
Question que = new Question(rowlndex, flex);
que.center();
que.show();
}
});