source: branches/3.18-stable/www/common/columns/submit_preset.jsp @ 7957

Last change on this file since 7957 was 7957, checked in by Nicklas Nordborg, 22 months ago

References #2253: Configure sticky column

It should now be possible to select a sticky column in the "Configure columns" dialog. The setting is stored in the current ItemContext under the key columns.sticky.

So far, only the raw bioassays list page has been update to use the new setting.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1<%-- $Id: submit_preset.jsp 7957 2021-06-03 07:39:33Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, 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  Configure the order and visibility of columns in a table of items.
24  This page will use the TableColumn.getTableColumns(item) to retreive the
25  list of all available columns for that item type and
26  getSession().getSetting(item+".columns") to retreive a comma-separated
27  list of the current order of visible columns.
28
29  @param item The type of items in the table
30  @param cmd
31    - Save: To save the settings
32    - otherwise: A configuration dialouge is displayed
33  @param columns Only used if cmd=Save. Contains a comma-separated list
34    of column ID:s which is saved to a user-client setting.
35
36  @author Nicklas
37  @version 2.0
38--%>
39<%@ page pageEncoding="UTF-8" session="false"
40  import="net.sf.basedb.core.SessionControl"
41  import="net.sf.basedb.core.Item"
42  import="net.sf.basedb.core.ItemContext"
43  import="net.sf.basedb.clients.web.util.HTML"
44  import="net.sf.basedb.util.Values"
45  import="net.sf.basedb.clients.web.Base"
46%>
47<%
48final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
49final String ID = sc.getId();
50final Item itemType = Item.valueOf(request.getParameter("item_type"));
51final String subContext = Values.getString(request.getParameter("subcontext"), "");
52final String cmd = request.getParameter("cmd");
53final String root = request.getContextPath()+"/";
54final String name = request.getParameter("name");
55final String settingName = Values.getString(request.getParameter("settingName"), "columns");
56final String stickyColumn = Values.getStringOrNull(request.getParameter("stickyColumn"));
57final ItemContext cc = sc.getCurrentContext(itemType, subContext);
58String forward = null;
59String message = null;
60
61if ("Save".equals(cmd))
62{
63  String columns = request.getParameter("columns");
64  cc.setSetting(settingName, columns);
65  if (stickyColumn != null) cc.setSetting(settingName+".sticky", stickyColumn);
66  sc.saveCurrentContextAs(itemType, subContext, name, true, false);
67}
68
69if (forward != null)
70{
71  sc.setSessionSetting("alert-message", message);
72  pageContext.forward(forward);
73}
74else if (message == null)
75{
76  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&wait=0");
77}
78else
79{
80  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&message="+HTML.urlEncode(message));
81}
82%>
Note: See TracBrowser for help on using the repository browser.