You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ezequiel Puig <e....@vivacances.fr> on 2007/06/12 10:53:55 UTC

RE : Embedded problem

Hi,

You can try:

<s:iterator value="destObjects">
  <tr>
    <s:iterator value="visibleColumns">
      <td>
        <s:property value="fieldDefName" />
      </td>
    </s:iterator>
  </tr>
</s:iterator>


Ezequiel.


-----Message d'origine-----
De : tailsherry@hotmail.com [mailto:tailsherry@hotmail.com] 
Envoyé : mardi 12 juin 2007 04:22
À : user@struts.apache.org
Objet : Embedded <s:iterator/> problem

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>

Variable "destObejcts" is a <LIST> type which contains a serial of objects 
named "destObject". 

Variable "visibleColumns" is also a LIST of objects named "visibleColumn", 
and 
"fieldDefName" is a property of "visibleColumn". 

And thus value of expression "visibleColumn.fieldDefName" will be a 
property name of object "destObject".

Above relationship between two objects sounds a bit boring. As a trouble, I 
failed to get the correct values of these dynamic fields of "destObejct", 
and I had tried in many ways, and next Struts2 expressions ALL could not 
work:

<s:property value="destObjects[%{#stat.index}].%{fieldDefName}" />
<s:property value="%{destObjects[#stat.index].%{fieldDefName}}" />
<s:property value="%{fieldDefName}" />


Is there anyone could help me? Thanks.

_________________________________________________________________
享用世界上最大的电子邮件系统— MSN Hotmail。  http://www.hotmail.com  


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