Hi.
I have created a html <td> <tr> tag which can used neted inside the
struts iterate tag. The idea is that the tag will generate the
surrounding TR and TD tags, so that the data exposed from the iterate
tag can be properly displayed in several columns for each row. Now the
problem is that my tag requires to know the size of the collection which
the iterate tag is iterating over. What I have done in the doStartTag is
this: 
IterateTag parent = (IterateTag)findAncestorWithClass(this,
IterateTag.class);
if (parent == null) {
        throw new JspTagException("This tag must run inside " +
        "org.apache.struts.taglib.logic.IterateTag");
                        
                        
}
else{
        Collection temp = (Collection)parent.getCollection();
        if(temp != null){
        logger.debug("YEAH parent collection was not null and size is "
+
        temp.size());
        logger.debug("Lets check the ofset ");
        String offset = parent.getOffset();
        if(offset != null){
                logger.debug("Ofset is not null " +
                "value is " + offset);
                logger.debug("So the actual size should be " + 
                (temp.size()- Integer.parseInt(offset)));
                                        
        }
}
else
        logger.debug("Collection from parent tag was null");

No matter what the collection from the struts iterate tag is alway null,
which means it's a non initialized collection. What am I doing wrong ?
How do I gain acces to the size of the collection that the iterate tag
is iteration over ?
Any help is greatly appreciated.
Thanks
Cheers
Tommy Holm, System Developer
TELMORE A/S


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

Reply via email to