Hi,
Has enyone got answer for this?
thanks,
Zayed
[EMAIL PROTECTED] wrote:
> Hi Keith,
> Thanks for your reply.
>
> The Problem I am facing is regarding the use of <logic:iterate> and
> <bean:write> tags
>
> Let me restate my problem
>
> I am developing a WEB-UI for a third party Java Application Therefore
> I don't have control over the object/s returned.
> I get two String arrays of the same length which I should be showing
> in a table. The first String[] contains productName and the second
> String[] contains the corresponding product description. how do I
> construct the table rows using <logic:iterate> and <bean:write> tags.
>
> The corresponding JSP code looks is below
>
> <%
> String[] productNamesArray = //Get the product names array
> String[] productDesctriptionArray = //Get the product description
> array
> //FYI : productNamesArray.length = productDesctriptionArray.length
>
> for(int i=0; i<productNamesArray.length; i++ ){
>
> %>
>
> <tr>
> <td>
> <%= productNamesArray[i] %> </td>
> <td>
> <%= productDesctriptionArray[i] %> </td>
> </tr>
>
> <%
> }//end of for loop
> %>
>
> could somebody help me with corresponding snippet using
> <logic:iterate> and <bean:write> tags
>
> Thanks in advance
>
> Cheers!!
> Zayed
>
>
> [EMAIL PROTECTED] wrote:
>
>> I'm not sure if I'm understanding what you're trying to do, but I'm
>> doing
>> something similar. I decided not to use an array for each property.
>> I have
>> a bean that holds the info for an entry, and then in the action I add
>> that
>> bean to an EntryHolder object that stores lists of entries. Then I
>> simply
>> iterate through my EntryHolder lists and get the info for each
>> entry. This
>> is also a more understandable design, because it's perfectly clear which
>> entry properties go together. With arrays of properties, it is less
>> clear
>> which individual properties correspond to each other. However, I am
>> kinda
>> new to all this, so if I'm wrong about anything, someone please
>> correct me.
>> I hope this helps.
>>
>> ~ Keith
>> http://www.buffalo.edu/~kkamholz
>>
>>
>>
>> -----Original Message-----
>> From: Zayed [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, July 05, 2002 9:39 AM
>> To: Struts Users Mailing List
>> Subject: logic:iterate populating with multiple String[]
>>
>>
>> Hi,
>>
>> I am struck up with this problem. please help
>>
>> I am iterating rows. In the first column I populate Product Name, In
>> the second coulmn I populate Product Description. Both are contained
>> in String Arrays. The productListForm is of type DynaActionForm whose
>> form-properties are productName and productDesciption Arrays.
>>
>> How do I construct <logic:iterate> and <bean:write> tags. Please help
>>
>>
>> This is what I have as of now ( it dosent work though)
>>
>> <logic:iterate id="productName" name="productListForm"
>> property="name" indexId="index">
>> <tr>
>> <td>
>> <bean:write name="productName"/>
>> </td>
>> <td>
>> <bean:write name="what should go here ?? "/>
>> </td>
>> </tr>
>> <logic:iterate>
>>
>> Thanks in advance
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>