struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Heritier <aherit...@sopra.com>
Subject RE: Index within iterate tags
Date Mon, 27 Aug 2001 07:43:19 GMT
Thanx for the correction Martin.

arno

-----Message d'origine-----
De:	martin.cooper@tumbleweed.com [SMTP:martin.cooper@tumbleweed.com]
Date:	samedi 25 aout 2001 23:02
A:	struts-user@jakarta.apache.org; Heritier Arnaud
Objet:	Re: Index within iterate tags

Not quite. You need to specify the property attribute instead of the name
attribute, like this:

<html:hidden property="my_hidden_field_name" value="<%=myId%>"%>

--
Martin Cooper


----- Original Message -----
From: "Heritier Arnaud" <aheritier@sopra.com>
To: <struts-user@jakarta.apache.org>
Sent: Friday, August 24, 2001 2:58 AM
Subject: RE: Index within iterate tags


> You should do it like this  but I didn't test it :
>
> <html:hidden name="my_hidden_field_name" value="<%=myId%>"%>
>
> -----Message d'origine-----
> De: Paolo Balzarotti [SMTP:paolo.balzarotti@tecnomatica.com]
> Date: vendredi 24 aout 2001 11:40
> A: 'struts-user@jakarta.apache.org'
> Objet: R: Index within iterate tags
>
> WOW!!! It's magic!
> Is it possible to put the index value in an hidden field?
>
> Thank you!
>
> -----Messaggio originale-----
> Da: Heritier Arnaud [mailto:aheritier@sopra.com]
> Inviato: venerdi 24 agosto 2001 11.05
> A: 'struts-user@jakarta.apache.org'
> Oggetto: RE: Index within iterate tags
>
>
> What Chris want to say is to use the indexId attribute like this :
>
> <!--The property "getTitoliStudio" of class Curriculum return a Vector-->
> <logic:iterate id="iterateId" property="titoliStudio" name="curriculum"
> indexId="myId">
> <html:form action="/addTitoloStudio">
> ...... <bean:write name="myId" scope="page"/> .......
> <html:text property="myProperty"/>
> <html:submit property="addTitoloStudio" value="Aggiungi"/>
> </html>
>      </logic>
>
> arno
> -----Message d'origine-----
> De: Paolo Balzarotti [SMTP:paolo.balzarotti@tecnomatica.com]
> Date: vendredi 24 aout 2001 10:55
> A: 'struts-user@jakarta.apache.org'
> Cc: 'cassenza@Accessdc.com'
> Objet: R: Index within iterate tags
>
> Hi,
> ... I don't understand you answer ... :-o
> how can you get the indexId value? What is "somevalue"?
> Suppose you have:
>
> <!--The property "getTitoliStudio" of class Curriculum return a Vector-->
> <logic:iterate id="iterateId" property="titoliStudio" name="curriculum">
> <html:form action="/addTitoloStudio">
> <bean:????> <!- I'd like to have the iterator index in an
> hidden field-->
> <html:text property="myProperty"/>
> <html:submit property="addTitoloStudio" value="Aggiungi"/>
> </html>
> </logic>
>
>
> How can I put the iterator index in an hidden field in the form?
>
> Thank you
>
> -----Messaggio originale-----
> Da: Assenza, Chris [mailto:cassenza@Accessdc.com]
> Inviato: martedi 14 agosto 2001 18.47
> A: 'struts-user@jakarta.apache.org'
> Oggetto: RE: Index within iterate tags
>
>
> When you write your iterator tag add the attribute: indexId="somevalue"
>
> Then you can use the bean tags to access "indexId" which returns the
current
> index of the iterator! :-)
>
> -Chris
>
> Christopher Assenza
> Phone: 412.201.6026
> Fax:     412.201.6060
> Email: cassenza@accessdc.com
> ACCESSDATA
> Moving Your Business from Point A to Point e.SM
> http://www.accessdc.com/
>
>
>
> -----Original Message-----
> From: Nicola Taylor [mailto:nicola.taylor@levelseas.com]
> Sent: Tuesday, August 14, 2001 12:00 PM
> To: Struts-User (E-mail)
> Subject: Index within iterate tags
>
>
> Hi,
>
> were using the indexed properties tags and it'd be useful to know the
> current index in the jsp (to do some javascript stuff).  Is there any
> standard way to access the current index in the iterator?
>
> 1) write a custom tag to return:
> IterateTag iterateTag = (IterateTag) findAncestorWithClass(this,
> IterateTag.class);
> iterateTag.getIndex();
>
> 2) have a counter variable that we increment within the iterate loop.
>
> Cheers
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************
>
>



Mime
View raw message