Switching nested custom layouts

Hi folks,

I have a problem using multiple CustomLayouts that looks a bit like the issue mentioned in

“CustomLayout does not correctly remove”
or Ticket #1775.

I am using three CustomLayouts:

  • One outer layout for the main content (“main-layout”)
  • And two inner layouts (“content-1”, “content-2”).

Content-1 and Content-2 are nearly identical. The only difference is one location, that exists in content-2 and not in content-1.
When a user “navigates” from one view to another, I replace a certain location in “main-layout” with other instances of either “content-1” or “content-2”, using remove and add methods.

Every time when I switch from content-1 to content-2 or content-2 to content-1 I need to manually refresh the site displayed to actually see the new layout.

It seems to me like the Template is being “cached” somehow. I stepped through the server-side code until the repaint Methods in the CustomLayout class and everything seems fine (the template and the instance match the one I would expect). Also the other content inside the CustomLayouts is replaced correctly (as I said, content-1 and content-2 are mostly identical, so all identical locations are rendered correctly).

It seems like a problem with the template caching in the client side component. Can someone show me how to debug the gwt code? Can someone reproduce this problem?
Vaadin version is: 6.6.0.

Greets, Christian

There could well be a problem in CustomLayout, but I don’t have the time to test it now.

To debug GWT code, you need to run both the GWT development mode server and the server your Vaadin application runs on. In Eclipse, you can create a launch configuration for development mode in Project Properties… → Vaadin.

Then run both servers in debug mode, set breakpoints and use the URL parameter “?gwt.codesvr=localhost:9997”. The system should automatically suggest loading the correct GWT browser plugin if you don’t have it installed.

See also
the corresponding section in the book

Two components with same debugId caused this problem.