GWT之怪现象

同样的一段代码,加上一句  Window.alert("Debug: 0000");    就可以继续执行,否则不行!!真是怪了.. 代码如下:
java 代码
  1. private void initLeftList() {   
  2.            
  3.         ufRoleService.loadAllUserRole(new AsyncCallback() {   
  4.             public void onFailure(Throwable caught) {   
  5.                 Window.alert("获得角色信息时,数据库出错!!");   
  6.             }   
  7.             public void onSuccess(Object result) {   
  8.                 List roles = (List) result;   
  9.                 if (roles != null) {   
  10.                     int count = 0;   
  11. //                  Window.alert("Debug: 0000");   
  12.                     roleTable.resize(roles.size(), 2);   
  13.                     for (Iterator iter = roles.iterator(); iter.hasNext();) {   
  14.                         UfRoleDTO element = (UfRoleDTO) iter.next();   
  15.                         roleTable.setText(count, 0, element.getRolename());   
  16.                         roleTable.getCellFormatter().
  17. addStyleName(count, 0"financeTableRowWithCheckBox2");   
  18.                         checkBoxs = new CheckBox[allFuncNodes.size()];   
  19.                         for (int i = 0; i < allFuncNodes.size(); i++) {   
  20.                             checkBoxs[i] = new CheckBox();   
  21.                             UfFuncregisterDTO dto = (UfFuncregisterDTO) allFuncNodes.get(i);   
  22.                             checkBoxs[i].setText(dto.getFunName());   
  23.                         }   
  24.                         Window.alert("Debug: 1111");   
  25.                         // 得到当前选择的用户的权限节点   
  26.                         ufRoleService.findByPk(element.getPkRole().toString(), new AsyncCallback() {   
  27.                             public void onFailure(Throwable caught) {   
  28.                                    
  29.                                 Window.alert("获得角色信息出错!!");   
  30.                             }   
  31.                             public void onSuccess(Object result) {   
  32.                                    
  33.                                 if(result == null) {   
  34.                                     Window.alert("角色为空!!");   
  35.                                     return ;   
  36.                                 }   
  37.                                 UfRoleDTO roleDTO = (UfRoleDTO) result;    
  38.                                 if(roleDTO.getUfRoleFuncs() != null) {   
  39.                                     //角色功能关联   
  40.                                     Iterator iter = roleDTO.getUfRoleFuncs().iterator();   
  41.                                     while(iter.hasNext()) {   
  42.                                         UfRoleFuncDTO roleFuncDTO = (UfRoleFuncDTO) iter.next();   
  43.                                         //得到功能节点主键   
  44.                                         UfFuncregisterDTO funDTO = roleFuncDTO.getUfFuncregisterDTO();   
  45.                                         validFunc.add(funDTO);   
  46.                                     }   
  47.                                 }   
  48.                             }   
  49.                         });   
  50. //                      Window.alert("Debug: 2222");   
  51. //                      将构造好的CheckBox加入到面版中   
  52.                         HorizontalPanel hPanel = new HorizontalPanel();   
  53.                         for (int i = 0; i < checkBoxs.length; i++) {   
  54.                             hPanel.add(checkBoxs[i]);   
  55.                         }   
  56.                         roleTable.setWidget(count, 1, hPanel);   
  57.                         roleTable.getCellFormatter().addStyleName(count, 1"financeTableRowWithCheckBox");   
  58.                         count ++;   
  59.                     }   
  60.                 }   
  61.             }   
  62.         });   
  63.     }  

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值