Wicket
  1. Wicket
  2. WICKET-5366

ResourceAggregator looses information about priority/filtering/... when using a bundle

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.11.0
    • Fix Version/s: 6.12.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      If a resource reference is part of a bundle and this resource reference is rendered with PriorityHeaderItem then the bundle is not rendered with priority.

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          I've added a new test case in master branch - org.apache.wicket.resource.aggregator.bundlepriority.BundlePriorityTest#bundleAShouldBeAtTheTop.
          It uses a page that contributes three header items - two without priority and one with priority.
          Since the prioritized header item is part of a bundle it is not rendered at the top as one would expect.

          Show
          Martin Grigorov added a comment - I've added a new test case in master branch - org.apache.wicket.resource.aggregator.bundlepriority.BundlePriorityTest#bundleAShouldBeAtTheTop. It uses a page that contributes three header items - two without priority and one with priority. Since the prioritized header item is part of a bundle it is not rendered at the top as one would expect.
          Hide
          Martin Grigorov added a comment -

          In WICKET-5291 (the ticket that broke this functionality) I suggested a patch that would fix this behavior but now I think it is not a good fix.
          1) it doesn't cover the case with FilteredHeaderItem
          2) what should be the behavior when a bundle contains two resource references and these references are rendered with different filters (FilteredHeaderItem#getFilterName()) ?
          3) whatever we do in org.apache.wicket.markup.head.ResourceAggregator#getItemToBeRendered to fix the problem with (Priority|Filtered)HeaderItem it won't be able to support user defined IWrappedHeaderItem implementations. I.e. if I have MyHeaderItem(someOtherHeaderItem) then org.apache.wicket.markup.head.ResourceAggregator#getItemToBeRendered will loose the information about MyHeaderItem.

          Show
          Martin Grigorov added a comment - In WICKET-5291 (the ticket that broke this functionality) I suggested a patch that would fix this behavior but now I think it is not a good fix. 1) it doesn't cover the case with FilteredHeaderItem 2) what should be the behavior when a bundle contains two resource references and these references are rendered with different filters (FilteredHeaderItem#getFilterName()) ? 3) whatever we do in org.apache.wicket.markup.head.ResourceAggregator#getItemToBeRendered to fix the problem with (Priority|Filtered)HeaderItem it won't be able to support user defined IWrappedHeaderItem implementations. I.e. if I have MyHeaderItem(someOtherHeaderItem) then org.apache.wicket.markup.head.ResourceAggregator#getItemToBeRendered will loose the information about MyHeaderItem.
          Hide
          Emond Papegaaij added a comment -

          Fixed by rewrapping the bundles if the original header item implements the IHeaderItemWrapper interface. For 7.0, this interface is merged into IWrappedHeaderItem.

          Case 2 will cause the bundle to be rendered in the filter specified by the first of the 2 items rendered.

          Show
          Emond Papegaaij added a comment - Fixed by rewrapping the bundles if the original header item implements the IHeaderItemWrapper interface. For 7.0, this interface is merged into IWrappedHeaderItem. Case 2 will cause the bundle to be rendered in the filter specified by the first of the 2 items rendered.
          Hide
          Martin Grigorov added a comment -

          The fix works! Thanks!

          Show
          Martin Grigorov added a comment - The fix works! Thanks!

            People

            • Assignee:
              Emond Papegaaij
              Reporter:
              Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development