Thanks, Laurie.
Your OGNL expression does work!
<s:iterator id="do" value="destObjects">
<tr>
<s:iterator value="visibleColumns">
<td>
<s:property value="%{#do[fieldDefName]}"/>
</td>
</s:iterator>
</tr>
</s:iterator>
In fact, I have been trying in many ways. Here is the most similar
expression as yours which seems to be right at all:
<s:iterator id="do" value="destObjects">
<tr>
<s:iterator value="visibleColumns">
<td>
<s:property value="%{#do.%{fieldDefName}}"/>
</td>
</s:iterator>
</tr>
</s:iterator>
But it does not work! I quite not understand it.
Thanks you again :)
From: Laurie Harper <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: user@struts.apache.org
Subject: Re: [S2] Multiple <s:iterator/> problem
Date: Wed, 13 Jun 2007 14:54:58 -0400
Please keep related messages within the same thread and try to avoid
re-posting a question without the context of any prior discussion. See
below for another suggestion:
Wei Xu wrote:
First, you can look through next jsp codes:
<s:iterator status="stat" value="destObjects">
<tr>
<s:iterator value="visibleColumns">
<td>
<s:property value="destObjects[%{#stat.index}].%{fieldDefName}" />
</td>
</s:iterator>
</tr>
</s:iterator>
Why do the indexing into destObjects manually when s:iterator is already
doing it for you? How about something like this:
<s:iterator id="do" value="destObjects">
<tr>
<s:iterator value="visibleColumns">
<td>
<s:property value="%{#do[fieldDefName]}"/>
</td>
</s:iterator>
</tr>
</s:iterator>
or, being a little more explicit if you prefer:
<s:iterator id="do" value="destObjects">
<tr>
<s:iterator id="vc" value="visibleColumns">
<td>
<s:property value="%{#do[#vc.fieldDefName]}"/>
</td>
</s:iterator>
</tr>
</s:iterator>
ALL could not work:
<s:property value="destObjects[%{#stat.index}].%{fieldDefName}" />
<s:property value="%{destObjects[#stat.index].%{fieldDefName}}" />
<s:property value="%{fieldDefName}" />
The first two don't look like valid OGNL expressions to me; I don't know
OGNL very well, but I wouldn't expect it to support nested expressions
(%{...%{...}...}).
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]