Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3314

Allow any Component to be a "Panel" or "Fragment" via configuration

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-M3
    • 1.5-RC1
    • wicket
    • None

    Description

      currently every component that requires the markup to be in an
      associated file must be derived from Panel. Every component that want
      it's markup "inline" must be derived from Fragment. I've changed that
      and moved the respective source code into something I called markup
      sourcing strategy. I'm not sure it's the best name, so feel free to
      suggest other names. Such a strategy can be provided to any component
      via

      public IMarkupSourcingStrategy getMarkupSourcingStrategy();

      Obviously it makes sense that only one strategy can be associated with
      any component. Each strategy has its own implementations to provide
      the correct markup, handle the header contribution, necessary changes
      to the open tag and it renders the component body appropriately.

      Changing a FormComponent to a FormComponentPanel is now as simple as
      subclassing getMarkupSourcingStrategy(). And it easily be changed to
      become a "FormComponentFragment"

      I've attached a patch (draft) against 1.5 trunk which successfully
      passes all tests in core. I wonder what you think about the idea.

      -Juergen

      Attachments

        1. wicket-panel.patch
          66 kB
          Juegen Donnerstag

        Activity

          People

            jdonnerstag Juegen Donnerstag
            jdonnerstag Juegen Donnerstag
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: