struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject Re: adding values to a variable inside iterator tag
Date Wed, 01 Jul 2009 20:55:40 GMT
no :(
I tried the following
<s:iterator value="resultList" status="status">
       <s:text name="number.format"><s:param value = "totalCount"/></s:text>
       <s:set name="calcTotalDebtAmt"
value="%{calcTotalDebtAmt+totalCount}"/>
</s:iterator>

and tried to print it
<s:property value="#calcTotalDebtAmt"/>

but it shows nothing :(

On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley <jhkiley@summa-tech.com> wrote:

> Does it work if you replace the "+=" with a "+"?
> jk
>
> On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma <bhaarat.s@gmail.com>
> wrote:
>
> > Does anyone know how to calculate the total value by making use of the
> > <s:set> tag?
> > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma <bhaarat.s@gmail.com>
> > wrote:
> >
> > > for our purpose i'd prefer doing it in the iterator tag.
> > > I tried something like this
> > >
> > > <s:set name="calcTotalDebtAmt"
> > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > >
> > > but this does not seem to work.
> > >
> > > what can fix this?
> > >
> > >
> > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley <jhkiley@summa-tech.com
> > >wrote:
> > >
> > >> You're far better off doing it inside the Action class.
> > >> That said, you can probably use s:set to get what you want.
> > >>
> > >> jk
> > >>
> > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma <bhaarat.s@gmail.com
> > >> >wrote:
> > >>
> > >> > Hi,
> > >> > I have a simple iterator tag like the following
> > >> >
> > >> > <s:iterator value="results">
> > >> >
> > >> >    <s:property value="value1"/>
> > >> >
> > >> > </s:iterator>
> > >> >
> > >> > is there a way to get the total of value1 at the end of this
> iterator
> > >> tag?
> > >> >
> > >> > basically in java we would do totalValue += value1; and then at the
> > end
> > >> of
> > >> > the loop we would have total of value1.
> > >> >
> > >> > Is that possible to do with an iterator tag?
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Jim Kiley
> > >> Senior Technical Consultant | Summa
> > >> [p] 412.258.3346
> > >> http://www.summa-tech.com
> > >>
> > >
> > >
> >
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message