Problem with nested AbsoluteLayouts

Hi!

I’m having a problem in my program when putting several absolutelayouts inside each other. I want to place some pictures X on my background in specific positions and after that some other pictures Y inside the X-pictures.

Here is example code of what does not work, I don’t know if its a bug or do I do something wrong? The java-file is also included as an attachment

Thank you, Sara


package com.example.bugtestproject;

import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings(“serial”)
@Theme(“bugtestproject”)
public class BugtestprojectUI extends UI {

@Override
// THIS WORKS
/*protected void init(VaadinRequest request) {
    
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setWidth("500px");
    layout.setHeight("500px");
    
    setContent(layout);
    
    VerticalLayout velo = new VerticalLayout();
    velo.setWidth("200px");
    velo.setHeight("200px");

    AbsoluteLayout ablo = new AbsoluteLayout();
    ablo.setWidth("100px");
    ablo.setHeight("100px");
    
    ablo.addComponent(new Label("hello!"), "top:10px; left:10px;");
    velo.addComponent(ablo);
    layout.addComponent(velo);
}*/


// THIS DOESN'T WORK
protected void init(VaadinRequest request) {
    
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setWidth("500px");
    layout.setHeight("500px");
    
    setContent(layout);

    AbsoluteLayout ablo = new AbsoluteLayout();
    ablo.setWidth("200px");
    ablo.setHeight("200px");
    
    AbsoluteLayout ablo2 = new AbsoluteLayout();
    ablo2.setWidth("100px");
    ablo.setHeight("100px");
    
    ablo2.addComponent(new Label("hello!"), "top:10px; left:10px;");
    ablo.addComponent(ablo2, "top: 0px; left: 0px;");
    layout.addComponent(ablo);
}

}
13364.java (1.6 KB)

Hi,

seems to me this is a bug in vaadin. Would you please create a ticket for it at
http://dev.vaadin.com
and also include the code for your ‘not working’ example. Thanks!