Sunday, 15 January 2012

How to get current view state name in grails webflow plugin -



How to get current view state name in grails webflow plugin -

how can current view state name in grails web flow plug-in, trying follow post can not work in app getting error message

no such property: flowexecution class: ni.org.petapp.appcontroller

thanks time

using grails 2.2.4 or 2.3.8 , grails-webflow plugin version 2.0.8.1, able access current webflow state via requestcontext:

requestcontext requestcontext = requestcontextholder.getrequestcontext(); string stateid = requestcontext.currentstate.id

when using these methods in webflow controller should this:

package webflow.requestcontext import org.springframework.webflow.execution.requestcontext import org.springframework.webflow.execution.requestcontextholder class testcontroller { def indexflow = { randomnameforstartstate { action { requestcontext requestcontext = requestcontextholder.getrequestcontext(); flow.startstatename = requestcontext.currentstate.id } on("success").to "showstartstatename" } showstartstatename() { } } }

you print start state in showstartstatename.gsp via ${startstatename}

based on requestcontext, resolve flowexecutioncontext:

flowexecutioncontext flowexecutioncontext = requestcontext?.getflowexecutioncontext();

grails

No comments:

Post a Comment