SHARE
TWEET

Untitled

a guest Jan 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CONTROLLER ACTION:
  2. ------------------
  3.     def listDetected = {
  4.         println "executing listDetected closure"
  5.         def detectedDevices = []
  6.         render template:'device_detection', model:[detectedDevices:detectedDevices]
  7.     }
  8.  
  9. TEMPLATE:
  10. ---------
  11. <div id="device-detection">
  12.     <h2>Detected devices</h2>
  13.     <g:link class="button" action="detectDevices">Detect Modems</g:link>
  14.     <g:if test="${detectedDevices.size() == 0}">
  15.         <p>No devices have been detected yet.</p>
  16.     </g:if>
  17.     <g:else>
  18.         <table id="detected-devices">
  19.             <thead>
  20.                 <tr>
  21.                     <td>Port</td>
  22.                     <td>Description</td>
  23.                 </tr>
  24.             </thead>
  25.             <tbody>
  26.                 <g:each in="${detectedDevices}" var="d">
  27.                     <tr>
  28.                         <td>${d.port}</td>
  29.                         <td>${d.description}</td>
  30.                     </tr>
  31.                 </g:each>
  32.             </tbody>
  33.         </table>
  34.     </g:else>
  35. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top