Weird issues with layouts

I’m having some odd things going on with putting a layout inside a layout.


I have a blog-like application. The title of the blog is a label with a button next to it to edit the title. When the user clicks the title, it hides the label and makes visible the text field. All of this is inside a HorizontalLayout.

This works fine.

The Problem:

I have made the “Article” object the parent class for different types of pages. In one case, I want to use the same framework to edit the Contacts in the Address Book. So I’ve set the Base Class (AbstractPage) to create the TextField. If the child class wants to create a different edit component, it can override this method.

Since the label is TITLE + FIRST NAME + LAST NAME that works fine for display. So when I edit, I have a specific TextField for each portion of the name. These are inside another HorizontalLaout.

The problem is that adding the second HL inside the first, and trying to make it visible, even if I set Immediate=TRUE doesn’t display the previously hidden HL.

There is quite a bit of code so I can’t easily paste a sample here.

The basic flow for the problem is this:

  1. Create parent HL - with Label, Hidden Editing Component and edit button
  2. User clicks edit button, second “cancel” button made visible and the editing component, the label is made invisible
  3. The user clicks “Save” and the contents of the edited text are copied to the label and the edit fields made invisible, and the label is made visible.

When I use a TextField in the parent HL, all works fine. As soon as I replace the TextField with another HL containing the relevant TextFields, no luck.

Any ideas or suggestions welcome.

Note: I am using Vaddin 6.7