Hi, i cant get the SubWindow Scrollable.
I already read the doc, but cant fix this.
Here is my code:
The grid is dynamically filled with images
public class FileBrowserWindow extends Window {
private final ApplicationUI ui = (ApplicationUI) UI.getCurrent();
private GridLayout grid;
private Button uploadButton;
private Button cancelButton;
private String seletedItemPath;
public FileBrowserWindow() {
setWidth(800, Unit.PIXELS);
setHeight(600, Unit.PIXELS);
setResizable(false);
setClosable(false);
setCaption(ui.getLocalizedText("filebrowser.window.titel"));
layout();
}
private void layout() {
VerticalLayout content = new VerticalLayout();
content.addStyleName("subWindowContent");
content.setSizeUndefined();
HorizontalLayout buttonWrapper = new HorizontalLayout();
buttonWrapper.setHeight(40,Unit.PIXELS);
uploadButton = new Button("Datei hochladen");
cancelButton = new Button("Abbrechen");
buttonWrapper.addComponent(uploadButton);
buttonWrapper.addComponent(cancelButton);
content.addComponent(buttonWrapper);
grid = new GridLayout();
grid.setSpacing(true);
grid.setMargin(true);
grid.setColumns(4);
grid.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
grid.setImmediate(true);
content.addComponent(grid);
setContent(content);
}
public void updateContent(List<File> availableFiles) {
for(File file : availableFiles){
FileResource resource = new FileResource(file);
Image image = new Image(file.getName(),resource);
image.setHeight(150,Unit.PIXELS);
image.setWidth(150,Unit.PIXELS);
image.addClickListener(new MouseEvents.ClickListener() {
@Override public void click(MouseEvents.ClickEvent event)
{ Image component = (Image)event.getSource();
FileResource resource = (FileResource) component.getSource();
seletedItemPath =resource.getSourceFile().getPath(); close(); } });
getGrid().addComponent(image); } }
...
In the generated HTML the div has css with overflow hidden instead of auto
<div tabindex="0" class="v-scrollable" style="zoom: 1; position: relative;">
window-contents > .v-scrollable {
padding: 0;
overflow: hidden;
}
What do I need to change in Java to change this ?