Iterator Scope Problem
I have a problem in passing a list to a function
<logic:present name="mlsList">
<logic:iterate id="mlsList"
name="mlsList">
<bean:define id="ml"
name="mlsList"
type="com.tam.tr.util.MLSAccountBean" />
<tr>
<td nowrap=""> <bean:write name="ml" property="from_date"/></td>
<td nowrap=""> <bean:write name="ml" property="to_date"/></td>
</tr>
</logic:iterate>
</logic:present>
</table>
<table>
<tr>
<input type="button" value="Show" onClick="addFun(this.form.model,this.form.source); ">
</tr>
</table>
function addRow(mlist,slist)
{
alert("I got "+mlist[0].text+ "and"+mlist[0].text);
}
I get the alert as I got Undefined and Undefined
If I remove the logic & iteration then it works fine.
Why is the iterator causing problems ? any solutions ?
thanks.
|