Changeset 7440


Ignore:
Timestamp:
Jan 25, 2018, 1:53:46 PM (4 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2106: Add support for custom list columns in any-to-any lists

A side-effect of the implementation is that it is also possible to add custom buttons to the toolbar.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java

    r7407 r7440  
    7979      Item.SESSION, Item.JOB, Item.MESSAGE, Item.PROJECT, Item.FILE, Item.FILESERVER,
    8080      Item.CHANGEHISTORY, Item.PERMISSIONTEMPLATE, Item.ITEMSUBTYPE, Item.ITEMLIST,
    81       Item.USERDEVICE
     81      Item.USERDEVICE, Item.ANYTOANY
    8282    };
    8383
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java

    r7428 r7440  
    659659      boolean isPermission = "permission".equals(getId()); // requires special handling
    660660      boolean isFilterable = (isFilterable() || isPermission) && table.getSc() != null &&  table.getItem() != null;
     661      boolean isSortable = isSortable() && table.getSc() != null &&  table.getItem() != null;
    661662      boolean isVisible = table.isColumnVisible(getId());
    662663      boolean hasFilter = false;
     
    697698          sb.append("></span>");
    698699        }
    699         if (!isSortable())
     700        if (!isSortable)
    700701        {
    701702          String theTooltip = getTooltip() != null ? getTooltip() : getTitle();
  • trunk/www/common/anytoany/list_anytoany.jsp

    r7314 r7440  
    4242  import="net.sf.basedb.core.query.Orders"
    4343  import="net.sf.basedb.core.query.Hql"
     44  import="net.sf.basedb.core.plugin.GuiContext"
     45  import="net.sf.basedb.util.Values"
     46  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    4447  import="net.sf.basedb.clients.web.Base"
    4548  import="net.sf.basedb.clients.web.util.HTML"
    46   import="net.sf.basedb.util.Values"
     49  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     50  import="net.sf.basedb.clients.web.extensions.JspContext"
     51  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     52  import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
     53  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
    4754  import="java.util.List"
    4855%>
    4956<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    5057<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
    51 
     58<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    5259<%
    5360String root = request.getContextPath() + "/";
     
    7178  ItemResultList<AnyToAny> links = query.list(dc);
    7279  long count = links.getTotalCount();
     80 
     81  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, new GuiContext(Item.ANYTOANY, GuiContext.Type.LIST), item);
     82  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
     83  ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext);
    7384  %>
    7485  <base:page type="include">
     
    97108            id="description"
    98109            title="Description"
     110          />
     111          <tbl:columndef
     112            id="xt-columns"
     113            extensions="<%=columnsInvoker%>"
     114            jspcontext="<%=jspContext%>"
    99115          />
    100116          <tbl:toolbar
     
    118134              disabled="<%=!deletePermission%>"
    119135            />
     136            <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     137              wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    120138          </tbl:toolbar>
    121139          <tbl:data>
     
    220238                  <%=toLink%></tbl:cell>
    221239                <tbl:cell column="description"><%=HTML.niceFormat(ata.getDescription())%></tbl:cell>
     240                <tbl:xt-cells dc="<%=dc%>" item="<%=ata%>">
     241                  <tbl:cell column="xt-columns" />
     242                </tbl:xt-cells>
    222243              </tbl:row>
    223244              <%
Note: See TracChangeset for help on using the changeset viewer.