Passing a selected row from a GSP's table to a Controller in Grails 3.0 -


i have 1 controller sends list of users data (userid, firstname, lastname, email) gsp. gsp displays data table of 5 columns 5th column submit button 1 particular row in table can selected. selected row of data passed same controller further processing. new grails 3 , have not found similar use case. seems me grails not have equivalent of jsf datatable. need pointers on how without using javascript or jquery.

thanks in advance.

you can use grails http://grails.github.io/grails-doc/2.2.1/ref/tags/remotefunction.html can assigned dom event call remote method. example if have regular button can add following code:

onclick="<g:remotefunction action='modify' id='${user.id}'/>" 

another option use http://grails.github.io/grails-doc/2.3.7/ref/tags/submittoremote.html creates button submits containing form remote ajax call. here url parameter can used per documentation:

url - url submit to, either map contraining keys action, controller , id or string value 

hope helps.


Comments