Frage

I'm new to Spring Webflow, and I'm trying to create a flow where it either saves the model and then moves to the next page, or saves the model and stays on the same page. Moving onto the next page is no problem and validation works, model updates and onto next page, press back and the state is preserved.

However, on my 'save' transition I have not specified a view so it stays on the same page, hoping it updates the model. But all values are cleared and I am presented with an empty form. This will eventually show a popup that I will worry about later. I have made the model flowscope.

<on-start>
    <evaluate expression="controller.createApplicationModel()" result="flowScope.applicationModel" />
</on-start>

<view-state id="contactInformation" view="contactInformation-tiles" model="applicationModel">       
    <transition on="next" to="aboutYou" >
        <evaluate expression="controller.save(applicationModel)" />
    </transition>
    <transition on="save" >
        <evaluate expression="controller.save(applicationModel)" />
    </transition>
</view-state>

Is my configuration wrong?

War es hilfreich?

Lösung

The problem lies not in the webflow configuration, but the method you are using to call the event. Make sure the transition is triggered by a form submit, rather than a link.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top