source: trunk/grails-app/views/common/_eventDescriptionTableRows.gsp @ 299

Last change on this file since 299 was 299, checked in by duh, 14 years ago
  • set keyword expansion
  • Property svn:keywords set to Date Rev Author
File size: 2.3 KB
Line 
1<!-- Rows for a two column table -->
2
3        <tr class="prop">
4            <td valign="top" class="name">
5              <label for="name"><g:message code="eventDescription.name.label" default="Name" /></label>
6            </td>
7            <td valign="top" class="value ${hasErrors(bean: description, field: 'name', 'errors')}">
8                <g:textField name="name" value="${description?.name}" />
9            </td>
10        </tr>
11
12
13        <tr class="prop">
14            <td valign="top" class="name">
15              <label for="description"><g:message code="eventDescription.description.label" default="Description" /></label>
16            </td>
17            <td valign="top" class="value ${hasErrors(bean: description, field: 'description', 'errors')}">
18                <g:textArea name="description" value="${description?.description}" cols="40" rows="6" />
19            </td>
20        </tr>
21
22
23        <!-- select -->
24
25        <tr class="prop">
26
27            <td valign="top" class="name" width=200 >
28              <label for="protocol"><g:message code="eventDescription.protocol.label" default="Protocol" /></label>
29            </td>
30            <td valign="top" class="value ${hasErrors(bean: description, field: 'protocol', 'errors')}">
31                <g:select name="protocol.id" id="protocol" from="${dbnp.studycapturing.Protocol.list()}" optionKey="id" optionValue="${{it.name}}" value="${{it?.id}}" onchange="${remoteFunction(action:'showMyProtocol', controller:'eventDescription', update:'preview', onComplete:'Effect.Appear(preview)', params:'\'protocolid=\' + this.value', id:params['id'])}" />
32            </td>
33        </tr>
34
35
36        <!-- this part changes dynamiccally on select -->
37
38        <tbody id="preview">
39            <% def list = [] %>
40            <g:each in="${description.protocol.parameters}" > <% list.add( it )%> </g:each>
41            <% list.sort{ a,b -> a.name <=> b.name }%>
42
43            <g:each in="${list}">
44
45                 <tr class="prop">
46                 <td valign="top" class="name" width=200>
47                 <label for="parameter"><g:message code="${it.name}" /></label>
48                 </td>
49
50                 <td valign="top" class="name">
51                 <g:textField name="protocolParameter.${it.id}" value="${eventInstance.parameterStringValues[it.name]}" />
52                 </td>
53                 </tr>
54
55            </g:each>
56        </tbody>
Note: See TracBrowser for help on using the repository browser.