Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-996

[WON'T FIX] Define component factories as Spring @Components

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • viewer-wicket-1.7.0
    • 2.0.0-M4
    • Viewer Wicket
    • None

    Description

      was previously:

      Not possible to "replace" components in Wicket viewer (workaround is to use "add")

      ~~~~~

      As per http://isis.markmail.org/thread/x3k2www3m2wfsgtv

      To recreate:

      • copy ReferencePanelFactory to ReferencePanelFactory2

      in (subclass of) IsisWicketApplication, add:

          @com.google.inject.Singleton
          public static class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
      
              @Override
              public void addComponentFactories(ComponentFactoryList componentFactories) {
                  super.addComponentFactories(componentFactories);
                  componentFactories.replace(new ReferencePanelFactory2());
              }
          }
      

      and

              final Module overrides = new AbstractModule() {
                  @Override
                  protected void configure() {
                       ...
                      bind(ComponentFactoryRegistrar.class).
                          to(MyComponentFactoryRegistrar.class);
                  }
              };
      

      the issue is that "replace" ends up replacing all component factories of type ComponentType.SCALAR_NAME_AND_VALUE, whereas it should instead just replace the one for ReferencePanelFactory.

      The workaround is easy enough: call "add" (which puts new factory at beginning of list) rather than "replace".

      Attachments

        Issue Links

          Activity

            People

              hobrom Andi Huber
              danhaywood Daniel Keir Haywood
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: