Object[] groupIds = getSelections().getAllSelected().toArray(); List groups = getGroups(); Collection deletedGroups = DataCollectionUtil.findByPrimaryKey(groups, groupIds); Iterator i = deletedGroups.iterator(); while (i.hasNext()) { Group group = (Group) i.next(); context.deleteGroup(group); }
context.deleteGroups(getSelections().getAllSelected());
    public void deleteGroup(IRequestCycle cycle_) {        SettingDao context = getSettingContext();        Object[] groupIds = getSelections().getAllSelected().toArray();        List groups = getGroups();        Collection deletedGroups = DataCollectionUtil.findByPrimaryKey(groups, groupIds);        Iterator i = deletedGroups.iterator();        while (i.hasNext()) {            Group group = (Group) i.next();            context.deleteGroup(group);        }    }