here is my code


class UserMenuItems implements MenuItems {

        @Resource(name="manualService")
        private ManualService  manualService;
        
        
        List<Component> components ;
        
        
        //@PostConstruct
        void myInit(){
                components= new ArrayList<Component>();
                components.add (new UserGuidePanel());
                components.add (new OMBCircularPanel());
                components.add (new SendComments());
        }  
        
        @Override
        public List<Component> getComponents() {
                myInit();
                return components;
        }
        
                
        private abstract  class CustomPanel  extends  Panel implements 
IMarkupResourceStreamProvider{
                public CustomPanel() {
                        super(MenuItems.menuItemId);
                }
                public IResourceStream getMarkupResourceStream(MarkupContainer
container,Class<?> containerClass){
                        return new StringResourceStream(getMarkUp());
                }

                protected abstract String getMarkUp();
        }
        
        private  class UserGuidePanel   extends  CustomPanel {
                public UserGuidePanel() {
                        add(new Link("link"){
                                public void onClick() {
                                        
manualService.getManualBytes(UserContextHolder.getOrgAbbrev());
                                }
                        });
                }
                @Override
                protected String getMarkUp() {
                                        return """
                                        <wicket:panel>
                                                 # User Guide 
                                        </wicket:panel>
                                """;
                }
        }
        
}






now I got a new problem ,
this is a groovy file and when I call getComponents method I get this error 

Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
        ... 43 more
Caused by: java.lang.NoSuchMethodError:
gov.hhs.acf.web.util.UserMenuItems$CustomPanel: method <init>()V not found
        at
gov.hhs.acf.web.util.UserMenuItems$ArtmsUserGuidePanel.<init>(UserMenuItems.groovy)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200)
        at gov.hhs.acf.web.util.UserMenuItems.myInit(UserMenuItems.groovy:33)
        at gov.hhs.acf.web.util.UserMenuItems$myInit.callCurrent(Unknown Source)
        at
gov.hhs.acf.web.util.UserMenuItems.getComponents(UserMenuItems.groovy:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)
        at org.apache.wicket.proxy.$Proxy142.getComponents(Unknown Source)



I inject this bean  in my page and call getComponents method  and I end up
with the error above .I wont get this error if I make this a .java , please
tell me is it any different to write  a wicket component in groovy ?
   
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/instantiate-panels-in-a-spring-bean-tp2946859p2952922.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to