|
This post was updated on .
I created a new controller named ShopController, to use in Webflows. This is the code :
class ShopController { def index() { redirect(action:"order") } def orderFlow = { display { on("next") { }.to("finsh") } finish { redirect(controller:"user", action:"index") } } } And in views/shop/order/display I created a file like this : <html> <head> <title>Testing</title> </head> <body> Testing Webflows! <g:form action="order"> </g:form> </body> </html> However upto this it looks simple, when I run my grails app and pointing the browser to http://localhost:8080/testing/shop/order/display I'm getting nothing. Nothing in sense, there is no error message from Apache, no text, I'm seeing only a blank screen. Where I went wrong? Thanks in adavnce.
Ant's
|
|
On 30/12/2011 10:39, antoaravinth wrote:
> However upto this it looks simple, when I run my grails app and pointing the > browser to http://localhost:8080/testing/shop/order/display I'm getting > nothing. Nothing in sense, there is no error message from Apache, no text, > I'm seeing only a blank screen. > > Where I went wrong? I can't help with the blank screen but it seems you've misunderstood the way webflow URL mappings work. The URL of the flow is http://localhost:8080/testing/shop/order, you don't need the state name on the end (and in fact the "display" in your URL above would be treated as the value of params.id given the default URL mappings). When you go to the flow URL Grails will start a new flow execution in the "display" state, and by convention will render grails-app/views/shop/order/display.gsp. The form in display.gsp needs to provide the events that the display state expects, which you typically do using submitButton <g:form> <p>Name <g:textField name="name" /></p> <p><g:submitButton event="next" value="Next" /></p> </g:form> Does that make any more sense? Ian -- Ian Roberts | Department of Computer Science [hidden email] | University of Sheffield, UK --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
This post was updated on .
Oh thanks for the explanation. But still I'm seeing only the blank screen as my answer. I even tried to run Grails in action code. From here, https://github.com/pledbrook/graina/tree/master/source-code/ch09/hubbub.
It has the same ShopController.groovy with order as its index. Now if I point my browser to http://localhost:8080/hubbub/shop/order. Still I'm getting only the blank screen. :(
Ant's
|
|
Hi, I'm facing the same problem with my project. Normal actions work perfectly, but setting up a flow gives me a blank page. My code is practically a copy of the example from Grails documentation so I'm sure I'm not missing anything.
Did you manage to find a solution ? |
|
Nope I haven't got a solution for that. I even tried Grails in action source code, but it gives same result. I hope someone would see this thread and give a proper response. You have been using Grails 2.0?
Ant's
|
|
I've just tested your webflow using grails 1.3.7 and it works fine.
Since I'm using 1.3.7 I had to change index(){ ..} to index = {..} and then I changed fixed the type of finsh to finish in the "to" statement. Code I used; Controller: class ShopController { def index = { redirect(action:"order") } def orderFlow = { display { on("next") { }.to("finish") } finish { redirect(controller:"grid", action:"index") } } } views/shop/order/display.gsp <html> <head> <title>Testing</title> </head> <body> Testing <g:form action="order"> <g:submitButton name="next" event="next" value="Finish"/> </g:form> </body> </html On 2 January 2012 13:08, antoaravinth <[hidden email]> wrote: Nope I haven't got a solution for that. I even tried Grails in action source |
|
Thanks micke_ for trying out and answering. The same code results the same(blank screen) but at last I found where I was making a mistake.
The documentation has this text : From Grails 1.2 onwards Webflow is no longer in Grails core, so you must install the Webflow plugin to use this feature: grails install-plugin webflow (see here) Just install the plugin and everything is working fine. The example from micke_ is working as expected.
Ant's
|
|
I am still having problem in installing the webflow plugin.I am using groovy 2.0.0 and when i issue the command grails install plugin webflow,it is giving me error instead of installing.Can you please direct me step by step how you have installed the plugin?
Thanks in advance |
|
On 06/07/2012 07:56, deepsgnair wrote:
> I am still having problem in installing the webflow plugin.I am using groovy > 2.0.0 and when i issue the command grails install plugin webflow,it is > giving me error instead of installing.Can you please direct me step by step > how you have installed the plugin? Don't use install-plugin, just add compile(':webflow:2.0.0') to the plugins section of your BuildConfig.groovy. Ian -- Ian Roberts | Department of Computer Science [hidden email] | University of Sheffield, UK --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
I am using Grails 2.0.0 and I tried to download webflow 2.0.0 but I am getting only webflow 2.0.0-RELEASE as a zip folder or as a jar file.
I even got grails-webflow-2.0.3 jar file also. I also tried with webflow 1.3.8 which I got from grails official website. I tried changing the name of the plugin in the compile statement each time and ran and am ending up with this kind error each time : Error WARNING: Specified dependency definition compile(:org.springframework.webflow-2.0.0.RELEASE) is invalid! Skipping.. |
| Powered by Nabble | Edit this page |
