source: trunk/grails-app/views/searchable/selectsample.gsp @ 196

Last change on this file since 196 was 196, checked in by jahn, 14 years ago

Sample selection of the query controller: added buttons for subgroup selection, controller changes for passing on subselections, and some JS for selecting the checkboxes. The actual function of the checkboxes has to be clearified. When I check only subject, should the parent subject also be ticked? Or should it be the other way round? Plenty needs to be done in this step of the query still.

File size: 3.2 KB
Line 
1<html>
2
3  <head>
4      <title>Generic Study Capture Framework - Query studies</title>
5      <meta name="layout" content="main" />
6      <g:setProvider library="jquery"/>
7      <script src = ${createLinkTo(dir: 'js/jquery_combobox', file: 'ui.core.js')}></script>
8      <script src = ${createLinkTo(dir: 'js/jquery_combobox', file: 'ui.combobox')}></script
9    </head>
10
11<body>
12
13  <h1>Advanced query - select samples</h1>
14  <br>
15
16
17  <g:form action="selectsample" url >
18
19
20   <br> <%= params %>
21   <br> <%= selectedStudyIds.each{ println it } %>
22   <br> <%= subgroups%>
23   <input type="hidden" name="selectedStudyIds" value="${selectedStudyIds}"   </div>
24
25
26  <% if (selectedStudies.size()>0) {%>
27       <table >
28         <tr>
29           <td></td>
30           <td><b> Study </b></td>
31           <td><b> Subject </b></td>
32           <td><b> Sampling Events </b></td>
33           <td><b> Sample Name </b></td>
34           <td><b> Sample Material </b></td>
35           <td><b> Duration </b></td>
36           <g:if test="${subgroups.size>0}"> <td><b> Subgroups </b></td> </g:if>
37         </tr>
38
39  <g:each in="${selectedStudies}" status="j" var="studyIns">
40  <tr>
41  <td> <input type="checkbox" name="${studyIns.title}" id="${studyIns.title}" class="checkbox1${studyIns.id}"> </td>
42          <td> ${studyIns.title} </td>
43  </tr>
44
45
46
47  <g:each in ="${studyIns.events}" var="events">
48        <tr>
49          <td></td><td></td>
50          <td> <input type="checkbox" name="${studyIns.id}.${events.subject.name}" id="${events.subject.name}" class="checkbox2${studyIns.id}" >
51               ${events.subject.name} </td>
52          <td> ${studyIns.samplingEvents} </td>
53          <td> ${studyIns.samplingEvents.samples.name}</td>
54          <td> ${studyIns.samplingEvents.samples.material}</td>
55          <td> ${events.getDurationString()}</td>
56
57          <g:if test="${subgroups.size>0}">
58          <td> <select id="demo">
59              <g:each in ="${subgroups}" var="p">
60                  <option value = "${p}"> "${p}" </option>
61              </g:each>
62          </select> </td>
63          </g:if>
64        </tr>
65     </g:each>
66
67
68    </g:each>
69       
70     </table>
71
72
73
74    <g:each in="${selectedStudies}" status="j" var="studyIns">
75        <% def cb1 = '\'.checkbox1' + studyIns.id + '\''  %>
76        <% def cb2 = '\'.checkbox2' + studyIns.id + '\''  %>
77        <script>
78              $(${cb1}).click(function () {
79                  if($(this).attr("checked")==true)
80                     $(${cb2}).attr("checked", "checked");
81                  });
82              $(${cb2}).click(function () {
83                  if($(this).attr("checked")==false)
84                         $(${cb1}).attr("checked", false);
85                  });
86        </script>
87    </g:each>
88
89
90
91  <%}%>
92
93
94     Infer subgroups:
95    <INPUT TYPE=submit name=submit Value="Subject Groups">
96    <INPUT TYPE=submit name=submit Value="Event Groups">
97    <INPUT TYPE=submit name=submit Value="Starting Time Groups">
98
99    <% if (selectedStudies.size()==0) { %>
100    <br> Please select studies to query samples.
101    <% } %>
102
103    <br>
104    <INPUT TYPE=submit name=submit Value="<< Back to study selection">
105    <INPUT TYPE=submit name=submit Value=">> Execute and continue with biomarker selection">
106
107    </g:form>
108
109
110
111  </body>
112</html>
Note: See TracBrowser for help on using the repository browser.