Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
CustomLayout problem with nesting divs
This is my layout
<div id="container">
<div location="UV0" id="UV0" class="column">
<div location="UVA" id="UVA" class="child"></div>
<div location="UVB" id="UVB" class="child"></div>
</div>
<div location="UV1" id="UV1" class="column"></div>
<div location="UV2" id="UV2" class="column"></div>
<div location="UV3" id="UV3" class="column"></div>
<div location="UV4" id="UV4" class="column"></div>
<div location="UV5" id="UV5" class="column"></div>
</div>
CSS
@import url(../reindeer/styles.css);
.v-label {
border: thin black solid;
}
#container {
padding-left: 0px;
height: 500px;
background: white
}
#container .column {
float: left;
height: 100%;
}
#container .child {
width: 50px;
height: 50px;
border: solid 1px #ccc;
}
#UV0 {
width: 15%;
}
* html #UV0 {
display: inline;
}
#UV1 {
width: 15%;
background: yellow;
}
#UV2 {
width: 15%;
}
#UV3 {
width: 15%;
}
#UV4 {
width: 15%;
}
#UV5 {
width: 15%;
}
* html body {
margin: 0;
padding: 0;
}
.UVA {
width: 50%;
backgroud: red;
}
.UVB {
width: 50%;
background: green;
}
JAVA
@Override
public void init() {
Window mainWindow = new Window("Elc Application");
CustomLayout layout = new CustomLayout("my-layout");
for (int i = 0; i < 6; i++) {
Label box = new Label(" ", Label.CONTENT_XHTML);
layout.addComponent(box, "UV" + i);
box.setHeight(100, Sizeable.UNITS_PERCENTAGE);
}
Label UVA = new Label(" ", Label.CONTENT_XHTML);
layout.addComponent(UVA, "UVA");
Label UVB = new Label(" ", Label.CONTENT_XHTML);
layout.addComponent(UVB, "UVB");
mainWindow.addComponent(layout);
setMainWindow(mainWindow);
setTheme("elctheme");
PROBLEM:
I want to nest UVA and UVB in UV0 maybe someone know the solution because i cant figure out what's wrong, and when I use the firebug it seems that addComponent is not adding UVA and UVB elements at all:
<div id="container">
<div id="UV0" class="column" location="UV0" style="">
<div class="v-label" style="height: 498px; width: 281px;">UV0</div>
</div>
<div id="UV1" class="column" location="UV1" style="">
<div id="UV2" class="column" location="UV2" style="">
<div id="UV3" class="column" location="UV3" style="">
<div id="UV4" class="column" location="UV4" style="">
<div id="UV5" class="column" location="UV5" style="">
</div>
Last updated on May, 8th 2012
You cannot reply to this thread.