Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
viewer-wicket-1.7.0
-
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
- relates to
-
CAUSEWAY-2337 [WON'T FIX] FacetFactories to be managed by Spring
- Closed