Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CONTROLLER ACTION:
- ------------------
- def listDetected = {
- println "executing listDetected closure"
- def detectedDevices = []
- render template:'device_detection', model:[detectedDevices:detectedDevices]
- }
- TEMPLATE:
- ---------
- <div id="device-detection">
- <h2>Detected devices</h2>
- <g:link class="button" action="detectDevices">Detect Modems</g:link>
- <g:if test="${detectedDevices.size() == 0}">
- <p>No devices have been detected yet.</p>
- </g:if>
- <g:else>
- <table id="detected-devices">
- <thead>
- <tr>
- <td>Port</td>
- <td>Description</td>
- </tr>
- </thead>
- <tbody>
- <g:each in="${detectedDevices}" var="d">
- <tr>
- <td>${d.port}</td>
- <td>${d.description}</td>
- </tr>
- </g:each>
- </tbody>
- </table>
- </g:else>
- </div>
Add Comment
Please, Sign In to add comment