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...@infosys.com> on 2005/08/29 12:48:28 UTC

problem with within



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.





**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re: problem with within

Posted by Hubert Rabago <hr...@gmail.com>.
Your problem is trying to use a JSP tag within a JSP tag:

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

Try something like: onChange="<%= "fnUpdate('" + <bean:write
name="indxFunc"/> + "')" %>"/>

On 8/29/05, Anjishnu Bandyopadhyay <an...@infosys.com> wrote:
>            
>   
> 
>    
> 
> 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.  
> 
>          
> **************** CAUTION - Disclaimer *****************
>  This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
>  ***INFOSYS******** End of Disclaimer ********INFOSYS***
>   
> <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>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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