HI i am stuck with a customlayout problem.
I defined a html, css and then use div tag to embed my button.
I would expect the button to appear, but what i got is just the button text (not the button itself).
what have i done wrong? dont understand how a simple code like the below can go wrong (or either i must be very stupid)
main java class
package com.example.myapp;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Runo;
import com.vaadin.ui.*;
/**
* The Application's "main" class
*/
@SuppressWarnings("serial")
public class MyVaadinApplication extends Application
{
private Window window;
@Override
public void init()
{
window = new Window("My Vaadin Application");
CustomLayout custom = new CustomLayout("mylayout");
custom.addStyleName("styles");
window.setContent(custom);
setMainWindow(window);
setTheme("Runo");
Button button = new Button("Click Me4");
custom.addComponent(button, "uploader");
button.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
window.addComponent(new Label("Thank you for clicking"));
}
});
}
Might it be that it is some kind of sizing problem? That the components are there but they are not just visible.
Try defining some sizes to test it out
window.setSizeFull();
custom.setSizeFull();
Also, use Chrome Inspector, Firebug for Firefox, or Developer Tools for Internet Explorer to check the elements and see if the componts are in the html tree.
Then, if it still doesn’t work, add ?debug at the end of your url in the browser and click the Analyze Layouts (AL) button to see if it gives you some feedback.
Good suggestion Jens!
I did the Firebug thing. I manage to find the button caption. So it does suggest vaadin did replace the location tag with the button itself.
Still lost me how come the button refuses to “popup.”