You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by taj uddin <ta...@yahoo.com> on 2008/12/23 06:00:35 UTC

How to assign a index value of to a int variable.

Hi,

In my application I want to assign the value of the status attribute of <s:iterator> tag to the int variable.
In clear(explanation):-----I have the this code(below)

<s:iterator value="%{#session.Tables}" status="idx" id="Table" >
I have tried to get the index value of the current iteration with the help of index() method.
where #idx.index() gives the index value. Now i want to assign this value to the int variable.

Can u pls help me out in this issue.





      

Re: How to assign a index value of to a int variable.

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
This works for me:

<s:iterator status="idx" value="someArray">
	<s:set name="index" value="#idx.index"/>
</s:iterator>

Nils-H

On Tue, Dec 23, 2008 at 6:00 AM, taj uddin <ta...@yahoo.com> wrote:
> Hi,
>
> In my application I want to assign the value of the status attribute of <s:iterator> tag to the int variable.
> In clear(explanation):-----I have the this code(below)
>
> <s:iterator value="%{#session.Tables}" status="idx" id="Table" >
> I have tried to get the index value of the current iteration with the help of index() method.
> where #idx.index() gives the index value. Now i want to assign this value to the int variable.
>
> Can u pls help me out in this issue.
>
>
>
>
>
>

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