[ 
https://issues.apache.org/jira/browse/ISIS-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15581730#comment-15581730
 ] 

Bilgin Ibryam commented on ISIS-996:
------------------------------------

For my custom footer I still had to use replace rather than add in order to 
make it work.

> Not possible to "replace" components in Wicket viewer (workaround is to use 
> "add")
> ----------------------------------------------------------------------------------
>
>                 Key: ISIS-996
>                 URL: https://issues.apache.org/jira/browse/ISIS-996
>             Project: Isis
>          Issue Type: Bug
>          Components: Core: Viewer: Wicket
>    Affects Versions: viewer-wicket-1.7.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.18.0
>
>
> As per http://isis.markmail.org/thread/x3k2www3m2wfsgtv
> To recreate:
> - copy ReferencePanelFactory to ReferencePanelFactory2
> in (subclass of) IsisWicketApplication, add:
> {code}
>     @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}
>         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
(v6.3.4#6332)

Reply via email to