Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vaadin 8.1 unable to set height for the Tree component #9629

Closed
Wnt opened this issue Jul 3, 2017 · 2 comments
Closed

Vaadin 8.1 unable to set height for the Tree component #9629

Wnt opened this issue Jul 3, 2017 · 2 comments
Milestone

Comments

@Wnt
Copy link
Contributor

Wnt commented Jul 3, 2017

Tree's setHeight methods have JavaDoc "This component's height is always set to be undefined. Calling this method will have no effect."

This makes it impossible for the developer to define where Tree's scrollbars are rendered to.

e.g. here I'd like to have the scrollbars on the bottom of the UI regardless of how many items I have in the Tree
screenshot from 2017-07-03 14-22-02

Online demo (takes a minute or two to boot up as it upgrades to latest snapshot on opening):
https://vaadinfiddle.com/editor/#!container/a5878bda19a3b90e20947fcfc09c8e3608ad93b23d77ab3fc2d9d897f3ed5808/src/main/java/org/vaadin/vaadinfiddle/MyUI.java

Demo project:
treegridheight.zip

Tested using Vaadin 8.1 SNAPSHOT vaadin-server-8.1-20170703.100423-235 & chromium browser on Linux

@Wnt
Copy link
Contributor Author

Wnt commented Jul 3, 2017

As a workaround one can extend Tree to override the non-working setHeight methods:

public class MyTree<T> extends Tree<T> {
	@Override
	public void setHeight(float height, Unit unit) {
		getCompositionRoot().setHeight(height, unit);
	}
	@Override
	public void setHeight(String height) {
		getCompositionRoot().setHeight(height);
	}
	@Override
	public void setHeightUndefined() {
		getCompositionRoot().setHeightUndefined();
	}
}

Wnt added a commit to Wnt/vaadin that referenced this issue Jul 3, 2017
@pinonpierre
Copy link

Thanks for the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants