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

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