Changeset 338


Ignore:
Timestamp:
Apr 12, 2010, 3:11:34 PM (9 years ago)
Author:
keesvb
Message:

changed TemplateEntity?.giveFields to reflect ordering as well, also applied ordering to TemplateFieldListItems?, updated Sandbox to display mouse template fields

Location:
trunk/grails-app
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/SandboxController.groovy

    r253 r338  
    4747
    4848                // Specify which variables we want to be available in the controller (implicit return statement)
    49                 [fields: f, subjects: st.subjects, studyInstance: st]
     49                [fields: f, subjects: st.subjects, studyInstance: st, subject: Subject.findByName('A1')]
    5050        }
     51
     52
    5153}
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r336 r338  
    332332        * Return all templated fields defined in the underlying template of this entity
    333333        */
    334         def Set<TemplateField> giveFields() {
     334        def List<TemplateField> giveFields() {
    335335                return this.template.fields;
    336336        }
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy

    r300 r338  
    1515        String comment // help string for the user interface
    1616
    17     static hasMany = [listEntries : TemplateFieldListItem] // to store the entries to choose from when the type is 'item from predefined list'
     17        List listEntries
     18        static hasMany = [listEntries : TemplateFieldListItem] // to store the entries to choose from when the type is 'item from predefined list'
    1819
    1920        static constraints = {
  • trunk/grails-app/views/sandbox/index.gsp

    r299 r338  
    3232<h2>Events</h2>
    3333<% println studyInstance.events.eventDescription.protocol.name %>
     34<h2>Subject Fields</h2>
     35<table>
     36        <tr>
     37                <td>Source</td>
     38                <td>Name</td>
     39                <td>Type</td>
     40        </tr>
     41        <g:each in="${subject.giveDomainFields()}" var="field">
     42            <tr>
     43                    <td>Domain field</td>
     44                        <td>${field.key}</td>
     45                         <td>${field.value}</td>
     46                </tr>
     47        </g:each>
     48        <g:each in="${subject.giveFields()}" var="field">
     49            <tr>
     50                        <td>Template field</td>
     51                    <td>${field.name}</td>
     52                         <td>${field.type}</td>
     53                </tr>
     54        </g:each>
     55
     56</table>
    3457</body>
    3558</html>
Note: See TracChangeset for help on using the changeset viewer.