Ignore:
Timestamp:
Jan 28, 2010, 6:42:30 PM (11 years ago)
Author:
keesvb
Message:

added helper functions to Subject and Template classes to easily get the template fields, and added a demonstration of use in the sandbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/sandbox/index.gsp

    r144 r146  
    99<%@ page contentType="text/html;charset=UTF-8" %>
    1010<html>
    11   <head><title>Sandbox</title></head>
    12   <body>
    13   <h1>Sandbox</h1>
    14   <h2>Template fields</h2>
    15   <g:each in="${fields}"><p>${it.name}</p></g:each></body>
     11<head><title>Sandbox</title></head>
     12<body>
     13<h1>Sandbox</h1>
     14<h2>Subject Template fields demo</h2>
     15<table>
     16        <tr>
     17                <td>Name</td>
     18        <g:each in="${fields}" var="field">
     19                <td>${field.name} (${field.type})</td>
     20        </g:each>
     21        </tr>
     22        <g:each in="${subjects}" var="subject">
     23                <tr>
     24                        <td>${subject.name}</td>
     25                <g:each in="${fields}" var="field">
     26                        <td>${subject.getFieldValue(field.name)}</td>
     27                </g:each>
     28                </tr>
     29        </g:each>
     30</tr>
     31</table>
     32</body>
    1633</html>
Note: See TracChangeset for help on using the changeset viewer.