Navigate tabs with Spring

Hi guys,

I am currently using Vaadin 6.8.2 and Spring framework 3.1 for my web application development.
In my project, I commonly use CustomComponent for my UI. Also, I make it as a bean in Spring Container.

For example, I have a WoSummaryComponent which extends CustomComponent. In WoSummaryComponent, there is a tabsheet (named as tsCase). In the tabsheet, it includes two tabs (named as phoneComponent and addressComponent). They both extend CustomComponent.

Actually, phoneComponent and addressComponent are injected into WoSummaryComponent. phoneComponent and addressComponent also are beans in Spring Container. Please kindly see the following codes.

public class WoSummaryComponent extends CustomComponent implements Serializable{
        //Spring Injection and setter code here...
        private PhoneComponent phoneComponent;
        private AddressComponent addressComponent;
        //Vaadin Auto Generated Code here...
        @AutoGenerated
        private TabSheet tsCase;
        public CallqCaseSummaryComponent() {
                buildMainLayout();
                setCompositionRoot(mainLayout);
        }
        public initComponent(Long id){
                //Phone tab
                tsCase.addTab(phoneComponent);
                tsCase.getTab(phoneComponent).setCaption("Phone");

                //Address tab
                tsCase.addTab(addressComponent);
                tsCase.getTab(addressComponent).setCaption("Address");
        }
}

Both phoneComponent and addressComponent have a table. There is a dynamically-created button (icon) in both table.
When I click the button (e.g. home icon) in phoneComponent’s table, its corresponding address record will be highlighted in addressCompoent’s table and the addressComponent tab will be focused.

In contrast, when I click the button (e.g. phone icon) in addressComponent’s table, its corresponding phone record will be highligted in phoneCompoent’s table and the phoneComponent tab will be focused.

There is a business logic that each phone is linked to an address.

My problem are that

  1. In spring DI concept, it is not allowed to let addressComponent inject phoneCompoent while phoneComponent inject addressComponent. However, the above situation or implementation will violate the Spring DI concept. Do you have any idea to implement.

  2. How can WoSummaryComponent know which the buttons being clicked in either addressComponent’s table or phoneCompoent’s table and then which tab should be focused and which record should be highlighted.

Please kindly see the attachment

Thanks.
12923.bmp (373 KB)