1st, Thank you, I didn't realize the logic:Iterate tag had those two
properties, so you've indirectly saved me some effort.

2nd, After looking at the source code for the iterate tag, it looks like it
tries to look up those two values straight out of the pageContext.  This
would imply to me, that it doesn't look up the property on the form as it
appears you want it to do.   (i.e. if you do a
request.setParameter("pageOffset","5") in your Action Class) or use a
<html:hidden property="pageOffset"/> tag on your jsp page, it should work
correctly.
I think both ways are valid, but my gut is that the way you where going at
it is the way anybody unfamiliar with the tag would try to use it.  

Perhaps this is a candidate for refactoring, I'd personally like a way to
choose either way.  It just seems bad practice to have one field be sucked
from the bean, and two others be read from the page context (and it appears
to be a simple 2 line fix).



-----Original Message-----
From: Gregory F. March [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 12:00 PM
To: [EMAIL PROTECTED]
Subject: Passing variables for logic:iterate



Ok, this is probably a dumb questio, but here it goes...

I am trying to iterate over a portion of a list.  I have calculated the
portion (the offset and length) in my action.  I have two entries in my
DynaValidatorForm:

      <form-property name="pageOffset"          type="java.lang.String"/>
      <form-property name="pageLength"          type="java.lang.String"/>

And I am doing a myform.set("pageOffset", String.valueOf(myCalcOffset));
etc.

The iterate is:

  <logic:iterate id="item"
                 name="bfData"
                 type="...lc.web.dto.BfFullEntryData"
                 offset="pageOffset"
                 length="pageLength"
                 indexId="index">

It just plain doesn't work.  If I substitute something like "5" for
pageOffset or pageLength,  it works like a champ.

What am I missing?  It's got to be something simple...

Thanks,

/greg

--
Gregory F. March    -=-    http://www.gfm.net:81/~march    -=-    AIM:GfmNet

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to