Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Custom tag Dynamically

 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have many Custom tags in my application.. I wanted to use diffent tags based on some condition..

e.g..
Suppose I have myRadio and mySelect custom tag.. and I want to call these based on some condition..

<myTagsome variable) />

Here (Some variable) should be replaced by myRadio or mySelect based on given condition..

How can I implement this..

Please help me with this..
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cannot do it the way you ask, but you can surround your tag with a <c:if> tag from JSTL
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or define the tags in the first place to be able to detect when they should manifest themselves in different ways.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cannot do it the way you ask, but you can surround your tag with a <c:if> tag from JSTL
----------------------------

Yes I can do this but the problem is that I have so many dynamic attributes .. and I don't want to have repetitive code ...
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then Bear has the workable solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic