Results 1 to 1 of 1

Thread: How to change CSS on tabs based on rendered view

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default 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:
    Code:
    <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" />
      </definition>
    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 at 05:19 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •