AppFoundation 1.2 vs. 1.3.3

Hello all:

I recently got back to working with an application in Vaadin, and took the opportunity to upgrade to the latest versions of the Vaadin components (Vaadin 6.30 to 6.3.4 and AppFoundation 1.2 to 1.3.3).

In the application I am using the
attach()
method in my
AbstractView
classes to call
getApplication()
. This worked fine in AppFoundation 1.2. In 1.3.3, it appears that the
attach()
method is no longer being called (I’ve stepped through the code in the NetBeans debugger to verify). The
AbstractView
class in AppFoundation 1.3.3 introduces the
activate()
method, so I tried moving the
getApplication()
call there. Unfortunately, in
activate()
,
getApplication()
returns null.

Have I run into a bug, or is there another place where I can place a
getApplication()
call so it will behave the same as using it in the
attach()
method in AppFoundation 1.2?

Hi

Sounds weird. The
attach()
method is method in the AbstractComponent class in Vaadin, and it should be called every time when the object is being added to an application instance (for example, you have a layout in your main window and you add the component to the layout).

The
activated()
method is from the AppFoundation’s
View interface
. This method is called after the view has been activated through the ViewHandler. Even though the activated() gets called, it doesn’t mean it’s attached to an application, since that is the responsibility of the ViewContainer.

Anyway, attached()
should
be called, but apparently it isn’t (as you said). This indicates that the view isn’t actually added to a layout that is attached to the application. This is backed up by the fact that getApplication() returns null, which it does when the component isn’t attached to an application.

My guess is that this has something to do with the ViewContainer’s implementation, that it isn’t adding the view to the layout for some reason. Have you looked at
the release notes for version 1.3.2
? There were some changes related to AbstractView, namely, it was replaced with the View interface in regard to the ViewHandler (
see this link
for more details on why this was done). The AbstractView still exists and it implements the View interface, however, some changes to your ViewContainers are needed (see the release notes for upgrade instructions).

My recommendation is that you verify that your ViewContainers are working as expected, and if that doesn’t help, then we’ll have to investigate the problem further.

Hope this solves your problem.

  • Kim

I’ve come back to this and I now have everything working again. I reversed all the changes I had made for the new version of AppFoundation, and redid the process. I must not have updated my code properly before.

Thanks for the help.