Links in Web Flow with Grails

View: New views
3 Messages — Rating Filter:   Alert me  

Links in Web Flow with Grails

by bgoetzmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

In a web flow view, I can use the tag g:link:
<g:link action="nombreMysterieux" event="commencer">Commencer</g:link>

that generates an HTML tag, for example:

Commencer

How can I just generates the URL part? When I use:

<goto next="${createLink(action: 'nombreMysterieux', event: 'commencer')}" />

This generates something that seems incorrect (for the URL):

<goto next="/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" />

How can I do that?


Thank you!

Bertrand.

Re: Links in Web Flow with Grails

by Konstantyn Smirnov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


bgoetzmann wrote:
This generates something that seems incorrect (for the URL):

<goto next="/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" />
Why do you think "/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" is incorrect?
It's a perfectly valid URL.

if you want it to be "/grailsbox/voiceXML/nombreMysterieux?event=commencer", try using smth like:

createLink(action: 'nombreMysterieux', params:[ event:'commencer' ] )

'cos 'event' is handled by webflow specifically.

Re: Links in Web Flow with Grails

by bgoetzmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well,

Yes "/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" is a valid URL, but without the _flowExecutionKey parameter as for the URL generated with the g:link tag.

Using this tag you get something like this for the href attribute of the "a" HTML tag:
http://www.nabble.com/grailsbox/voiceXML/nombreMysterieux?_flowExecutionKey=_c1AE81506-7AFD-70CE-30FB-EDA81197C6DF_kBB75CAD7-BBA6-2352-F0FD-F3D8BAA56D20&_eventId=commencer.

The use of g:createLink, in a web flow, doesn't generate a _flowExecutionKey parameter.

Bertrand ;-)


Konstantyn Smirnov wrote:
bgoetzmann wrote:
This generates something that seems incorrect (for the URL):

<goto next="/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" />
Why do you think "/grailsbox/voiceXML/nombreMysterieux?_eventId=commencer" is incorrect?
It's a perfectly valid URL.

if you want it to be "/grailsbox/voiceXML/nombreMysterieux?event=commencer", try using smth like:

createLink(action: 'nombreMysterieux', params:[ event:'commencer' ] )

'cos 'event' is handled by webflow specifically.