Git Product home page Git Product logo

grails-webflow-plugin's Introduction

Build Status

Grails Web Flow Plugin

The Web Flow plugin integrates Spring Web Flow with Grails.

grails-webflow-plugin's People

Contributors

burtbeckwith avatar candrews avatar gpsantos avatar graemerocher avatar patrickhuetter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grails-webflow-plugin's Issues

Problem mapping to nested command objects

Hi,

I'm migrating a shopping cart checkout to use the webflow plugin. The former implementation used to perform validation of the order's delivery address using a custom UserDetailsCommand object which included a AddressCommand address property, as shown below:

@Validateable
class UserDetailsCommand implements Serializable {

    String firstName
    String lastName
    AddressCommand deliveryAddress
    ...

    static constraints = {
        firstName nullable: false, blank: false, size: 1..50
        lastName nullable: false, blank: false, size: 1..50
        deliveryAddress cascade:true
        ...
    }
    ...
}

@Validateable
class AddressCommand implements Serializable {
    String address1
    String address2
    String city
    String county
    String postcode

    static constraints = {
        address1 blank:false, size: 1..50
        address2 blank:false, size: 1..50
        city blank:false, size: 1..50
        county  blank:false, size: 1..50
        postcode blank:false, matches: /[A-Za-z]{1,2}[0-9Rr][0-9A-Za-z]?\s?[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2}/
    }
}

After migrating to use the webflow plugin I realised that the address field on the UserDetailsCommand was always coming as null on my transitions and actions, failing therefore validation (in an incorrect way) even though the parameters names seemed to be correct (eg. ["firstName:"David", "deliveryAddress.address1": "10 Downing Street"]).

My webflow now looks something like:

class CartController { 
    def checkoutFlow = {
        startCheckout {
            action {
                ...
            }
            on("success").to "deliveryDetails"
        }
        deliveryDetails {
            on("proceed") { UserDetailsCommand userDetailsCommand ->
                ...
            }
        }
        ...
    }
    ...
}

I believe this set up is correct and there's an issue on the plugin's data binding. If not, could you please provide indications on what I'm doing wrong?

Cheers!

Grails 3 compatibility

Is there any timeline to upgrade it to grails 3 ?
IS there already some beta release for grails 3 ?

Incompatible with Java 8

We are facing an issue with WebFlow when working under Java 8. It works fine with Java 7. We get the stacktrace as given below (given that all the inputs are the same from the screen):

org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.codehaus.groovy.grails.webflow.engine.builder.ClosureInvokingAction@1f11a4e5 in state 'EDITED' of flow 'EDITED' -- action execution attributes were 'map[[empty]]'
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)

We tried this with JDK 1.8.0_60 and Grails 2.5.1

webflows not detected from controllers

we are facing one issue where all the flows are not registered in flowRegistry many times during server startup and it causes NoSuchFlowDefinitionException.
Upon debugging in detail, found that webflow plugin relies on the population of 'flows' property in controllerClasses to populate the flowRegistry:
https://github.com/grails-plugins/grails-webflow-plugin/blob/master/src/groovy/org/codehaus/groovy/grails/webflow/WebFlowPluginSupport.groovy#L116

Based on the debugging done, 'flows' is populated by 'controllers' grails plugin. Here:
https://github.com/jeffbrown/grails-core/blob/master/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy#L199

if webflow plugin loads before controllers plugin then all the flows are not detected.

So if controllers is the only plugin which can populate the required data for webflow plugin, then webflow plugin should 'loadAfter' entry for 'controllers' plugin.

We are using grails version 2.4.3 and webflow version 2.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.