You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Abhinav (Cognizant)" <Ab...@cal.cognizant.com> on 2003/05/29 17:44:24 UTC

Indexed Fields

How to dynamically generate indexed html fields as well as populate them from the form bean.
I am unable to do both simultaneously.

My fields will be generated by 
		<html:text property="indexdProperty[0]"/>
		<html:text property="indexdProperty[1]"/> ...

For this I use 
	        <logic:iterator indexId="id">
		<html:text property="indexdProperty[<bean:write name="id">]"/> 
	         </logic:iterate>
	
	But the HTML output that it gives is this .. 
		<html:text property="indexdProperty[0]" />
		<html:text property="indexdProperty[1]" /> ...
______________________________________________________________________________________

When instead of using iterator I use it like this
(hardcoding indices)	
	<html:text property="indexdProperty[0]" />
	<html:text property="indexdProperty[1]" />
	<html:text property="indexdProperty[3]" /> ...
	 
i get output as 
	<input type="text" name="indexdProperty[0]" value="1">
	<input type="text" name="indexdProperty[0]" value="2">
	<input type="text" name="indexdProperty[0]" value="3">	

which is correct
__________________________________________________________________________________________
ANY HELP ON WHAT I AM TRYING TO DO ....


Thanx.


Re: Indexed Fields

Posted by Denis Avdic <de...@betterway.net>.
http://jakarta.apache.org/struts/userGuide/struts-html.html#text

look at indexed property.

hth
Denis

Abhinav (Cognizant) wrote:

>How to dynamically generate indexed html fields as well as populate them from the form bean.
>I am unable to do both simultaneously.
>
>My fields will be generated by 
>		<html:text property="indexdProperty[0]"/>
>		<html:text property="indexdProperty[1]"/> ...
>
>For this I use 
>	        <logic:iterator indexId="id">
>		<html:text property="indexdProperty[<bean:write name="id">]"/> 
>	         </logic:iterate>
>	
>	But the HTML output that it gives is this .. 
>		<html:text property="indexdProperty[0]" />
>		<html:text property="indexdProperty[1]" /> ...
>______________________________________________________________________________________
>
>When instead of using iterator I use it like this
>(hardcoding indices)	
>	<html:text property="indexdProperty[0]" />
>	<html:text property="indexdProperty[1]" />
>	<html:text property="indexdProperty[3]" /> ...
>	 
>i get output as 
>	<input type="text" name="indexdProperty[0]" value="1">
>	<input type="text" name="indexdProperty[0]" value="2">
>	<input type="text" name="indexdProperty[0]" value="3">	
>
>which is correct
>__________________________________________________________________________________________
>ANY HELP ON WHAT I AM TRYING TO DO ....
>
>
>Thanx.
>
>  
>
>------------------------------------------------------------------------
>
>****** Message from InterScan E-Mail VirusWall NT ******
>
>** No virus found in attached file noname.htm
>
>No Virus detected in the attached file(s).
>*****************     End of message     ***************
>
>
>  
>
>------------------------------------------------------------------------
>
>This e-mail and any files transmitted with it are for the sole use of the intended 
>recipient(s) and may contain confidential and privileged information. If you are not the 
>intended recipient, please contact the sender by reply e-mail and destroy all copies of 
>the original message. 
>Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying 
>of this email or any action taken in reliance on this e-mail is strictly prohibited and 
>may be unlawful.
>
>          Visit us at http://www.cognizant.com
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>



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