ConvertUtils and Indexed Properties
Now I have a new issue with ConvertUtils. I've resorted to creating a Form, rather than generating one from a POJO using XDoclet. In this form, I've added indexed properties, so that properties can be accessed and retrieved with an index.
So now I have getPropertyList() and setPropertyList(ArrayList) on my form. I also have getPropertyList(int index) and setPropertyList(int index, Property prop). However, when I add these methods, my ListConverter.convert method quits working! So now when I call:
BeanUtils.copyProperties(cmcfForm, c);
it returns null for the ArrayLists on my form? I don't get why, esp. since the methods have different signatures. It works fine if I remove the indexed methods.
Update: I solved my problem by removing the getPropertyList(int index) method. I had to add some funky stuff in the reset method of my Form to ready it for Struts auto-population, but it works. Specifically, I had to create an ArrayList for my child, and then populate it with empty child forms. This allowed setPropertyList(int index, Property prop) to work as expected. FYI - I don't think this is a Struts thing, but how webapps work. Anyway, I'm happy with how this works - as I know have indexed properties working for display and saving. Now I have to figure out saving parents/child in Hibernate (I've done it with struts-resume and MySQL, just not with Oracle). I've posted my problem to the Hibernate mailing list if you're really interested in my problem.
Next up, indexed property validation using the Validator. Should be oh so fun...