You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Andi Huber (Jira)" <ji...@apache.org> on 2020/10/04 07:32:00 UTC
[jira] [Updated] (ISIS-996) Define component factories as Spring
@Components
[ https://issues.apache.org/jira/browse/ISIS-996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andi Huber updated ISIS-996:
----------------------------
Fix Version/s: (was: 2.0.0-M4)
2.0.0-M5
> Define component factories as Spring @Components
> ------------------------------------------------
>
> Key: ISIS-996
> URL: https://issues.apache.org/jira/browse/ISIS-996
> Project: Isis
> Issue Type: Improvement
> Components: Isis Viewer Wicket
> Affects Versions: viewer-wicket-1.7.0
> Reporter: Daniel Keir Haywood
> Assignee: Andi Huber
> Priority: Major
> Fix For: 2.0.0-M5
>
>
> 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:
> {code:java}
> @com.google.inject.Singleton
> public static class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
> @Override
> public void addComponentFactories(ComponentFactoryList componentFactories) {
> super.addComponentFactories(componentFactories);
> componentFactories.replace(new ReferencePanelFactory2());
> }
> }
> {code}
> and
> {code:java}
> final Module overrides = new AbstractModule() {
> @Override
> protected void configure() {
> ...
> bind(ComponentFactoryRegistrar.class).
> to(MyComponentFactoryRegistrar.class);
> }
> };
> {code}
> 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".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)