Grails launch controller's remote functions from within javascript -
i have button on gsp
<button id = "select" onclick = "${remotefunction(controller: 'customer', action: 'selectbatch', params: '\'batchid=\' + selectedbatchid')}">select</button>
i have javascript function on same button:
$('#select').click(function () { if (selectedbatchid == undefined) { $("#errormessages p").text("click row choose batch first."); $("#errormessages p").show(); $("#errormessages p").fadeout(3000); } else { $("#choosebatch h2").text("batch id " + selectedbatchid + ": " + selectedbatchdesc); }
what move button's onclick function declared in gsp code else clause of javascript function controller function doesn't launch time, when javascript else clause executed. can't seem figure out right syntax. help/tips appreciated.
something similar previous answer can try this:
$.ajax({ type: 'post', url: "${createlink(action:'customer', controller:'selectbatch')}/batchid=" + selectedbatchid });
Comments
Post a Comment