I'm trying to configure toolbar commands (see this thread http://forum.springframework.org/showthread.php?t=17521) and I'm running into a dead end.
How can I access the beans defined in command-context.xml? I assumed that they would be available using the basic idiom:
However, that results in this exception:Code:CommandGroup group = (CommandGroup)Application.services().getBean("switchToViewCommandGroup");
I am defining the command like this:Code:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'switchToViewCommandGroup' is defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,lifecycleAdvisor,applicationDescriptor,applicationObjectConfigurer,applicationEventMulticaster,componentFactory, binderSelectionStrategy,lookAndFeelConfigurer,messageSource,imageResourcesFactory,imageSource,iconSource, formComponentInterceptorFactory,rulesSource,formPropertyFaceDescriptorSource,PhysicianTableView,OfficeLocationView,pdb]; root of BeanFactory hierarchy
So, how do I access the beans in this file? I can't quite decipher the code that initializes the menus and toolbar - it's very complicated. :shock:Code:<bean id="switchToPhysicianViewCommand" class="com.fhm.pdbm.ui.command.SwitchToViewCommand"> <property name="viewDescriptor"> <ref bean="PhysicianTableView" /> </property> </bean> <bean id="switchToOfficeLocationViewCommand" class="com.fhm.pdbm.ui.command.SwitchToViewCommand"> <property name="viewDescriptor"> <ref bean="OfficeLocationView" /> </property> </bean> <bean id="switchToViewCommandGroup" class="org.springframework.richclient.command.CommandGroup" factory-method="createExclusiveCommandGroup"> <constructor-arg> <list> <ref bean="switchToPhysicianViewCommand"/> <ref bean="switchToOfficeLocationViewCommand"/> </list> </constructor-arg> </bean>
Thanks,
Larry.


Reply With Quote