Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting values into grails createlink params on page creation

Tags:

grails

params

I've got a list view and for each line I want a link to another list view showing the related results. The createlink line I've finally managed to construct looks like this

<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params:'[id:testExecQueueInstance.id]')}">my link</a>

This generates the link

http://localhost:3278/FARTFramework/runResults/listSpecific/testExecQueueInstance.id

I know that testExecQueueInstance.id is 22 and I want the link to actually look like this

http://localhost:3278/FARTFramework/runResults/listSpecific/22

What am I missing?

The idea is that I then have a controller like so which should then list those items matching that id...

def ListSpecific(int id){

    render(view: "list", model: [runResultsInstanceList: RunResults.findAllByTestExeQueueID(id, [sort:"testExecTime", order: "desc"]), runResultsInstanceTotal: RunResults.count()])
}
like image 897
MorkPork Avatar asked Sep 13 '13 11:09

MorkPork


1 Answers

You are using an apostrophe on map of params. You should try this.

<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params: [id:testExecQueueInstance.id])}">my link</a>

enjoy.

like image 80
user1791574 Avatar answered Sep 23 '22 19:09

user1791574