Announcement Announcement Module
Collapse
No announcement yet.
ShowViewCommand in menu Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ShowViewCommand in menu

    I'm a real beginner with spring-richclient, so excuse me if it is a dummy question.

    I'm trying to add a menu entry to show a view. So far I have my view defined in "richclient-application-context.xml"
    Code:
        <bean id="scrutinView" 
            class="org.springframework.richclient.application.support.DefaultViewDescriptor">
            <property name="viewClass">
                <value>vota2.client.ScrutinView</value>
            </property>
        </bean>
    in commands-context.xml I defined the command and tried to reference it :
    Code:
        <bean
            id="showScrutinViewCommand"
            class="org.springframework.richclient.command.support.ShowViewCommand">
            <property
                name="viewDescriptor"
                ref="scrutinView" />
        </bean>
    
        <bean
            id="gestionOperationsMenu"
            class="org.springframework.richclient.command.CommandGroupFactoryBean">
            <property name="members">
                <list>
                    <ref bean="scrutinView" />
                </list>
            </property>
        </bean>
    When trying to run this, I get an error telling me that "ShowViewCommand" doesnt have a default constructor. So I guess that I might need to use the constructor that takes the ViewDescriptor and the ApplicationWindow.

    My question : how do I get this ApplicationWindow ? Or is there an easier way to do what I'm trying to do ?

    Thx for the help !

  • #2
    Hi Gehel,
    I'm guessing you're using the 0.3.0-SNAPSHOT version. Prior to this version there was a no-args constructor on ShowViewCommand but I recently removed it. The idea was to make the class more robust by ensuring that the viewDescriptor and applicationWindow properties were provided. BUT, I didn't realise that the applicationWindow was being provided by a BeanPostProcessor called ApplicationWindowSetter.

    My apologies for causing you this inconvenience. I've added the no-arg constructor back in and the class now implements InitializingBean to check for the required properties. If you update from subversion you should be able to carry on.

    Let me know if you have any problems.

    Cheers,
    Kevin

    Comment


    • #3
      Thanks a lot for the answer !

      I'll check what I can do tomorrow. Spring-richclient looks promising, but it is a bit hard to get a grip on everything ...

      Good luck for the project !

      Comment


      • #4
        I tried to udpdate from SVN, and now I get errors when I try to run "mvn install" :
        Results :
        Tests run: 381, Failures: 0, Errors: 1, Skipped: 0

        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] There are test failures.
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 20 seconds
        [INFO] Finished at: Tue Jan 16 14:50:18 CET 2007
        [INFO] Final Memory: 12M/22M
        [INFO] ------------------------------------------------------------------------
        The problem seems to be related to the org.springframework.richclient.config.DefaultAppli cationLifecycleAdvisorTests test :

        Running org.springframework.richclient.config.DefaultAppli cationLifecycleAdvisorTests
        Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.032 sec <<< FAILURE!
        Is the problem on my side ? I tried to do a "mvn clean", but I still have the problem after that. I will dive a bit more into the code and let you know if I find something ...

        Comment


        • #5
          I also found the same test failure and I've fixed it and checked in the changes. Try another SVN update and see how you get on.

          Comment


          • #6
            Yep, it works !

            Thanks a lot !

            Comment

            Working...
            X