Mike Wilson wrote:
> Does anyone have a code sample to remove all elements and attributes from a
> TD tag? I think my problem with memory usage is that I'm creating a new TD
> for every column in every row. I had hoped to instantiate a single TD
> object and then clear it out and reuse it each time I insert data into the
> table. I've tried this code but it doesn't actually remove the element for
> some reason. Infinite loop. Any help?
>
> {infinite loop}
> TD tCol = new TD(true);
> while(tCol.elements().hasMoreElements() == true) {
> sSql = tCol.elements().nextElement().toString();
> tCol.removeElement(sSql);
> }
>
I don't remember of elements() returns an enum of names or an enum of ecs
elements if it is an enum of ecs elements you would do the following :
should be tCol.removeElement(Integer.toString(sSql.hashCode)); // if you
didn't provide your own name to addElement
If it is an enum of names then removeElement is broke and needs to be fixed.
-stephan
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]