Ignore:
Timestamp:
Jun 26, 2020, 12:51:46 PM (2 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2216: Improve API for adding and removing items to an item list

Added a test case for the new add and remove methods.

Existing functionality in the web client has been updated to use the new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/itemlists/members/index.jsp

    r7604 r7834  
    223223      query.setMaxResults(-1);
    224224    }
    225     int count = list.add(query.iterate(dc));
     225    int count = list.add(query);
    226226    dc.commit();
    227227    message = count + " members added to list";
     
    231231    // Delete all selected items on the list page
    232232    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, subContext, pageContext, defaultContext);
    233     for (int itemId : cc.getSelected())
    234     {
    235       list.removeItem((Listable)itemType.getById(dc, itemId));
    236     }
     233    list.removeItems(cc.getSelected());
    237234    dc.commit();
    238235    redirect = listPage;
Note: See TracChangeset for help on using the changeset viewer.