You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by shyam kishore alapati <sh...@mailnation.net> on 2006/01/10 15:58:12 UTC

Re: How to use logic iterate...

Hi try this following code 


<logic:present name="<%Constants.ATTRIBUTE_EU_DMAMARKET_LIST%>" scope="session">
<logic:iterate id="eudmamarket" indexId="rowIndex" name="<%Constants.ATTRIBUTE_EU_DMAMARKET_LIST%>" �type="com.ubs.eq.na.lynx.model.client.DmaMarket">
              <tr>
                 <td class="service_grouped_item" >
                        <b><bean:write name="eudmamarket" property="country" /></b>
                </td>
                <td class="service_grouped_item" >
                        <input onfocus="this.select()" size="10" value='<bean:write name="edumamarket" property="country" />' >
                </td>
              </tr>
</logic:iterate>
</logic:present>

Try this code i think it will work for ur logic.

Regards,
Shyam Kishore Alapati

-----Original message-----
From: Shilpa.Nalgonda@ubs.com
Date: Tue, 10 Jan 2006 08:39:34 -0800
To: user@struts.apache.org
Subject: How to use logic iterate...


> Hi All,
> I have the below logic , and I need to loop thriugh the Dmamarket Array
> using struts and 
> Set the form attribute..
> My form has dmaMarket[] as an attribute.
> DmaMarket[] dmaArray =
> (DmaMarket[])session.getAttribute(Constants.ATTRIBUTE_EU_DMAMARKET_LIST)
> ;
> if( dmaArray == null){
> out.println("ArrayIsNull");}
> else{
> for (int i=0; i {
> DmaMarket dma = dmaArray[i];
> out.println( dma.getCountry());
> }
> -->
> 
> I am using this struts code ... but it doesn't work can anyone tell me
> where I am doing wrong.
> 
> 
> > length="2"
> 
> type="com.ubs.eq.na.lynx.model.client.DmaMarket[]"
> name="> Constants.ATTRIBUTE_EU_DMAMARKET_LIST-->">
> > String name =
> "newClientForm.dmaMarket["+ rowIndex + "]";
> -->
> 
> 

> " property="country" />
> %>" />" >
> 
> 
> 
> 
> 
> 
> 
> Thanks.
> Sn
> 
> Visit our website at http://www.ubs.com
> 
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
> 
> E-mail transmission cannot be guaranteed to be secure or error-free
> as information could be intercepted, corrupted, lost, destroyed,
> arrive late or incomplete, or contain viruses. The sender therefore
> does not accept liability for any errors or omissions in the contents
> of this message which arise as a result of e-mail transmission. If
> verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities or
> related financial instruments.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

Re: How to use nested iterate...through ArrayList

Posted by Siva Sajja <sa...@gmail.com>.
It would be good to identify if you can show your bean structure too.. This
more or less seems to be a problem with the structure of bean you are trying
to access.


On 2/9/07, Shilpa.Nalgonda@ubs.com <Sh...@ubs.com> wrote:
>
>
> Hi I am trying to nested:iterate fro looping through am hashMap of
> Hashmap of ArratList<UserDefinedObject>
>
> But I get property "cnt" cannot be found error. When looping through the
> object of arrayList, I was able to loop through the forst two hashmaps &
> print out their keys, but printing out the values in ArrayList is a
> problem.
>
>
> Below Is the code.
>
> <nested:iterate id="a4idBreakMap" name="SearchResultBean"
> property="jspDisplayA4idSummaryMap" indexId="count">
>                        <!-- IF MAP IS NOT EMPTY, LOOP THROUGH IT -->
>                        <nested:notEmpty name="a4idBreakMap"
> property="value">
>                        <nested:define name="a4idBreakMap" id="mapA4id"
> property="key" />
>                        <c:if test='${pageScope.mapA4id ==
> pageScope.mainLoopA4id}'>
>                                <nested:iterate name="a4idBreakMap"
> id="tableLevelMap" property="value">
>                                <!--<nested:define name="tableLevelMap"
> property="value" id="loopCntId" />-->
>                                <tr>
>                                    <td class="blank">&nbsp;</td>
>                                        <td><nested:write
> name="tableLevelMap" property="key" /></td>
>                                        <nested:iterate
> name="a4idBreakMap" id="cntLevelList" >
>                                                <nested:define
> name="cntLevelList" id="cntId" property="value"/>
>                                                <td><nested:write
> name="cntId" property="cnt" /></td>
>                                        </nested:iterate>
>
>                                </tr>
>                                </nested:iterate>
>                                <tr><td colspan="10">&nbsp;</td></tr>
>                                <tr><td colspan="10">&nbsp;</td></tr>
>                                <tr><td colspan="10">&nbsp;</td></tr>
>                        </c:if>
>                        </nested:notEmpty>
> </nested:iterate>
>
>
> Visit our website at http://www.ubs.com
>
> This message contains confidential information and is intended only
> for the individual named.  If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail.  Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mail transmission cannot be guaranteed to be secure or error-free
> as information could be intercepted, corrupted, lost, destroyed,
> arrive late or incomplete, or contain viruses.  The sender therefore
> does not accept liability for any errors or omissions in the contents
> of this message which arise as a result of e-mail transmission.  If
> verification is required please request a hard-copy version.  This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities or
> related financial instruments.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: How to use nested iterate...through ArrayList

Posted by Sh...@ubs.com.
 
Hi I am trying to nested:iterate fro looping through am hashMap of
Hashmap of ArratList<UserDefinedObject>

But I get property "cnt" cannot be found error. When looping through the
object of arrayList, I was able to loop through the forst two hashmaps &
print out their keys, but printing out the values in ArrayList is a
problem.


Below Is the code.

<nested:iterate id="a4idBreakMap" name="SearchResultBean"
property="jspDisplayA4idSummaryMap" indexId="count">
			<!-- IF MAP IS NOT EMPTY, LOOP THROUGH IT -->
			<nested:notEmpty name="a4idBreakMap"
property="value">
			<nested:define name="a4idBreakMap" id="mapA4id"
property="key" />	
			<c:if test='${pageScope.mapA4id ==
pageScope.mainLoopA4id}'>
				<nested:iterate name="a4idBreakMap"
id="tableLevelMap" property="value">
				<!--<nested:define name="tableLevelMap"
property="value" id="loopCntId" />-->
				<tr>
				    <td class="blank">&nbsp;</td>
					<td><nested:write
name="tableLevelMap" property="key" /></td>
					<nested:iterate
name="a4idBreakMap" id="cntLevelList" >
						<nested:define
name="cntLevelList" id="cntId" property="value"/>
						<td><nested:write
name="cntId" property="cnt" /></td>
					</nested:iterate>
					
				</tr>
				</nested:iterate>
				<tr><td colspan="10">&nbsp;</td></tr>
				<tr><td colspan="10">&nbsp;</td></tr>
				<tr><td colspan="10">&nbsp;</td></tr>
			</c:if>
			</nested:notEmpty>
</nested:iterate>


Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org