I copied the jar file into my project and tried using it. (Made sure that it
is picking the new stuff). It is still not iterating my ArrayList
collection. It still shows only the first element.

I even modified my tag to be similar to the new one. The code again is as
shown below. Note  that for simplicity of understanding, I am showing
everything in the doStartTag.


--------------------------------------------------------------------------
public class MyTag extends NestedWriteTag implements NestedNameSupport
{
        public int doStartTag() throws JspException
        {
                // Some stuff removed ....

                /************ AS IN ALL NESTED TAG CODE ******************/
                // original values
                originalName = getName();
                originalProperty = getProperty();

                // set the ID to make the super tag happy
                if (id == null || id.trim().length() == 0) { id = property;
}

                // the request object
                HttpServletRequest request =
(HttpServletRequest)pageContext.getRequest();

                // original nesting details
                originalNesting =
NestedPropertyHelper.getCurrentProperty(request);
                originalNestingName =
NestedPropertyHelper.getCurrentName(request, this);

                if (getName() == null) {
                  // the qualified nesting value
                  nesting =
NestedPropertyHelper.getAdjustedProperty(request, getProperty());
                } else {
                  // it's just the property
                  nesting = getProperty();
                }

                // set the properties
                NestedPropertyHelper.setNestedProperties(request, this);
                /************ AS IN ALL NESTED TAG CODE ******************/


                /************ MY TAG CODE ******************/
                // "theCollectionProperty" is of ArrayList type.
                iterateTag.setProperty("theCollectionProperty");
                iterateTag.doStartTag();

                // Do some stuff to use NestedTextTag, NestedRadioTag etc
                // and set their parent as iterateTag.
                
                //The following doEndTag() is actually inside the doStartTag

                //of myTag.
                iterateTag.doEndTag();
                /************ MY TAG CODE ******************/

                return (SKIP_BODY);             
        }
}

--------------------------------------------------------------------------

I don't know If I am doing anything wrong.....

Thanks,

Nizar Bhamani

-----Original Message-----
From: Arron Bates [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2003 6:03 PM
To: Struts Users Mailing List
Subject: RE: Question about NestedIterateTag (also: nested:iterate &
nested:root)


Have you tried the latest and greatest nested tags?... 

An update changing all the internals that would affect this have changed. It
went in after RC1, so either fetch a nightly, or simply download...

  http://keyboardmonkey.com/downloads/km-nested-v2.03.jar

...and pop it into your WEB-INF/lib directory and spin your container again.
If the problem persists, please get back to me.


Arron.



> I've also attached all test files to the bug report at:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17977
> 
> Personally, I'm seeing more of a problem with the actual
> names re: the nesting level rather than the actual objects,
> but your problem could be a symptom of the same issue too.
> 
> chris
> 
> -----Original Message-----
> From: Bhamani, Nizar A TL56E [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 13, 2003 4:31 PM
> To: 'Struts Users Mailing List'
> Cc: Chris Butler
> Subject: RE: Question about NestedIterateTag (also: nested:iterate &
> nested:root)
> 
> Didn't get the attachment. May be the discussion group filtered it out.
> Can
> you send it to me in an email separately.
> 
> Thanks,
> 
> -----Original Message-----
> From: Chris Butler [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 13, 2003 4:28 PM
> To: Struts Users Mailing List
> Subject: RE: Question about NestedIterateTag (also: nested:iterate &
> nested:root)
> 
> I seem to be having a very similarly related problem with respect to
> nested:iterate and jsp:include.  I've found that the index is lost and
> it always finds the name for the first element in the collection only.
> 
> A simple test that I've done - I've attached.
> 
> Chris
> 
> -----Original Message-----
> From: Bhamani, Nizar A TL56E [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 13, 2003 4:01 PM
> To: 'Struts Users Mailing List'
> Subject: Question about NestedIterateTag
> 
> We have written our own tag to print a bunch of fields read from an XML
> file. I am using various NestedTextTag, NestedRadioTag, NestedSelectTag,
> NestedOptionsTag and it all works fine.
> 
> I had to enhance this to use iterations of a list of fields and am using
> NestedIterateTag.
> 
> However using NestedIterateTag dosen't seem to iterate over the
> collection
> As expected. It just prints prints out the first object from the
> collection.
> 
> Has anybody has experience using the NestedIterateTag ???
> 
> Here is the logic in short:
> 
> public class MyTag extends NestedWriteTag implements NestedNameSupport
> {
>       public int doStartTag() throws JspException
>       {
>               // Some stuff removed ....
> 
>               NestedIterateTag iterateTag = new NestedIterateTag();
>               iterateTag.setParent(this);
>               iterateTag.setPageContext(pageContext);
> 
>               // "theCollectionProperty" is of ArrayList type.
>               iterateTag.setProperty("theCollectionProperty");
>               iterateTag.doStartTag();
> 
>               // Do some stuff to use NestedTextTag, NestedRadioTag
> etc
> and
>               // set their parent as iterateTag.
>               
>               iterateTag.doEndTag();
> 
>               return (SKIP_BODY);             
>       }
> 
> }
> 
> Again, the iteration works only for the first element in the collection.
> 
> Doesn't work for all the elements in the collection.
> 
> Any help would be appreciated.
> 
> Thanks,
> 
> Nizar.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]





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

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

Reply via email to