At 05:20 PM 7/25/2001 -0400, you wrote:
>Hi James,
>
>Thanks for your note - made me think a bit!
>
>Would be interested in knowing more about the other indexed tags that were
>posted and you are using. I know either Jeff Trent or Martin Cooper had
>produced some tags which had a different name ie IndexedXXXTag.
I believe the mods we have are based on those posted by Niall
Pemberton. In those mods, a handful of HTML tags had their doStartTag()
method modified to be changed from:
results.append(" name=\"");
results.append(this.property);
to
results.append(" name=\"");
results.append(propertyName());
where propertyName() was implemented like this:
protected String propertyName() {
IterateTag iterateTag = (IterateTag) findAncestorWithClass(this,
IterateTag.class);
return iterateTag == null
? this.property
: iterateTag.getProperty() + "[" +
iterateTag.getIndex() + "]." + this.property;
}
In the original mods that we had, the getProperty method of IterateTag
simply returned the property field value. I modified it to invoke a
propertyName() method whose implementation is the same as that given
above. This allows for a recursive buildup of indexed property fields when
an HTML tag is included inside of any number of nested iterate tags.
James W. Howe mailto:[EMAIL PROTECTED]
Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103