• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple tags.

 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
See the code bellow.
<prefix:sufix attr="text">
<prefix:sufix attr="text">
<prefix:sufix attr="text"/>
</prefix:sufix>
</prefix:sufix>

Lets assume <prefix:sufix> tag is implements Simple tag API.

problems:
1. To get the communication between the child and parent.
2. To get the depth the each tag

We can solve using getParent() method.


But can we use findancistorWithClass(JspTag,class) method to solve any of these 2 problems.
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It may be used to solve the first problem.
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some could tell with clearly so that we will get complete understanding.
 
Baddy Davay
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually findAncesstorWithclass will return you the immidiate parent when invoking from the child ,So in this case the findAncestorWithClass will work the same way as getPArent()
 
Baddy Davay
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i said the immediate parent means the parent type of class you are passing as the parameter ,for example:
<prefix:sufix attr="text">
<prefix:sufix attr="text">
<prefix:sufix attr="text"/>
</prefix:sufix>
</prefix:sufix>
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Baddy,

So you mean to say findAncesstorWithclass will solve both of above problems?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!