Re: defining style class with the iterate tag
You can do it this way logic:iterate name=mailFilterForm property=registredList id=mailView bean:define id=index name=mailView property=index/ tr td class=%= (Integer.parseInt(index)%2 == 0)?paire:impaire% bean:write name=mailView property=sender/ /td /tr /logic:iterate - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 4:02 PM Subject: defining style class with the iterate tag hi all, I'm using the iterate tag to display my arrayList element like this. logic:iterate name=mailFilterForm property=registredList id=mailView tr class=paire td align=centerbean:write name=mailView property=code//td tdbean:write name=mailView property=sender//td tdbean:write name=mailView property=dateStart//td tdbean:write name=mailView property=dateEnd//td tdbean:write name=mailView property=targetDir//td /tr /logic:iterate and it works fine. But I would like to define row style class in bold according to the index value of the iterated element. without using the tag is looked like this tr class=%= (index%2 == 0)?paire:impaire% where index is the index value of the iterated element. But I don't know how to perform this inside the iterate tag. The mailView object has a property named index could be used to perform some comparison. But I don't know how to use it. Can some one helps ? thanks. Meissa -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: defining style class with the iterate tag
If you are using 1.1b2 then the iterate tag has an indexed attribute. For you example below: logic:iterate name=mailFilterForm property=registredList id=mailView indexId=index Kurt Madel Programmer, CSMi (703) 823-4300 ext. 170 -Original Message- From: [EMAIL PROTECTED] [mailto:meissa.Sakho;bpam.fr] Sent: Tuesday, October 29, 2002 5:32 AM To: [EMAIL PROTECTED] Subject: defining style class with the iterate tag hi all, I'm using the iterate tag to display my arrayList element like this. logic:iterate name=mailFilterForm property=registredList id=mailView tr class=paire td align=centerbean:write name=mailView property=code//td tdbean:write name=mailView property=sender//td tdbean:write name=mailView property=dateStart//td tdbean:write name=mailView property=dateEnd//td tdbean:write name=mailView property=targetDir//td /tr /logic:iterate and it works fine. But I would like to define row style class in bold according to the index value of the iterated element. without using the tag is looked like this tr class=%= (index%2 == 0)?paire:impaire% where index is the index value of the iterated element. But I don't know how to perform this inside the iterate tag. The mailView object has a property named index could be used to perform some comparison. But I don't know how to use it. Can some one helps ? thanks. Meissa -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org