I'm trying to figure out how to prepopulate a SELECT field for the first page of a flow. In the api for FormAction the last thing it says is
Note that this action does not provide a referenceData() hook method similar to that of the SimpleFormController. If you need to setup reference data you should create a seperate state in your flow to do just that and make sure you pass through that state before showing the form view. Note that you can add the method that handles this reference data setup logic to a subclass of this class since this is a multi-action! Typically you would define an action execute method like
public Event setupReferenceData(RequestContext context) throws Exception
in that case.
I don't understand how this setupReferenceData method will get called. I currently have
Code:
<webflow id="adminSignInFlow" start-state="adminSignInViewSetup">
<action-state id="adminSignInViewSetup">
<action bean="adminSignInViewSetup" method="setupForm" />
<transition on="success" to="adminSignInView" />
</action-state>
Code:
public class
AdminSignInViewSetup extends FormAction {
public
AdminSignInViewSetup() {
setFormObjectClass(AdminSignIn.class);
setFormObjectName("adminSignIn");
setValidator(new AdminSignInValidator());
setFormObjectScope(ScopeType.FLOW);
}
}
(The ScopeType is there because I saw it somewhere and it looks cool. I'm not sure what it's doing.
)
(Finally let me don my hat of English grammar nanny nitpicker and point out some grammar and spelling errors. 1) It's sepArate, not sepErate. 2) Where you say "you need to setup" you're using the verb of SET UP, which is two words. You use SETUP when it's a noun, as in "you have a nice setup here".)
Thanks again for all your help. I apologize for being such a dimbulb and needing to ask so many questions.