AuthForm authForm = (AuthForm) objListbox.getSelectedItem().getValue();
Tree funObjTree = (Tree) getFellow("funObjTree");
Set selectedFuns = funObjTree.getSelectedItems();
FunAuthDao faDao = new FunAuthDao();
Iterator selectedFunsItr = selectedFuns.iterator();
while (selectedFunsItr.hasNext()) {
StringBuffer sb = new StringBuffer();
Treeitem treeItem = (Treeitem) selectedFunsItr.next();
List children = treeItem.getChildren();
Iterator it = children.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof Treerow) {
Treerow treerow = (Treerow) obj;
List treeRowChildren = treerow.getChildren();
Iterator it2 = treeRowChildren.iterator();
while (it2.hasNext()) {
Object obj2 = it2.next();
Treecell cell = (Treecell) obj2;
Iterator it3 = cell.getChildren().iterator();
while (it3.hasNext()) {
Object obj3 = it3.next();
if (obj3 instanceof Checkbox) {
Checkbox cb = (Checkbox) obj3;
if (cb.isChecked()) {
sb.append(":");
sb.append(cb.getValue());
}
}
}
}
}
}
SimpleTreeNode node = (SimpleTreeNode) treeItem.getValue();
FunForm funForm = (FunForm) node.getData();
FunAuth funAuth = new FunAuth();
funAuth.setFun(funForm);
funAuth.setAuth(authForm);
if ("Y".equals(funForm.getBootFlag())) {
funAuth.setOperations(sb.toString());
}
funAuth.setOperateBy(operateBy);
faDao.create(funAuth);
}
refresheFunAuth(authForm);
}