Paul Weber
Paul Weber

Reputation: 6688

Grails Property Expression instead of Domain Object in Web Flow?

We are currently trying to build some stuff with Grails Web Flows.

We are setting an object in the Flow (using flow.objectName = objectInstance), but when we try to access it in the next step of the Flow (using flow.objectName), the Object is not set, but instead there is a org.codehaus.groovy..... .PropertyExpression, that has none of the methods we want to use.

The Code we used to set and get works in other cases, and we cannot find any differences.

Thank you in advance for your time.

Upvotes: 0

Views: 319

Answers (1)

Ben Doerr
Ben Doerr

Reputation: 1655

Make sure your Webflow DSL syntax is correct.

For example

def someFlow = {
    eventAction {
       flow.value = someValue // This is incorrect
       action {
           flow.value = someValue // This is correct
       }
       on("success").to "eventDisplay"
    }

    eventDisplay {
       on("finish").to "end"
       flow.anotherValue = somethingElse // This usually causes the behavior you are seeing.
       // Proper way of setting flow.anotherValue
       on("finish2") {
           flow.anotherValue = somethingElse
       }.to "end"

    }

    end{}
}

Upvotes: 3

Related Questions