Announcement Announcement Module
Collapse
No announcement yet.
How to open all tab views when application starts up using the TabbedApplicationPage? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to open all tab views when application starts up using the TabbedApplicationPage?

    I'm using TabbedApplicationPage and it works well, but I'd like to have all of the views opened when the app starts up. Does anyone know of a way to have all of the views opened in tabs when the app starts up as opposed to opening them one-by-one with the Show View command ?

  • #2
    Hello,

    maybe the following can help you out.

    <bean id="petclinicLifecycleAdvisor" class="...PetClinicLifecycleAdvisor">
    <property name="windowCommandBarDefinitions">
    ...
    <property name="startingPageId">
    <value>multipleViewsPageDescriptor</value>
    </property>
    </bean>

    <bean id="multipleViewsPageDescriptor" class="org.springframework.richclient.application. mdi.DesktopPageDescriptor">
    <property name="viewDescriptors">
    <list>
    <value>ownerManagerView</value>
    <value>vetManagerView</value>
    ....
    </list>

    </property>
    </bean>

    Comment


    • #3
      tab activation

      Talking about tab dialogs, anyone know how to detect when a tab is becoming active? Is there anything like a method to override or an event to listen to in Spring RC that would detect that?

      Many thanks

      Benoit

      Comment


      • #4
        tab activation

        You can register a PageComponentListener to an ApplicationPage. It's callbacks give you information about the visual state of the PageComponents in an ApplicationPage and thus the tabs in a TabbedApplicationPage.

        hope that helps

        Comment


        • #5
          My hacky solution

          How do I get the actual instance of the TabbedApplicationPage when all that is supplied initially is the TabbedApplicationPageFactory class? I know the framework must call this factory to get the instance at some point, but I don't feel like searching through the source to figure out where just yet.


          I was able to accomplish the opening of all tabs, but in a very hacky manner.


          To make it work, I added these lines to the onWindowOpened() method in the LifeCycleAdvisor:

          window.getPage().showView("view1");
          window.getPage().showView("viewForTab2");
          window.getPage().showView("viewForTab3");
          window.getPage().showView("viewForTab4");

          The problem with this is that onWindowOpened() method is only called after the window has been made visible, so you can see the tabs being created after the app starts up. This is not a huge problem, but it looks a little weird. In the lifecycle advisor, window.getPage() seems to return null before the window is actually visible.

          My hack is working, so I'm happy. Users will be able to see all tabs when the app starts up.

          Comment

          Working...
          X