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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          5h 11m 1 Emond Papegaaij 24/Sep/13 13:37
          Hide
          Martin Grigorov added a comment -

          The fix works! Thanks!

          Show
          Martin Grigorov added a comment - The fix works! Thanks!
          Emond Papegaaij made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 7.0.0 [ 12322958 ]
          Fix Version/s 6.12.0 [ 12324889 ]
          Resolution Fixed [ 1 ]
          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 -

          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.
          Martin Grigorov made changes -
          Field Original Value New Value
          Link This issue is broken by WICKET-5291 [ WICKET-5291 ]
          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.
          Martin Grigorov created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development