Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested Tag Files  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to write .tag files and access a nested .tag file from within the parent? Example:



So in A.tag is there someway to acces B.tag? Or am I going to have to resort to more traditional custom tags?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of access are you seeking from a to b?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More detals...I'm trying to make a custom tag for JQuery's jqGrid plugin. There is quite a bit of config that goes into the plugin and I wanted to make it easier to reuse across an application. So to give a more accurate example I might have something like this:



And this would result in the appropriate javascript code on the page. So I need the column data available to jqg:grid so that I can construct the information correctly. I struggled for a while trying to do a real taglib and I am just not getting it. Tag files I understand. I just don't know if what I want to do is possible.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the same note if anyone knows of a very good tutorial on writing JSP taglibs with nested tags, I'd appreciate it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use <c:set> in the child tags to record data in the request for use by the parent tag. If it gets too grody, you can revert to using SimpleTag implementations, or a combination (parent is a tag file to emit HTML/JS, child tags are SimpleTag to record data easily).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!