This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Tags  RSS feed

 
Sophie Angela
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case of custom tags,while calling the getParent() method can we use super.getParent().?

If yes how it is different from this.getParent();
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getParent() will be available if you are extending your tag through TagSupport or BodyTagSupport classes whereas if you are trying to implement Tag/Iteration/BodyTag then you'll have to override getParent() method in your tag handler.

In case of TagSupport/BodyTagSupport, same java rule will apply i.e. you can call super.getParent() because these classes provide their implementation for this method. Whereas you can override the method in your tag handler and thus can call through this.getParent().

Hope it helps
 
Sophie Angela
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!