Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-996

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: viewer-wicket-1.7.0
    • Fix Version/s: 2.7.0
    • Component/s: Core: Viewer: Wicket
    • Labels:
      None

      Description

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: