我一直在尝试为它们生成一组复选框和动态单击处理程序,但处理程序不起作用。
任何建议都将受到欢迎。提前感谢您的时间。
private void addButtonListener() {
goButton.addClickHandler(new ClickHandler() {
@SuppressWarnings("rawtypes")
@Override
public void onClick(ClickEvent arg0) {
String strQuery="Select BRANCH_NAME from SAMPLE_ACC_BRANCH where GL_CODE='"+gll_textfield.getText().trim()+"'";
HibernateImplUtils.getSearchResult(strQuery, new AsyncCallback() {
private int i;
@Override
public void onFailure(Throwable arg0)
{arg0.printStackTrace();}
@Override
public void onSuccess(Object arg0) {
System.err.println("Inside Success");
List branchNameList=(List) arg0;
System.err.println("Branch List:::"+branchNameList);
for(i=0;i<branchNameList.size();i++){
checkbox[i]=new CheckBox((String) branchNameList.get(i));
vpanel.add(checkbox[i]);
checkbox[i].addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
if(checkbox[i].getValue()){
System.out.println("NAME::::"+checkbox[i].getText());
}
System.out.println("Selected check box ::::"+checkbox[i].getText());
}
});
}
}
});
}
});
}