Wicket
  1. Wicket
  2. WICKET-3607

make ModalWindow CSS contibution more configurable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.17, 1.5-RC3
    • Fix Version/s: 1.4.18, 1.5-RC4
    • Component/s: wicket-extensions
    • Labels:
    • Environment:
      any

      Description

      Right now if you want to modify the CSS of ModalWindow you still get added to page the original CSS as it is included in

      /**

      • Initialize
        */
        private void init() { setVersioned(false); cookieName = null; add(empty = new WebMarkupContainer(getContentId())); add(newCloseButtonBehavior()); add(new WindowClosedBehavior()); add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT)); add(CSSPackageResource.getHeaderContribution(CSS)); }

      I propose to do this as

      /**

      • Initialize
        */
        private void init() { setVersioned(false); cookieName = null; add(empty = new WebMarkupContainer(getContentId())); add(newCloseButtonBehavior()); add(new WindowClosedBehavior()); add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT)); ResourceReference CSS = newCssResource(); if (CSS != null) add(CSSPackageResource.getHeaderContribution(CSS)); }

      /**

      • Allows to override CSS contribution. Returning null means the CSS will be contributed via
      • other sources, e.g. a global CSS resource.
      • @return The CSS resource reference or null if CSS is contributed via other means.
        */
        protected ResourceReference newCssResource() { return CSS; }

      This will allow to easily override the CSS file.... or avoid including one (returning null)... in case the CSS is part of a "global" page CSS... Existing applications will not be affected

      1. ModalWindow.patch
        0.9 kB
        Ernesto Reinaldo Barreiro

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        7d 1h 32m 1 Martin Grigorov 18/Apr/11 14:23
        Hide
        Scott Reed added a comment - - edited

        Please document this in the class javadoc otherwise it appears the only thing you can do with CSS is change blue/grey style!.

        Show
        Scott Reed added a comment - - edited Please document this in the class javadoc otherwise it appears the only thing you can do with CSS is change blue/grey style!.
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 1.4.18 [ 12316329 ]
        Fix Version/s 1.5-RC4 [ 12316330 ]
        Resolution Fixed [ 1 ]
        Ernesto Reinaldo Barreiro made changes -
        Field Original Value New Value
        Attachment ModalWindow.patch [ 12475994 ]
        Hide
        Ernesto Reinaldo Barreiro added a comment -

        patch to FIX the issue

        Show
        Ernesto Reinaldo Barreiro added a comment - patch to FIX the issue
        Ernesto Reinaldo Barreiro created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Ernesto Reinaldo Barreiro
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development