Thanks David,
I tried doing that, along the following lines:

<logic:present name="<%= Action.LIST %>">
<logic:present name="<%= Action.KEYS %>">
<table>
<logic:iterate id="vo" indexId="index" name="<%= Action.LIST %>" type="VO">
  <tr>
    <td>
      <html:link page="details.jsp" name="<%= Action.KEYS %>"
property="keyFields[index]">
        <bean:write name="vo" property="name"/>
      </html:link>
    </td>
  </tr>
</logic:iterate>
</table>
</logic:present>
</logic:present>

But I get:
<Oct 1, 2003 2:23:40 PM PDT> <Error> <HTTP>
<[WebAppServletContext(3016177,mywebapp,/mywebapp)] Root cause of
ServletException
java.lang.IllegalArgumentException: Invalid indexed property
'keyFields[index]'
        at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.
java:422)
        at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j
ava:770)
        at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80
1)
        at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:952)
        at
org.apache.struts.util.RequestUtils.computeParameters(RequestUtils.java:286)
        at
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:462)
        at
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
        at
jsp_servlet._notary.__notary_search._jspService(__notary_search.java:553)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:262)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:198)
        at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:250)
        at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
        at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:262)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:198)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2637)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2359)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>


Thanks again,
Justin

-----Original Message-----
From: Karr, David [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 10:58 AM
To: Struts Users Mailing List
Subject: RE: Using logic:iterate with twin Collections


You'll have to use the "indexId" attribute to allow you to reference the
index value, and then directly reference the entry of the other
collection using that value.

> -----Original Message-----
> From: Justin Mahoney [mailto:[EMAIL PROTECTED] 
> 
> Hi,
> I have two Collections (ArrayLists) with an equal number of 
> elements that
> are directly related to each other, but the child elements have no
> references to each other. How can I use the logic:iterate tag 
> to iterate
> over the first and pull out the corresponding element from 
> the other for use
> in the html:link tag?
> Specifically, the second Collection is an ArrayList of Maps for the
> html:link tag's use with the 'property' attribute.
> Thanks,
> Justin
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to