You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anjishnu Bandyopadhyay <an...@yahoo.com> on 2005/08/22 17:09:58 UTC

within -- problem

Hi all, 

I have a <nested:iterate> where I am iterating over a
list of objects. Each object has a property “label”,
which is being displayed as a textbox.

Now, I have a hidden field “hdnField”, for each row of
object.  

I want to call a javascript function “fnUpdate”
onChange of the textbox to update the hidden field.

So, I need to pass the index (row number) of the
particular row to the javascript function, so that,
the particular hidden field for the particular row can
be updated.

I am trying something as follows:

<nested:iterate id="functionalities"         
   name="functionalities" indexId="indxFunc">

     <nested:text styleClass="label" maxlength="100" 
       name="functionalities" property="label" 
       indexed="true"
       onChange=”fnUpdate('<bean:write      
                  name="indxFunc"/>');”/>
     <nested:hidden name="functionalities" 
        property="hdnField" indexed="true"/>
</nested:iterate> 

(The above code snippet is also in the attached .txt
file, in case there is a problem in reading).

But it is not identifying “indxFunc” for “nested:text”
in “<nested:iterate>”.  

It works fine for static tags like “<img>” or “<a>” in
“<nested:iterate>”, 

eg. <img src="find.gif" onclick="fn('<bean:write
name="indxFunc"/>');" /> 

Any way to solve the problem?

A work-around is to update the hidden field in each
row just before submitting the form. But I was
wondering if the problem can be solved the way I am
trying. 

Thanks for your time,
Anjishnu.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com