dcsimg
ArrayList of ArrayLists... crack this one?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Whoozy_Allen
Posted On:   Wednesday, July 9, 2003 03:20 PM

Hello Everyone, Can any one crack this one? I have an ArrayList of values which I get from Database and want to display in text boxes on JSP. I do that with the following code: <% String strValues = "ArrayListName["+i.toString()+"]";%> <%=strValues%>"> This will dispay all values of ArrayListName in as many text boxes. I now want to go a level deeper. I have an ActionForm bean "ActionFormName" which has an ArrayList called MasterArrayList with getter and setter methods for this field. This MasterArrayList may contain 24 SubArrayLists each of which can contain upto 35 Strings. I   More>>

Hello Everyone,



Can any one crack this one?



I have an ArrayList of values which I get from Database and want to display in text boxes on JSP. I do that with the
following code:



<% String strValues = "ArrayListName["+i.toString()+"]";%>

<%=strValues%>">




This will dispay all values of ArrayListName in as many text boxes.



I now want to go a level deeper. I have an ActionForm bean "ActionFormName" which has an ArrayList called MasterArrayList with getter and setter methods for this field. This MasterArrayList may contain 24 SubArrayLists each of which can contain upto 35 Strings. I am able to iterated through the 35 items of each of the SubArrayLists but not able to associate them to 24 x 35 text boxes.







<% String subValues = "SubArrayList["+j.toString()+"]";%>

/*This Bombs -->*/ <%=subValues%>">








It correctly iterates through 24 SubArrayLists and further through 35 items within each of the 24 SubArrayLists. However, it does not allow me to associate 24 x 35 items with text boxes.

I tried with following formats:

<%=MasterArrayList[1][3]%>">
(shows ALL THE 35 values of SubArrayList[0] in each of the 35 text boxes. I am not able to split that into 35 INDIVIDUAL values)


<%=MasterArrayList[1,3]%>">
(JSP compilation error. No getter method for object MasterArrayList[1,3] in ActionFormName.)


<%=MasterArrayList[1].[3]%>">
(JSP compilation error. No getter method for object MasterArrayList[1].[3] in ActionFormName.)


<%=SubArrayList[1]%>">

(JSP compilation error. No getter method for object SubArrayList[1] in MasterArrayList.)



Can I any one help me on this? Is it a limitation of STRUTS that one cannot have an ArrayList of ArraLists which in turn contains values?




Regards,

Whoozy

   <<Less
About | Sitemap | Contact