When using indexed properties you must provide an indexed getter and setter, which you have not. You must also initialize the array to the number of elements you expect. If you don't know how many elements, use a java.util.List instead of an array. Also, indexed="true" works only for an array or list of JavaBeans, not for a simple array. For a simple array, you have to build the the indexed property name yourself. Example:
Thanks Merrill, It did work. But was a little curious about the usage of List. Can you give me some pointer how to use it. The number of components is dynamic and is not restricted.
Joined: Feb 15, 2005
I'm glad it worked.
Before we go any further, though, one of my duties as forum moderator is to see that the guidelines are followed, and I noticed the name you are currently displaying does not meet the guidelines of the JavaRanch Naming Policy. In particular, the name you display must be a first and last name, and must not be obviously fictitious. Please change the Publicly Displayed Name in your user profile so that it meets the guidelines.
This may seem trivial to you, but it's an important part of the culture at JavaRanch, and we do appreciate your compliance with it.
Regarding your question about using a List, you would just change the underlying representation of customDocs variable from an array to a List. You would then modify the getter and setter accordingly. You would also have to give your accessors "lazy initialization" behavior. For more information and an example of this, see question 6 of this forum's FAQ.
Joined: Nov 26, 2007
Well Merrill, Thanks.. Well Just added a caption as usual. Didn't know that it will create problems any way changed it Thanks for your help