• Post Reply Bookmark Topic Watch Topic
  • New Topic

getParent from Classic tag enclosed by SimpleTag

 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

A Classic tag's getParent() returns a Tag, but a SimpleTag doesn't extend Tag. So what would be returned by a Classic tag's getParent() if it is enclosed by a SimpleTag?

According to a HFSJ end-of-chapter question, in the following scenario:



the tag referred to as classicTag2 can call getParent() twice to reach classicTag1, but I don't see how that's possible.

Thank you,
Yuriy
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So inside the Classic tag, the call must be:



and the parent isn't even aware that it's being wrapped?

Great, thanks!
-Yuriy
[ July 20, 2005: Message edited by: Yuriy Zilbergleyt ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and the parent isn't even aware that it's being wrapped?


Correct. The parent "adaptee" has no way of knowing (and no reason to know) that it is being wrapped when referenced from a child tag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!