I’m using grail’s webflow to manage a multi-stage registration process on my site. A link triggers an event for the start state, and the intention is to load the corresponding view in a fancybox iframe. I used grail’s link tag to resolve the URL for the view, but the iframe just displays a ‘404’.
trigger:
<g:link controller="registration" action="register"
event="enterStandardDetails" class="register" />
The URL resolves to /mysite/registration/register?_eventId=enterStandardDetails.
webflow:
def registerFlow = {
enterStandardDetails = {
on("next") {
// capture mandatory user details
}.to("enterOtherDetails")
}
enterOtherDetails = {
on("next") {
// capture optional user details
}.to("categories")
on("previous").to("enterStandardDetails")
}
registrationComplete = {
// display finished state
}
}
javascript:
$("a.register").fancybox({
'width' : '65%',
'height' : '90%',
'type' : 'iframe'
});
Is it possible to intercept the URL corresponding to the view state before grails renders it? Or, am I over engineering this? Can I just simply pass in the URL of the view corresponding to the start state, whereby the flow is started when the user clicks “next”?
Any ideas, or thoughts would be much appreciated.
Thanks, -Tom
The problem was that I forgot to import fancybox script.