The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by dsims]

I am just trying to get a better feel for the way tag cleanup should be
handled. After reading the text and studying the examples in the book, I came
to the conclusion that, properties and instance variables that ARE modified by
a tag should be cleaned up in clearServiceState() and properties and instance
variables that ARE NOT modified by a tag should be cleaned up in
clearProperties(). Could you let me know if I'm on the right track in drawing
these conclusions?

Also, it is mentioned that the properties pageContext and parent should be
cleaned up (p. 190). This is not done by any of the tag examples in the book.
Should these properties be cleaned up and under what circumstances?

Thanks,
Dave
import-bot (20211) [Avatar] Offline
#2
Re: Tag Cleanup
[Originally posted by tcfolsom]

I, too, am puzzled by the authors' attempt to distinguish between what goes
into clearServiceState() versus clearProperties(). Their code examples for
email make it difficult to understand this. Since your posting has gone
unanswered since last October, I guess we will not get any feedback from the
authors smilie
My thinking on this is that clearProperties() should really mean
clearAttributes(), where attributes are those defined in the TLD file. If a
tag is being reused on the same page, then perhaps the initialization only
resets those attributes given new values by the tag user. Perhaps other
attributes retain values assigned in the first use of the tag on the page? If
this is the case, then it seems like the purpose of clearProperties() is to
reset all tag attributes. Maybe then clearServiceState() should clear
everything that is not defined as a tag attribute?
I think I'm on the right track based upon careful re-reading of section
7.4.2, page 217, where they refer to email body and subject now being part of
the tag's internal state instead of attribute-based properties. Therefore they
get put into clearServiceState() on page 218.