Results 1 to 5 of 5

Thread: Toggle button on toolbar

  1. #1

    Default Toggle button on toolbar

    I create the toolbar in the common way in "commands.xml" application context file:
    Code:
    <bean id="toolBar" class="org.springframework.richclient.command.CommandGroupFactoryBean">
    		<property name="members">
    			<list>
    				<ref bean="newXXXXCommand" />
    				<value>deleteCommand</value>
    				<value>searchCommand</value>
    			</list>
    		</property>
    	</bean>
    Where "searchCommand" is a GlobalCommand id. In my view I associate this command with a custom class extending "ActionCommand".

    I want to activate/desactivate the search view mode using a toggle button associated with the searchCommand, is it possible??

    Thanks

  2. #2
    Join Date
    Feb 2006
    Posts
    118

    Default

    What exactly do you mean by a GlobalCommand id? Is the search command defined in the richclient-application-context.xml, or in commands-context.xml?

  3. #3

    Default

    I define the following bean in my commands-context.xml

    Code:
    <bean id="windowCommandManager" class="org.springframework.richclient.application.support.ApplicationWindowCommandManager">
    	<property name="sharedCommandIds">
    		<list>
    			<value>deleteCommand</value>
    			<value>propertiesCommand</value>
    			<value>searchCommand</value>
    		</list>
    	</property>
    </bean>
    Later, programatically I override the following method from my view.
    Code:
    @Override
    protected void registerLocalCommandExecutors(PageComponentContext context) {
    	context.register(GlobalCommandIds.DELETE, deleteExecutor);
    	context.register(GlobalCommandIds.PROPERTIES, propertiesExecutor);
    	context.register(MyProjectGlobalCommandIds.SEARCH, searchXXXXXCommand);
    }

  4. #4
    Join Date
    Feb 2006
    Posts
    118

    Default

    Ah, I see. The trick is to extend ToggleCommand rather than AbstractCommand.

  5. #5

    Default

    Thanks, this works fine!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •