You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Nelson <er...@unishippers.com> on 2008/04/03 22:38:18 UTC

tag help

Hi.  This question may be very simple to answer, but it's driving me
crazy.  If I have code similar to:

 

<s:iterator value="intList">

</s:iterator>

 

Where intList is of type List<Integer>, how do I reference to current
Integer on the value stack without using <s:property />?  So I want to
reference the current Integer with OGNL or EL expression language like:

 

<select>

<s:iterator value="intList">

            <option value="${currInt}" <s:if test="${currInt ==
1}">selected</s:if>>${currInt}</option>

</s:iterator>

</select>

 

Here, currInt is the reference to the current Integer on the value
stack.  I hope this makes sense.  Any help would be greatly appreciated.

 

Thanks,

 

Eric Nelson

Software Engineer Program Manager

 


Re: tag help

Posted by "Dustin S." <ic...@gmail.com>.
Not sure I understand your question ... but

Are you aware of the "status" attribute in the iterator tag?

Something like:

<s:iterator value="intList" status="rowstatus">
   <option value="rowstatus.count">...etc
</s:iterator>
On Thu, Apr 3, 2008 at 2:54 PM, Musachy Barroso <mu...@gmail.com> wrote:

> I meant "iterator" tag ;)
>
> musachy
>
> On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <mu...@gmail.com> wrote:
> > Use the "id" attribute in the for tag, like id="currInt".
> >
> >  musachy
> >
> >
> >
> >  On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <
> eric.nelson@unishippers.com> wrote:
> >  > Hi.  This question may be very simple to answer, but it's driving me
> >  >  crazy.  If I have code similar to:
> >  >
> >  >
> >  >
> >  >  <s:iterator value="intList">
> >  >
> >  >  </s:iterator>
> >  >
> >  >
> >  >
> >  >  Where intList is of type List<Integer>, how do I reference to
> current
> >  >  Integer on the value stack without using <s:property />?  So I want
> to
> >  >  reference the current Integer with OGNL or EL expression language
> like:
> >  >
> >  >
> >  >
> >  >  <select>
> >  >
> >  >  <s:iterator value="intList">
> >  >
> >  >             <option value="${currInt}" <s:if test="${currInt ==
> >  >  1}">selected</s:if>>${currInt}</option>
> >  >
> >  >  </s:iterator>
> >  >
> >  >  </select>
> >  >
> >  >
> >  >
> >  >  Here, currInt is the reference to the current Integer on the value
> >  >  stack.  I hope this makes sense.  Any help would be greatly
> appreciated.
> >  >
> >  >
> >  >
> >  >  Thanks,
> >  >
> >  >
> >  >
> >  >  Eric Nelson
> >  >
> >  >  Software Engineer Program Manager
> >  >
> >  >
> >  >
> >  >
> >
> >
> >
> >  --
> >  "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: tag help

Posted by Eric Nelson <er...@unishippers.com>.
I'm such an idiot.  This works great.  Thanks Musachy.

--Eric

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: Thursday, April 03, 2008 2:54 PM
To: Struts Users Mailing List
Subject: Re: <s:iterator> tag help

I meant "iterator" tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <mu...@gmail.com>
wrote:
> Use the "id" attribute in the for tag, like id="currInt".
>
>  musachy
>
>
>
>  On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson
<er...@unishippers.com> wrote:
>  > Hi.  This question may be very simple to answer, but it's driving
me
>  >  crazy.  If I have code similar to:
>  >
>  >
>  >
>  >  <s:iterator value="intList">
>  >
>  >  </s:iterator>
>  >
>  >
>  >
>  >  Where intList is of type List<Integer>, how do I reference to
current
>  >  Integer on the value stack without using <s:property />?  So I
want to
>  >  reference the current Integer with OGNL or EL expression language
like:
>  >
>  >
>  >
>  >  <select>
>  >
>  >  <s:iterator value="intList">
>  >
>  >             <option value="${currInt}" <s:if test="${currInt ==
>  >  1}">selected</s:if>>${currInt}</option>
>  >
>  >  </s:iterator>
>  >
>  >  </select>
>  >
>  >
>  >
>  >  Here, currInt is the reference to the current Integer on the value
>  >  stack.  I hope this makes sense.  Any help would be greatly
appreciated.
>  >
>  >
>  >
>  >  Thanks,
>  >
>  >
>  >
>  >  Eric Nelson
>  >
>  >  Software Engineer Program Manager
>  >
>  >
>  >
>  >
>
>
>
>  --
>  "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


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


Re: tag help

Posted by Musachy Barroso <mu...@gmail.com>.
I meant "iterator" tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <mu...@gmail.com> wrote:
> Use the "id" attribute in the for tag, like id="currInt".
>
>  musachy
>
>
>
>  On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <er...@unishippers.com> wrote:
>  > Hi.  This question may be very simple to answer, but it's driving me
>  >  crazy.  If I have code similar to:
>  >
>  >
>  >
>  >  <s:iterator value="intList">
>  >
>  >  </s:iterator>
>  >
>  >
>  >
>  >  Where intList is of type List<Integer>, how do I reference to current
>  >  Integer on the value stack without using <s:property />?  So I want to
>  >  reference the current Integer with OGNL or EL expression language like:
>  >
>  >
>  >
>  >  <select>
>  >
>  >  <s:iterator value="intList">
>  >
>  >             <option value="${currInt}" <s:if test="${currInt ==
>  >  1}">selected</s:if>>${currInt}</option>
>  >
>  >  </s:iterator>
>  >
>  >  </select>
>  >
>  >
>  >
>  >  Here, currInt is the reference to the current Integer on the value
>  >  stack.  I hope this makes sense.  Any help would be greatly appreciated.
>  >
>  >
>  >
>  >  Thanks,
>  >
>  >
>  >
>  >  Eric Nelson
>  >
>  >  Software Engineer Program Manager
>  >
>  >
>  >
>  >
>
>
>
>  --
>  "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: tag help

Posted by Musachy Barroso <mu...@gmail.com>.
Use the "id" attribute in the for tag, like id="currInt".

musachy

On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <er...@unishippers.com> wrote:
> Hi.  This question may be very simple to answer, but it's driving me
>  crazy.  If I have code similar to:
>
>
>
>  <s:iterator value="intList">
>
>  </s:iterator>
>
>
>
>  Where intList is of type List<Integer>, how do I reference to current
>  Integer on the value stack without using <s:property />?  So I want to
>  reference the current Integer with OGNL or EL expression language like:
>
>
>
>  <select>
>
>  <s:iterator value="intList">
>
>             <option value="${currInt}" <s:if test="${currInt ==
>  1}">selected</s:if>>${currInt}</option>
>
>  </s:iterator>
>
>  </select>
>
>
>
>  Here, currInt is the reference to the current Integer on the value
>  stack.  I hope this makes sense.  Any help would be greatly appreciated.
>
>
>
>  Thanks,
>
>
>
>  Eric Nelson
>
>  Software Engineer Program Manager
>
>
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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