Changeset 7116


Ignore:
Timestamp:
Apr 7, 2016, 9:00:36 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1996: Filtering on the "Permission" column don't display the filter icon

Changes in ColumnDef fixes this issue.

There is a related issue with the "-" icon for clearing a single filter row. This is fixed by the changes in ItemContext.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java

    r7084 r7116  
    664664      {
    665665        context = table.getSc().getCurrentContext(table.getItem(), table.getSubcontext());
    666         if (!isVisible && context != null && getFilterproperty() != null)
     666        // Check if hidden columns have a filter
     667        if (!isVisible && context != null)
    667668        {
    668           // Check if there are any filters for this property
    669           hasFilter = context.hasPropertyFilter(getFilterproperty());
     669          if (isPermission)
     670          {
     671            hasFilter = context.getItemPermission() != null;
     672          }
     673          else if (getFilterproperty() != null)
     674          {
     675            hasFilter = context.hasPropertyFilter(getFilterproperty());
     676          }
    670677        }
    671678      }
     
    738745              sb.append("<option value=\"\">");
    739746              Permission permission = context.getItemPermission();
     747              hasFilter = permission != null;
    740748              appendPermissionOption(sb, permission, Permission.READ, "Read [R]");
    741749              appendPermissionOption(sb, permission, Permission.USE, "Use [U]");
  • trunk/src/core/net/sf/basedb/core/ItemContext.java

    r7030 r7116  
    482482    if (filterIndex < 0 || filterIndex >= numFilterRows) return numFilterRows;
    483483   
     484    // Permission filter is on the first row only
     485    if (filterIndex == 0) permission = null;
     486   
    484487    // We need to copy remaining filter to a new collection
    485488    if (propertyFilters != null && propertyFilters.size() > 0)
     
    781784  public int getNumPropertyFilters()
    782785  {
    783     return propertyFilters == null ? 0 : propertyFilters.size();
     786    return (propertyFilters == null ? 0 : propertyFilters.size()) + (permission != null ? 1 : 0);
    784787  }
    785788 
     
    793796  {
    794797    if (propertyFilters == null) return 0;
    795     int count = 0;
     798    int count = filterRow == 0 && permission != null ? 1 : 0;
    796799    for (PropertyFilterPair filterPair : propertyFilters.values())
    797800    {
Note: See TracChangeset for help on using the changeset viewer.