PDA

View Full Version : Losing reference data


oh
Oct 3rd, 2004, 01:23 PM
I have a JSP + SimpleFormController to find products from my database. In the form, I can chose a category of products in a dropdown list, that has been populated with items registered in the referenceData method. The results are displayed in the same JSP (containing the form), so as to be able to launch a new search. The first time the JSP is displayed, the dropdown list is well populated. When I submit a second time, I loose the reference data (categories). any idea about this ?

Olivier.

ojolly
Oct 4th, 2004, 03:09 AM
The reference data is only added to the model in the form view part. When you submit it isn't added to the model. You can manually add the result of referenceData() to the model in the onSubmit method to have the wanted effect.
Still, I faced the same issue and wouldn't mind a globalReferenceData() which would complete all the model returned by the controller.

Olivier

oh
Oct 4th, 2004, 01:27 PM
OK, it's just works fine ! :wink:
Thanks !