Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like you've mixed up server-side code with client-side code.</p> <p>The Grails code will be evaluated when the page is being "built" to be sent to the client browser.</p> <p>The Javascript code will be evaluated once the page has been delivered to the browser.</p> <p>With this in mind let's take a look at your onblur assignment:</p> <pre><code>onblur=${remoteFunction( action:'dave', update:'pack'+it.id, params: [denom: document.getElementById(denomValue+${it.id}).value, amount: this.value ])} </code></pre> <p>Given the ${remoteFunction...} call is a Grails tag, it will be evaluated on the server, generate a fixed string, then be sent to the client. Everything inside the call must be valid Groovy code.</p> <p>Look at the params map, you've added some Javascript in the denom value, <em>inside</em> the Groovy code:</p> <pre><code>document.getElementById(denomValue </code></pre> <p>then you try to add a value from Groovy</p> <pre><code>+${it.id} </code></pre> <p>then some Javascript again</p> <pre><code>).value </code></pre> <p>The Groovy compiler will try to evaluate the Javascript as Groovy code and fail.</p> <p>If you need to access client-side parameters in Javascript you'll need to handle the Javascript yourself (and not use the remoteFunction tag), for example to handle the remote call:</p> <pre><code>var path=${createLink(action:'dave', params: [amount:this.value])} + "&amp;denom=" + document.getElementById(denomValue+${it.id}).value </code></pre> <p>You'll also need to handle the remote response yourself using Javascript to update the 'pack' elements. You could always look at what the remoteFunction call generates, copy it into the page and edit it to do what you want.</p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload