Hello. I am using Web Flow 2.0.7 with Spring MVC and Hibernate.
My problem is about custom converters for my custom types and database connection from within my converter.
Let's say I have a type Person and the Person has a field of my custom type Title, and all Titles are already in my database. Now I have an html form, in which a user can populate a Person instance, including selecting the Title in a select drop-down box.
In the flow definition I get all Titles from the database and they are shown in the dropdown box using a custom converter, converting Title to String and later back to Title.
My question is about the process of converting back from String (which is the database ID, which I set as value on the element) to the correct Title object from my database. Basically: How to do it?
So far, I was unable to get a titleManager injected into my converter to get access to the database. This scenario was commented on in the Spring Web Flow Forum. Another solution might be to cache the Titles before rendering the view and somehow get the in-memory Title after the form was POSTed.
I would really appreciate it, if someone could enlighten me, how to handle this kind of data binding. I was unable to get it working so far and thus, I get minimal use out of the otherwise awesome webflows.
I already posted a thread on the Web Flow Board, but still missing a best-pratice, which I am unable to find by myself.
Thank you so much!
Wolfram