I have a pretty standard struts application, but am having an unusual problem, at least one that I've never seen. There is a MedicalForm bean, which has an ArrayList of RateForms. Each RateForm has an arrayList of detailed InfoForms. I am displaying and allowing the user to update the order of the InfoForms on the screen.
My Jsp looks somewhat like this:
<nested:form action="/proposalMedical" >
...
<nested:iterate name="ProposalMedicalForm" property="proposalMedicalRateForm" id="proposalMedicalRateForm" indexId="rateIndexId" >
...
<nested:iterate name="proposalMedicalRateForm" id="proposalMedicalInfoForm" property="proposalMedicalInfoForm" indexId="infoIndexId" >
...
Everything displays correctly - if I have one RateForm with 3 InfoForms, that's what shows up on the screen.
RateForm1
>Info1
>Info2
>Info3
When I submit the screen, the information is mapped back to the form incorrectly. Instead of one RateForm, I now have 3 RateForms, and each RateForm has one InfoForm. In addition, each InfoForm shows up in it's original position in the arraylist. On the first RateForm, Info1 shows up in the first position in the arrayList. On the second RateForm, Info2 shows up in the position of the arrayList, with the first position being null. On the third RateForm, Info3 shows up in the third position of the arraylist.
RateForm1
>Info1
RateForm2
>null
>Info2
RateForm3
>null
>null
>Info3.
Has anyone ever encountered a problem like this before or have any ideas? I'm guessing the indexes for the RateForms are getting updated incorrectly, but I'm not sure why.
Thanks!