Since indexId defines the name on the JSP bean you can use it as any
other bean.

<!-- defining it -->
<logic:iterate id="results" name="nameSearchResults" scope="session"
indexId="inx" type="dhs.vcm.vis.form.NameSearchResultsForm">

<!-- write index number -->
<bean:write name="inx"/>

<!-- use it on html:link - NOT sure about this ???? -->
<html:link page='<%= "NameSearch/Details?selectedClient=" + inx %>' >
<!-- or it might be ???? -->
<html:link page='<%= "NameSearch/Details?selectedClient=" + <bean:write
name="inx"/> %>' >

Try it out.
Leo


-----Original Message-----
From: Struts Developer [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 3:43 PM
To: [EMAIL PROTECTED]
Subject: Re: Getting index inside iterate / pager tag


Okay, I looked in the documentation and found that indexId is "The name
of 
the scripting variable to be exposed as the current index."

What scripting variable? A new one in my JSP? Something on a bean
perchance?

Are there any examples? Why is it that javadocs are void of sample code?

<mark:sigh/>,

/\/\ark




>From: [EMAIL PROTECTED]
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: Getting index inside iterate / pager tag
>Date: Mon, 29 Apr 2002 15:17:47 -0400
>
>
>
>Look in the docs for indexId!
>
>Dave
>
>
>
>
>
>"Struts Developer"
<[EMAIL PROTECTED]> 
>on
>04/29/2002 03:13:08 PM
>
>Please respond to "Struts Users Mailing List"
>       <[EMAIL PROTECTED]>
>
>To:   [EMAIL PROTECTED]
>cc:    (bcc: David Hay/Lex/Lexmark)
>Subject:  Getting index inside iterate / pager tag
>
>
>
>All -
>
>I am trying to get the index of the current row inside an iterate tag
so
>that a link on that row properly identifies itself to the subsequent
action
>class. However, all I get is a Class Not Found error pointing to the
>collection I am iterating.
>
>Here is my code:
>
><logic:iterate id="results" name="nameSearchResults" scope="session"
>type="dhs.vcm.vis.form.NameSearchResultsForm">
><pg:item>
><dhshtml:row oddColor="#9999ff" evenColor="#ccccff">
><td>&nbsp;</td>
><td>
><html:link page='<%= "NameSearch/Details?selectedClient=" +
>nameSearchResults.getIndex() %>' >
><bean:write name="results" property="clientName"/>
></html:link>
></td>
><td><bean:write name="results" property="clientAddress"/></td>
><td><bean:write name="results" property="clientCity"/></td>
><td><bean:write name="results" property="clientState"/></td>
><td><bean:write name="results" property="clientBirthdate"/></td>
><td><bean:write name="results" property="clientSSN"/></td>
></dhshtml:row>
></pg:item>
></logic:iterate>
>
>I have tried using both "nameSearchResults" and "results" followed by
the
>getIndex() call.
>
>What am I screwing up?
>
>TIA,
>/\/\ark
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
>
>--
>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]>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.


--
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]>

Reply via email to