Results 1 to 5 of 5

Thread: Some misunderstandings with redirections and css

  1. #1
    Join Date
    Nov 2012
    Posts
    3

    Default Some misunderstandings with redirections and css

    Hi,

    I'm trying the lite-showcase example from GitHub and I've came across some things I don't fully understand. For example:
    - I've added some different css files depending on we are navigating to normal, mobile or a tablet device.
    - If I open the normal page I can see that page with the styles from normal.css. Then if I click on mobile preferences, the page changes and takes the look within mobile.css.
    - However, if I navigate back to normal preferences and home page, it seems normal.css isn't apply then. If I import normal.css within the body tag, styles are apply again. But it doesn't seem a good workaround to me.

    Any ideas?

    Regards.

  2. #2
    Join Date
    Nov 2010
    Posts
    175

    Default

    That's curious. So you simply added a different stylesheet link to each view, corresponding to normal, mobile and tablet?
    Roy Clarkson
    Spring Mobile Projects Lead

  3. #3
    Join Date
    Nov 2012
    Posts
    3

    Default

    hey,

    thank you for answering. Yes, that's the case.

    I've just forked the project and commit the changes I made to it in case you want to a look.
    https://github.com/IvanFernandez/spr.../lite-showcase

    If I only add the css in the head section of each view nothing seems to happen when I change preferences. Each view get the stylesheet (if any) from the first visited view. If I add them within the body section it works but not completely...

    I think there's something weird with the org.springframework.mobile.device.site.CookieSiteP referenceRepository.SITE_PREFERENCE cookie because when I navigate from mobile from table view, it retains the value of mobile ...

    Regards.

  4. #4
    Join Date
    Nov 2010
    Posts
    175

    Default

    Looking at your project, I recommend adding the c tag notation to your css link. Maybe that will help. I'm testing with the lite-showcase to reference normal, mobile, and tablet stylesheets. I only added one link to the <head> section (as seen below) for each view type. The styles are updating correctly for me when navigating back and forth.

    Code:
    <link rel="stylesheet" href="<c:url value="resources/normal.css" />" type="text/css">
    Roy Clarkson
    Spring Mobile Projects Lead

  5. #5
    Join Date
    Nov 2012
    Posts
    3

    Default

    Thank you Roy!. I will take a look at it.

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
  •