source: trunk/www/lims/plates/wells/list_wells.jsp @ 5674

Last change on this file since 5674 was 5674, checked in by Nicklas Nordborg, 12 years ago

Fixes #1611: Checkbox enabled lists for enumerated annotations

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 20.8 KB
Line 
1<%-- $Id: list_wells.jsp 5674 2011-06-27 12:29:52Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Johan Enell, Jari Häkkinen, Nicklas Nordborg, Martin Svensson
4  Copyright (C) 2007 Johan Enell, Nicklas Nordborg
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  @author Nicklas
24  @version 2.0
25--%>
26<%@ page pageEncoding="UTF-8" session="false"
27  import="net.sf.basedb.core.SessionControl"
28  import="net.sf.basedb.core.DbControl"
29  import="net.sf.basedb.core.Item"
30  import="net.sf.basedb.core.ItemContext"
31  import="net.sf.basedb.core.AnnotationType"
32  import="net.sf.basedb.core.AnnotationSet"
33  import="net.sf.basedb.core.Annotation"
34  import="net.sf.basedb.core.Plate"
35  import="net.sf.basedb.core.Well"
36  import="net.sf.basedb.core.ReporterType"
37  import="net.sf.basedb.core.Reporter"
38  import="net.sf.basedb.core.ItemQuery"
39  import="net.sf.basedb.core.ItemResultIterator"
40  import="net.sf.basedb.core.ItemResultList"
41  import="net.sf.basedb.core.Permission"
42  import="net.sf.basedb.core.PluginDefinition"
43  import="net.sf.basedb.core.ExtendedProperty"
44  import="net.sf.basedb.core.ExtendedProperties"
45  import="net.sf.basedb.core.PermissionDeniedException"
46  import="net.sf.basedb.core.query.Restrictions"
47  import="net.sf.basedb.core.query.Expressions"
48  import="net.sf.basedb.core.query.Orders"
49  import="net.sf.basedb.core.query.Hql"
50  import="net.sf.basedb.core.plugin.GuiContext"
51  import="net.sf.basedb.core.plugin.Plugin"
52  import="net.sf.basedb.core.data.ReporterData"
53  import="net.sf.basedb.util.Enumeration"
54  import="net.sf.basedb.clients.web.Base"
55  import="net.sf.basedb.clients.web.ModeInfo"
56  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
57  import="net.sf.basedb.clients.web.PermissionUtil"
58  import="net.sf.basedb.clients.web.util.HTML"
59  import="net.sf.basedb.util.Values"
60  import="net.sf.basedb.util.formatter.Formatter"
61  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
62  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
63  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
64  import="net.sf.basedb.clients.web.extensions.JspContext"
65  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
66  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
67  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
68  import="java.util.ArrayList"
69  import="java.util.List"
70  import="java.util.Map"
71  import="java.util.Date"
72%>
73<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
74<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
75<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
76<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
77<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
78<%!
79  private static final Item itemType = Item.WELL;
80  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
81%>
82<%
83final int plateId = Values.getInt(request.getParameter("plate_id"));
84final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
85final String ID = sc.getId();
86final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
87
88final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
89final String callback = request.getParameter("callback");
90final String title = mode.generateTitle("well", "wells");
91final DbControl dc = sc.newDbControl();
92ItemResultIterator<Well> wells = null;
93ItemResultList<AnnotationType> annotationTypes = null;
94try
95{
96  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
97  annotationTypes = annotationTypeQuery.list(dc);
98  final Plate plate = Plate.getById(dc, plateId);
99  final boolean createPermission = plate.hasPermission(Permission.WRITE);
100  final boolean deletePermission = createPermission;
101
102  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
103  final ItemQuery<ReporterType> typeQuery = ReporterType.getQuery();
104  typeQuery.order(Orders.asc(Hql.property("name")));
105  typeQuery.setCacheResult(true);
106  List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData");
107  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
108  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
109 
110  Enumeration<String,String> rows = new Enumeration<String, String>();
111  WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true);
112  for (int i=0; i<plate.getPlateType().getPlateGeometry().getRows(); i++)
113  {
114    rows.add(Integer.toString(i), rowFormatter.format(i));
115  }
116 
117  try
118  {
119    final ItemQuery<Well> query = Base.getConfiguredQuery(dc, cc, true, plate.getWells(), mode);
120    query.join(Hql.leftJoin(null, "reporter", "rpt", null, true));
121    if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row")));
122    if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column")));
123    wells = query.iterate(dc);
124  }
125  catch (Throwable t)
126  {
127    cc.setMessage(t.getMessage());
128    t.printStackTrace();
129  }
130  int numListed = 0;
131  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, plate);
132  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
133  %>
134  <base:page title="<%=title%>" type="<%=mode.getPageType()%>">
135  <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css">
136    <ext:scripts context="<%=jspContext%>" />
137    <ext:stylesheets context="<%=jspContext%>" />
138    <script language="JavaScript">
139    var submitPage = 'index.jsp';
140    var formId = 'wells';
141    function editItem(itemId)
142    {
143      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);
144    }
145    function viewItem(itemId)
146    {
147      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);
148    }
149    function itemOnClick(evt, itemId)
150    {
151      Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);
152    }
153    function configureColumns()
154    {
155      Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
156    }
157    function runPlugin(cmd)
158    {
159      Table.submitToPopup(formId, cmd, 540, 460);
160    }
161    function returnSelected()
162    {
163      Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);
164      window.close();
165    }
166    function presetOnChange()
167    {
168      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
169    }
170    function switchTab(tabControlId, tabId)
171    {
172      if (tabId == 'properties' || tabId == 'annotations' || tabId == 'history')
173      {
174        location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=plateId%>&tab='+tabId;
175      }
176      else if (tabId == 'events')
177      {
178        location.href = '../events/index.jsp?ID=<%=ID%>&plate_id=<%=plateId%>';
179      }
180      else
181      {
182        TabControl.setActiveTab(tabControlId, tabId);
183      }
184    }
185    function newReporterList()
186    {
187      Table.submitToPopup(formId, 'CreateReporterList', 540, 400);
188    }
189    </script>
190  </base:head>
191 
192  <base:body>
193    <p>
194    <p:path>
195      <p:pathelement title="Plates" href="<%="../index.jsp?ID="+ID%>" />
196      <p:pathelement title="<%=HTML.encodeTags(plate.getName())%>" />
197    </p:path>
198
199    <t:tabcontrol id="main" active="wells" switch="switchTab">
200    <t:tab id="properties" title="Properties" />
201    <t:tab id="annotations" title="Annotations" />
202    <t:tab id="events" title="Events" />
203   
204    <t:tab id="wells" title="Wells">
205   
206    <%
207    if (cc.getMessage() != null)
208    {
209      %>
210      <div class="error"><%=cc.getMessage()%></div>
211      <%
212      cc.setMessage(null);
213    }
214    %>
215    <tbl:table 
216      id="wells" 
217      clazz="itemlist" 
218      columns="<%=cc.getSetting("columns")%>"
219      sortby="<%=cc.getSortProperty()%>" 
220      direction="<%=cc.getSortDirection()%>"
221      title="<%=title%>"
222      action="index.jsp"
223      sc="<%=sc%>"
224      item="<%=itemType%>"
225      >
226      <tbl:hidden 
227        name="mode" 
228        value="<%=mode.getName()%>" 
229      />
230      <tbl:hidden 
231        name="plate_id" 
232        value="<%=String.valueOf(plateId)%>" 
233      />
234      <tbl:hidden 
235        name="callback" 
236        value="<%=callback%>" 
237        skip="<%=callback == null%>" 
238      />
239      <tbl:columndef 
240        id="row"
241        property="row"
242        datatype="int"
243        title="Row"
244        sortable="true" 
245        filterable="true"
246        exportable="true"
247        enumeration="<%=rows%>"
248        show="always"
249        formatter="<%=new WellCoordinateFormatter(true)%>" 
250      />
251      <tbl:columndef 
252        id="column"
253        property="column"
254        datatype="int"
255        title="Column"
256        sortable="true" 
257        filterable="true"
258        exportable="true"
259        show="always" 
260        formatter="<%=new WellCoordinateFormatter(false)%>" 
261      />
262      <tbl:columndef 
263        id="id"
264        clazz="uniquecol"
265        property="id"
266        datatype="int"
267        title="ID"
268        sortable="true"
269        filterable="true"
270        exportable="true"
271      />
272      <tbl:columndef 
273        id="parent"
274        title="Parent"
275      />
276      <tbl:columndef
277        id="reporterList"
278        property="$rpt.£reporterListScores"
279        datatype="int"
280        title="[Rep] Reporter list"
281        filterable="true"
282        enumeration="<%=Base.getReporterListsEnum(dc)%>"
283        multiple="false"
284      />
285      <tbl:columndef 
286        id="reporter.name"
287        property="reporter.name"
288        datatype="string"
289        title="[Rep] Name"
290        sortable="true" 
291        filterable="true"
292        exportable="true"
293      />
294      <tbl:columndef 
295        id="reporter.externalId"
296        clazz="uniquecol"
297        property="reporter.externalId"
298        datatype="string"
299        title="[Rep] ID"
300        sortable="true" 
301        filterable="true"
302        exportable="true"
303      />
304      <tbl:columndef 
305        id="reporter.symbol"
306        property="reporter.symbol"
307        datatype="string"
308        title="[Rep] Gene symbol"
309        sortable="true" 
310        filterable="true"
311        exportable="true"
312      />
313      <tbl:columndef 
314        id="reporter.description"
315        property="reporter.description"
316        datatype="string"
317        title="[Rep] Description" 
318        sortable="true" 
319        filterable="true" 
320        exportable="true"
321      />
322      <tbl:columndef 
323        id="reporter.entryDate"
324        property="reporter.entryDate"
325        datatype="date"
326        title="[Rep] Registered"
327        sortable="true" 
328        filterable="true"
329        exportable="true"
330        formatter="<%=dateFormatter%>"
331      />
332      <tbl:columndef 
333        id="reporter.lastUpdate"
334        property="reporter.lastUpdate"
335        datatype="timestamp"
336        title="[Rep] Last update" 
337        sortable="true" 
338        filterable="true" 
339        exportable="true"
340        formatter="<%=dateTimeFormatter%>"
341      />
342      <%
343      Enumeration<String, String> types = new Enumeration<String, String>();
344      ItemResultList<ReporterType> reporterTypes = typeQuery.list(dc);
345      types.add("", "- none -");
346      for (ReporterType rt : reporterTypes)
347      {
348        types.add(Integer.toString(rt.getId()), HTML.encodeTags(rt.getName()));
349      }
350      %>
351      <tbl:columndef 
352        id="reporter.reporterType"
353        property="reporter.reporterType"
354        sortproperty="reporter.reporterType.name"
355        exportproperty="reporter.reporterType.name"
356        datatype="int"
357        enumeration="<%=types%>"
358        title="[Rep] Type"
359        sortable="true" 
360        filterable="true"
361        exportable="true"
362      />
363      <%
364      if (reporterProperties != null)
365      {
366        for (ExtendedProperty ep : reporterProperties)
367        {
368          String name = ep.getName();
369          %>
370          <tbl:columndef
371            id="<%="reporter."+name%>"
372            property="<%="reporter."+name%>"
373            datatype="<%=ep.getType().getStringValue()%>"
374            title="<%="[Rep] "+HTML.encodeTags(ep.getTitle())%>"
375            sortable="true"
376            filterable="true"
377            exportable="true"
378            formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, ep)%>"
379          />
380          <%
381        }
382      }
383      %>
384      <%
385      for (AnnotationType at : annotationTypes)
386      {
387        Enumeration<String, String> annotationEnum = null;
388        Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
389        if (at.isEnumeration())
390        {
391          annotationEnum = new Enumeration<String, String>();
392          List<?> values = at.getValues();
393          for (Object value : values)
394          {
395            String encoded = formatter.format(value);
396            annotationEnum.add(encoded, encoded);
397          }
398        }
399        %>
400        <tbl:columndef 
401          id="<%="at"+at.getId()%>"
402          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
403          property="<%="#"+at.getId()%>"
404          annotation="true"
405          datatype="<%=at.getValueType().getStringValue()%>"
406          enumeration="<%=annotationEnum%>"
407          smartenum="<%=at.getDisplayAsList() %>"
408          sortable="false" 
409          filterable="true" 
410          exportable="true"
411          formatter="<%=formatter%>"
412          unit="<%=at.getDefaultUnit()%>"
413        />
414        <%
415      }
416      %>
417      <tbl:columndef
418        id="permission"
419        title="Permission"
420      />
421      <tbl:toolbar
422        visible="<%=mode.hasToolbar()%>"
423        >
424        <tbl:button 
425          image="columns.gif" 
426          onclick="configureColumns()" 
427          title="Columns&hellip;" 
428          tooltip="Show, hide and re-order columns" 
429        />
430        <tbl:button
431          image="add.png"
432          onclick="newReporterList()"
433          title="New reporter list&hellip;"
434          tooltip="Create a new reporter list from matching wells"
435          visible="<%=sc.hasPermission(Permission.CREATE, Item.REPORTERLIST)%>"
436        />
437        <tbl:button 
438          image="import.gif" 
439          onclick="runPlugin('ImportItems')" 
440          title="Import&hellip;" 
441          tooltip="Import data" 
442          visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
443        />
444        <tbl:button 
445          image="export.gif" 
446          onclick="runPlugin('ExportItems')" 
447          title="Export&hellip;" 
448          tooltip="Export data" 
449          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
450        />
451        <tbl:button 
452          image="runplugin.gif" 
453          onclick="runPlugin('RunListPlugin')" 
454          title="Run plugin&hellip;" 
455          tooltip="Run a plugin" 
456          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
457        />
458        <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
459          wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
460      </tbl:toolbar>
461      <tbl:navigator
462        page="<%=cc.getPage()%>" 
463        rowsperpage="<%=cc.getRowsPerPage()%>" 
464        totalrows="<%=wells == null ? 0 : wells.getTotalCount()%>" 
465        visible="<%=mode.hasNavigator()%>"
466      />
467      <tbl:data>
468        <tbl:columns>
469        <tbl:presetselector 
470          clazz="columnheader"
471          colspan="3"
472          onchange="presetOnChange()"
473        />
474        </tbl:columns>
475         
476        <tr>
477          <tbl:header 
478            clazz="index"
479            >&nbsp;</tbl:header>
480          <tbl:header 
481            clazz="check" 
482            visible="<%=mode.hasCheck()%>"
483            ><base:icon 
484              image="check_uncheck.gif" 
485              tooltip="Check/uncheck all" 
486              onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;"
487            /></tbl:header>
488          <tbl:header 
489            clazz="check" 
490            visible="<%=mode.hasRadio()%>"
491            />
492          <tbl:header 
493            clazz="icons" 
494            visible="<%=mode.hasIcons()%>"
495            >&nbsp;</tbl:header>
496          <tbl:propertyfilter />
497        </tr>
498   
499          <tbl:rows>
500          <%
501          int index = cc.getPage()*cc.getRowsPerPage();
502          int selectedItemId = cc.getId();
503          if (wells != null)
504          {           
505            while (wells.hasNext())
506            {
507              Well item = wells.next();
508              int itemId = item.getId();
509              boolean writePermission = item.hasPermission(Permission.WRITE);
510              String tooltip = mode.isSelectionMode() ? 
511                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 
512              index++;
513              numListed++;
514              %>
515              <tbl:row>
516                <tbl:header 
517                  clazz="index"
518                  ><%=index%></tbl:header>
519                <tbl:header 
520                  clazz="check" 
521                  visible="<%=mode.hasCheck()%>"
522                  ><input 
523                      type="checkbox" 
524                      name="<%=itemId%>" 
525                      value="<%=itemId%>" 
526                      title="TODO" 
527                      <%=cc.getSelected().contains(itemId) ? "checked" : ""%>
528                    ></tbl:header>
529                <tbl:header 
530                  clazz="check" 
531                  visible="<%=mode.hasRadio()%>"
532                  ><input 
533                      type="radio" 
534                      name="item_id" 
535                      value="<%=itemId%>" 
536                      title="TODO" 
537                      <%=selectedItemId == itemId ? "checked" : ""%>
538                    ></tbl:header>
539                <tbl:header 
540                  clazz="icons" 
541                  visible="<%=mode.hasIcons()%>"
542                  >&nbsp;</tbl:header>
543                <tbl:cell column="row"><div class="link" 
544                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 
545                  title="<%=tooltip%>"><tbl:cellvalue value="<%=item.getRow()%>" /></div></tbl:cell>
546                <tbl:cell column="column"><tbl:cellvalue value="<%=item.getColumn()%>"/></tbl:cell>
547                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
548                <tbl:cell column="parent">
549                  <%
550                  try
551                  {
552                    Well parent = item.getParent();
553                    if (parent == null)
554                    {
555                      %>
556                      <i>- none -</i>
557                      <%
558                    }
559                    else
560                    {
561                      %>
562                      <%=Base.getLink(ID, 
563                        parent.getPlate().getName() + " [" + parent.getRow() + ", " + parent.getColumn() + "]", 
564                        Item.WELL, parent.getId(), true)%>
565                      <%
566                    }
567                  }
568                  catch (PermissionDeniedException ex)
569                  {
570                    %>
571                    <i>- denied -</i>
572                    <%
573                  }
574                  %>
575                </tbl:cell>
576                <%
577                ReporterData reporter = item.getReporter();
578                if (reporter == null)
579                {
580                  %>
581                  <tbl:cell column="reporter.name"><i>- none -</i></tbl:cell>
582                  <tbl:cell column="reporter.externalId"><i>- none -</i></tbl:cell>
583                  <%
584                }
585                else
586                {
587                  %>
588                  <tbl:cell column="reporter.name"><%=Base.getLink(ID, reporter.getName(), Item.REPORTER, reporter.getId(), true)%></tbl:cell>
589                  <tbl:cell column="reporter.externalId"><%=HTML.encodeTags(reporter.getExternalId())%></tbl:cell>
590                  <tbl:cell column="reporter.symbol"><%=HTML.encodeTags(reporter.getSymbol())%></tbl:cell>
591                  <tbl:cell column="reporter.description"><%=HTML.encodeTags(reporter.getDescription())%></tbl:cell>
592                  <tbl:cell column="reporter.entryDate" value="<%=reporter.getEntryDate()%>" />
593                  <tbl:cell column="reporter.lastUpdate" value="<%=reporter.getLastUpdate()%>" />
594                  <tbl:cell column="reporter.reporterType"
595                    ><base:propertyvalue 
596                      dbcontrol="<%=dc%>" 
597                      item="<%=reporter%>" 
598                      property="reporterType"
599                      enableEditLink="<%=mode.hasEditLink()%>" 
600                      enablePropertyLink="<%=mode.hasPropertyLink()%>"
601                    /></tbl:cell>
602                  <%
603                  if (reporterProperties != null)
604                  {
605                    for (ExtendedProperty ep : reporterProperties)
606                    {
607                      String name = ep.getName();
608                      %>
609                      <tbl:cell column="<%="reporter."+name%>"><tbl:cellvalue value="<%=reporter.getExtended(name)%>" /></tbl:cell>
610                      <%
611                    }
612                  }
613                }
614                AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;
615                if (as != null)
616                {
617                  for (AnnotationType at : annotationTypes)
618                  {
619                    if (as.hasAnnotation(at))
620                    {
621                      Annotation a = as.getAnnotation(at);
622                      String suffix = a.getUnitSymbol(null);
623                      if (suffix != null) suffix = "&nbsp;" + suffix;
624                      %>
625                      <tbl:cell 
626                        column="<%="at"+at.getId()%>"
627                        ><tbl:cellvalue 
628                          list="<%=a.getValues(null)%>"
629                          suffix="<%=suffix%>"
630                      /></tbl:cell>
631                      <%
632                    }
633                  }
634                }
635                %>
636                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
637              </tbl:row>
638              <%
639            }
640          }
641          %>
642          </tbl:rows>
643        </tbl:data>
644      <%
645      if (numListed == 0)
646      {
647        %>
648        <tbl:panel><%=wells == null || wells.getTotalCount() == 0 ? "No wells were found" : "No wells on this page. Please select another page!" %></tbl:panel>
649        <%
650      }
651      else
652      {
653        %>
654        <tbl:navigator
655          page="<%=cc.getPage()%>" 
656          rowsperpage="<%=cc.getRowsPerPage()%>" 
657          totalrows="<%=wells == null ? 0 : wells.getTotalCount()%>" 
658          visible="<%=mode.hasNavigator()%>"
659          locked="true"
660        />
661        <%
662      }
663      %>
664    </tbl:table>
665    <base:buttongroup align="center">
666      <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />
667      <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
668      <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />
669    </base:buttongroup>
670 
671    </t:tab>
672    <t:tab id="history" title="Change history" 
673        tooltip="Displays a log of all modifications made to this item"
674        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" />
675    </t:tabcontrol>
676
677 
678  </base:body>
679  </base:page>
680  <%
681}
682finally
683{
684  if (wells != null) wells.close();
685  if (dc != null) dc.close();
686}
687%>
Note: See TracBrowser for help on using the repository browser.