i have been trying to generate an array of check boxes and dynamic click handler for them but the handler is not working. Any suggestion will be most welcomed. Thanks in Advance for the time.

```
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());
                                }
                            });                                             
                    }                       

                }
            });             

        }
    });

}   

```