同样的一段代码,加上一句
Window.alert("Debug: 0000");
就可以继续执行,否则不行!!真是怪了.. 代码如下:
java 代码
- private void initLeftList() {
- ufRoleService.loadAllUserRole(new AsyncCallback() {
- public void onFailure(Throwable caught) {
- Window.alert("获得角色信息时,数据库出错!!");
- }
- public void onSuccess(Object result) {
- List roles = (List) result;
- if (roles != null) {
- int count = 0;
- // Window.alert("Debug: 0000");
- roleTable.resize(roles.size(), 2);
- for (Iterator iter = roles.iterator(); iter.hasNext();) {
- UfRoleDTO element = (UfRoleDTO) iter.next();
- roleTable.setText(count, 0, element.getRolename());
- roleTable.getCellFormatter().
- addStyleName(count, 0, "financeTableRowWithCheckBox2");
- checkBoxs = new CheckBox[allFuncNodes.size()];
- for (int i = 0; i < allFuncNodes.size(); i++) {
- checkBoxs[i] = new CheckBox();
- UfFuncregisterDTO dto = (UfFuncregisterDTO) allFuncNodes.get(i);
- checkBoxs[i].setText(dto.getFunName());
- }
- Window.alert("Debug: 1111");
- // 得到当前选择的用户的权限节点
- ufRoleService.findByPk(element.getPkRole().toString(), new AsyncCallback() {
- public void onFailure(Throwable caught) {
- Window.alert("获得角色信息出错!!");
- }
- public void onSuccess(Object result) {
- if(result == null) {
- Window.alert("角色为空!!");
- return ;
- }
- UfRoleDTO roleDTO = (UfRoleDTO) result;
- if(roleDTO.getUfRoleFuncs() != null) {
- //角色功能关联
- Iterator iter = roleDTO.getUfRoleFuncs().iterator();
- while(iter.hasNext()) {
- UfRoleFuncDTO roleFuncDTO = (UfRoleFuncDTO) iter.next();
- //得到功能节点主键
- UfFuncregisterDTO funDTO = roleFuncDTO.getUfFuncregisterDTO();
- validFunc.add(funDTO);
- }
- }
- }
- });
- // Window.alert("Debug: 2222");
- // 将构造好的CheckBox加入到面版中
- HorizontalPanel hPanel = new HorizontalPanel();
- for (int i = 0; i < checkBoxs.length; i++) {
- hPanel.add(checkBoxs[i]);
- }
- roleTable.setWidget(count, 1, hPanel);
- roleTable.getCellFormatter().addStyleName(count, 1, "financeTableRowWithCheckBox");
- count ++;
- }
- }
- }
- });
- }