Paulo, The problem is that Vectors or Arrays are not created and sized for you automatically. When your form is submitted, the populate() method attempts to set the Vector element of new element which is beyond the size of your vector. To fix this problem, you can either size the Vector with empty slots in your action before you display the form or use a LazyList (search the archives for LazyList)
Regards, Richard -----Original Message----- From: Paulo Rezende [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 10:03 AM To: Struts Users Mailing List Subject: Adding items to a vector of formbean in the jsp Struters, I need help from somebody. I have a formbean that has a vector property, and my jsp has a iterator that renderizes this: <input type="hidden" name="userList[0].id" value="1" id="id0"> <input type="hidden" name="userList[0].name" value="paul" id="name0"> <input type="hidden" name="userList[1].id" value="2" id="id1"> <input type="hidden" name="userList[1].name" value="john" id="name1"> If i change the value of any of these inputs and submit the page, the requestprocessor parse and update the values of the vector in the formbean correctly. But if i, dinamicly with dom, create new inputs increasing the index (like in the example below) and submit the page, i get a exception of Beans.populate(), a out of ranger error. newInput = document.createElement("input"); newInput.type = "hidden"; newInput.name = "userList[2].id"; newInput.id = "id2"; myHmtlBody.appendChild(inp); document.getElementById("id2").value = 3; newInput = document.createElement("input"); newInput.type = "hidden"; newInput.name = "userList[2].name"; newInput.id = "name2"; myHmtlBody.appendChild(inp); document.getElementById("name2").value = "peter"; What i really want is that, when i submit the page, the requestprocessor add a new item in the vector and set the values of the new item with the values of the new inputs. Anybody have any thing to say or suggest, any idea? thanks, Paulo --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]