Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Jeka, you can't render two thinks like this</p> <pre><code>render(members) render(view:'create') </code></pre> <p>the better way i see you can do this is something like this:</p> <p>In your controller you can render your data as JSON:</p> <pre><code>def addEG_Create () { ... ... render([members:members, openWin:'create'] as JSON) } </code></pre> <p>And in your .gsp you should do shomething like this:</p> <pre><code>function callEgCreate(){ $.ajax({ type: "GET", url: "${createLink(controller: 'MGExecutingGroup', action: 'addEG_Create')}", data: { "inputField="+$("[name='inputField']").val() "listField="+$("[name='listField']").val() }, dataType: 'json', success(function(data) { window.open(data['openWin']); $('.modal-body').html(data['members']); $('#myModal').modal('show'); }); } </code></pre> <p>I don't have tested this code, maybe it can have some errors, but the logic is this.</p> <p><strong>Updated</strong></p> <pre><code>function callEgCreate() { $.ajax({ type: "GET", url: "testeChamada", data: {"inputField": $("[name='inputField']").val(), "listField" : $("[name='listField']").val()}, dataType: 'json', success: function (data) { window.open(data['openWin']); $('.modal-body').html(data['members']); console.log(data['members']); } }); } </code></pre> <p>Ps1: In your controller when you say render <code>render([members:members, openWin:'create'] as JSON)</code> you have to receive the data in your page with the key of map <code>[key:value]</code></p> <p>Ps2: In your <code>data:</code> you have made a mistake. It should be a map with Key:Value</p>
 

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