Announcement Announcement Module
Collapse
No announcement yet.
How to link a view/internal frame to a menu item? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to link a view/internal frame to a menu item?

    Hello

    I have a few questions about Views and Menu.

    I am using the JInternalFrames
    http://opensource.atlassian.com/proj.../browse/RCP-56

    1/ Are all views ALWAYS registered under the Show Views?

    2/ How could I add "views" (ie internal frames) to a menu?

    What am I doing wrong here:

    a) in my command-context.xml, I add a menu:

    Code:
    	<bean id="refDataMenu" 
    		class="org.springframework.richclient.command.CommandGroupFactoryBean">
    		<property name="members">
    			<list>
    				<ref bean="viewCurrencyCommand"/>
    			</list>
    		</property>
    	</bean>
    	
    	<bean id="viewCurrencyCommand" 
    		class="org.springframework.richclient.command.TargetableActionCommand">
    		<property name="commandExecutor">
    			<ref bean="currencyManagerView"/>
    		</property>
    	</bean>
    But I would like this commandExecutor to be an internal frame, ie a View.
    the currencyManagerView is a view BUT it also implements ActionCommandExecutor (the execute() method) and I thought it would be enough to link a "view" to a menu.

    Code:
    	<bean id="currencyManagerView"
    		class="org.springframework.richclient.application.support.DefaultViewDescriptor">
    		<property name="viewClass">
    			<value>net.objectlab.safemargin.gui.view.CurrencyManagerView</value>
    		</property>
    		<property name="viewProperties">
    			<map>
    				<entry key="referenceDataDao">
    					<ref bean="referenceDataDao"/>
    				</entry>
    			</map>
    		</property>
    	</bean>
    Also what should the execute do in order to add the view as an internal frame?

    I would greatly appreciate an example of how to create an internal frame (may be it does not need to be a 'view'?) and link it to a menu item...

    Many thanks!
    Regards from London!

    Benoit

  • #2
    hi,

    i also use the patch for multiple views. it's great!!!!! so now check out this one:
    your commands-contex.xml
    Code:
    <bean id="showYourView" class="org.springframework.richclient.command.support.ShowViewCommand">
    			<property name="viewDescriptor">
    				<ref bean="yourOverview"/>
    			</property>
    		</bean>
    the ShowViewCommand is the class which you need to display views. But you'll see when you use this solution there are problems with the labeling. I've posted this for a couple of days. http://forum.springframework.org/showthread.php?t=16951

    now i've tried this one, but it's a drawback, because i redefine my view again, no reuse.

    Code:
    <bean id="showLicenseOverview" class="org.springframework.richclient.command.support.ShowViewCommand">
    		<property name="viewDescriptor">
    			<bean id="overview" class="org.springframework.richclient.application.support.DefaultViewDescriptor">
    				<property name="viewClass">
    					<value>at.demolsky.lms.license.ui.LicenseOverview</value>
    				</property>
    			</bean>
    		</property>
    	</bean>
    trie this out. perhaps we find together a solution!!

    markus
    greetings AUSTRIA
    Last edited by robyn; May 15th, 2006, 05:51 PM.

    Comment


    • #3
      Should internal windows be views?

      Hi Markus,

      Thanks for your post! It works!

      I had a look at your problem and found a wierd workaround, check your original thread: http://forum.springframework.org/showthread.php?t=16951

      I guess we will have to dive into the Spring code for that one... unless someone found the issue and is kind enough to contribute a patch?

      By the way, should internal windows always be views? has anyone managed to create a "normal" window that does not automatically register with the views?

      Many thanks

      regards from London

      Benoit
      Last edited by robyn; May 15th, 2006, 05:50 PM.

      Comment


      • #4
        Hi again,

        i think it's a bug. because I've tried anything and it does not work. on this way i refer you to this post http://forum.springframework.org/showthread.php?t=16958

        I think it's also in your interest to set the size of your view. I still have found no solution. Perhaps you have a tip.

        markus
        Last edited by robyn; May 15th, 2006, 05:50 PM.

        Comment

        Working...
        X