Announcement Announcement Module
No announcement yet.
How to change CSS on tabs based on rendered view Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change CSS on tabs based on rendered view

    I'm looking for ideas on how to set a dynamic id value on body based on the current Tiles view in a typical Spring Roo MVC set up. My objective is to use ascendent selectors in order to change the look of my navigation in different areas of the site.

    I guess I could use class on the current list element of my navigation as an alternative.

    I suspect it'd be possible to mark up my body element in my "default.jspx" template file and insert the relevant value somehow based on my tiles view definition. But if this is possible I'm not sure what I could be looking for? Some kind of dynamic value connected to the view?

    This is my basic tiles definition:
    <definition name="default" template="/WEB-INF/layouts/default.jspx">
        <put-attribute name="header" value="/WEB-INF/views/head.jspx" />
    <put-attribute name="primary" value="/WEB-INF/views/primary.jspx" />
        <put-attribute name="footer" value="/WEB-INF/views/foot.jspx" />
    One obvious method would be to replace head above depending on the current area, but I'd prefer to only affect the nav, so then I suppose I should be looking for nested tiles and put my navigational element in another tile inside "header" above , if that is at all possible.

    Is this the best approach or can you suggest something more useful?

    I'm thankful for simple pointers.
    Last edited by MiB; Dec 6th, 2011, 05:19 AM.