ICEfaces
  1. ICEfaces
  2. ICE-9163

Resource Ordering not maintained upon page navigation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: Bridge, Framework
    • Labels:
      None
    • Environment:
      ICEfaces 3.x
    • Assignee Priority:
      P1

      Description

      The resource ordering is not maintained properly when page navigation occurs.

      To reproduce the issue, use the showcase sample. Monitor the HEAD section after each of the following steps:

      1. Load the showcase application (opens to the Overview landing page)
      1a. Resource ordering is correct (theme is first, etc.)
      2. Change the current theme to "swanky-purse" using the themeSelector.
      2a. Resource order is still correct (theme is now swanky-purse, but loaded first).
      3. Navigate to the Accordion demo by clicking on the link on the left side.
      3a. Resource ordering has been lost, theme is now loaded last, other ordering is not maintained either.


      1. 1stNavAfterThemeChange.png
        171 kB
      2. 1stnavAfterThemeChange-Coalesced.png
        75 kB
      3. 1stPgLoad.png
        163 kB
      4. 1stPgLoad-Coalesced.png
        78 kB
      5. Step1-HeadContents.png
        155 kB
      6. Step2-HeadContents.png
        154 kB
      7. Step3-HeadContents.png
        161 kB

        Issue Links

          Activity

          Hide
          Ken Fyten added a comment -

          Attached pics to illustrate the head section contents after each step.

          Show
          Ken Fyten added a comment - Attached pics to illustrate the head section contents after each step.
          Hide
          Mircea Toma added a comment -

          Added resource dependency data for the new theme selector resources.

          Show
          Mircea Toma added a comment - Added resource dependency data for the new theme selector resources.
          Hide
          Ken Fyten added a comment -

          Re-opened as there is still an ordering issue when "org.icefaces.coalesceResources=true" mode is used.

          To reproduce the issue, use the showcase sample (from trunk rvn# 34387+). Monitor the HEAD section after each of the following steps:

          1. Load the showcase application (opens to the Overview landing page)
          1a. Resource ordering is correct (Sam theme comes before other CSS, incl. coalesced.css)
          2. Change the current theme to "Pepper-grinder" using the themeSelector.
          2a. Resource order is now incorrect. "Pepper-grinder theme is loaded AFTER the coalesced.css file.

          The theme MUST be loaded before the coalesced.css or any theme customizations in the coalesced.css file will be overridden by the theme being reloaded again after the coalesced.css has been applied.

          Show
          Ken Fyten added a comment - Re-opened as there is still an ordering issue when "org.icefaces.coalesceResources=true" mode is used. To reproduce the issue, use the showcase sample (from trunk rvn# 34387+). Monitor the HEAD section after each of the following steps: 1. Load the showcase application (opens to the Overview landing page) 1a. Resource ordering is correct (Sam theme comes before other CSS, incl. coalesced.css) 2. Change the current theme to "Pepper-grinder" using the themeSelector. 2a. Resource order is now incorrect. "Pepper-grinder theme is loaded AFTER the coalesced.css file. The theme MUST be loaded before the coalesced.css or any theme customizations in the coalesced.css file will be overridden by the theme being reloaded again after the coalesced.css has been applied.
          Hide
          Mircea Toma added a comment -

          Modified ace:themeSelect component to use the resource related JSF API to properly enable resource ordering and coalescing. Now the component needs org.icefaces.generateHeadUpdate enabled to properly work since its basing the theme swiching on the update of the head trough ICEfaces core. Also moved state and utility methods from renderer to component.

          Show
          Mircea Toma added a comment - Modified ace:themeSelect component to use the resource related JSF API to properly enable resource ordering and coalescing. Now the component needs org.icefaces.generateHeadUpdate enabled to properly work since its basing the theme swiching on the update of the head trough ICEfaces core. Also moved state and utility methods from renderer to component.
          Hide
          Mircea Toma added a comment -

          Modified bridge to keep the list of current link refs up to date. This way CSS rules that were once interpreted will re-applied whenever the same resource will be referenced again.

          Show
          Mircea Toma added a comment - Modified bridge to keep the list of current link refs up to date. This way CSS rules that were once interpreted will re-applied whenever the same resource will be referenced again.
          Hide
          Ken Fyten added a comment -

          I've retested showcase with these latest changes in place. Now the ordering of the theme CSS is incorrect both when coalesced and not.

          The new behaviour has the theme css being loaded after the coalesced.css (or after other component and application CSS when not coalesced). This is incorrect as it makes it impossible for the application to override/customize the theme styling if the theme css is not loaded before the application css. Generally, the theme css needs to be loaded first.

          I did notice that the theme.css is no longer included in the coalesced.css file, which avoids the issue noted in ICE-9166, so that JIRA could probably be marked FIXED due to these changes.

          In addition, the ace:themeSelect component now longer takes effect until the page is reloaded or navigated away from, whether or not coalescing is active. Previously, the theme change would take effect immediately when changed on the page (via a forced page refresh).

          Show
          Ken Fyten added a comment - I've retested showcase with these latest changes in place. Now the ordering of the theme CSS is incorrect both when coalesced and not. The new behaviour has the theme css being loaded after the coalesced.css (or after other component and application CSS when not coalesced). This is incorrect as it makes it impossible for the application to override/customize the theme styling if the theme css is not loaded before the application css. Generally, the theme css needs to be loaded first. I did notice that the theme.css is no longer included in the coalesced.css file, which avoids the issue noted in ICE-9166 , so that JIRA could probably be marked FIXED due to these changes. In addition, the ace:themeSelect component now longer takes effect until the page is reloaded or navigated away from, whether or not coalescing is active. Previously, the theme change would take effect immediately when changed on the page (via a forced page refresh).
          Hide
          Ken Fyten added a comment -

          Attached snapshots of the various head states that demonstrate the incorrect ordering of the theme.css.

          Show
          Ken Fyten added a comment - Attached snapshots of the various head states that demonstrate the incorrect ordering of the theme.css.
          Hide
          Mircea Toma added a comment -

          Introduced AddTheme system event listener that adds the theme resource before the view is rendered. Changed CoalescedResource.userAgentNeedsUpdate to return true when the browser request is missing if-modified-since header. Modified ResourceHandler to recalculated the list on every GET, instead of just the first one. Added org.icefaces.generateHeadUpdate to the showcase web.xml.

          Show
          Mircea Toma added a comment - Introduced AddTheme system event listener that adds the theme resource before the view is rendered. Changed CoalescedResource.userAgentNeedsUpdate to return true when the browser request is missing if-modified-since header. Modified ResourceHandler to recalculated the list on every GET, instead of just the first one. Added org.icefaces.generateHeadUpdate to the showcase web.xml.
          Hide
          Mircea Toma added a comment -

          Moved AddTheme class into ThemeSelectRenderer class. Modified theme select behaviour to reload the page if ace:ajax is used to react to theme changes. Read default theme from context-parameter when initial theme is not defined. Removed org.icefaces.generateHeadUpdate from "showcase" web.xml.

          Show
          Mircea Toma added a comment - Moved AddTheme class into ThemeSelectRenderer class. Modified theme select behaviour to reload the page if ace:ajax is used to react to theme changes. Read default theme from context-parameter when initial theme is not defined. Removed org.icefaces.generateHeadUpdate from "showcase" web.xml.

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: