I cannot locate any example in the Book of Vaadin 8, nor after many hours of google search which sheds some light on how to place the grid and form horizontally in a Spring Vaading app.
can you share a bit of code of how you’re trying to do it, and what’s your problem with your current solution? Spring really shouldn’t make a difference at all in layouting.
You can simply use HorizontalLayout (which then houses two components: the Grid and the Form), to achieve the effect of https://vaadin.com/docs/-/part/framework/tutorial.html . The usage of HorizontalLayout comes regardless of using Spring or not. Just don’t forget to set the width of HorizontalLayout to 100%.
You don’t have to use any Form or any html to create a simple form. Just get the ideas from the following code:
final Grid grid = new Grid();
final FormLayout form = new FormLayout();
form.addComponent(new TextField("Name"));
form.addComponent(new TextField("Surname"));
form.addComponent(new TextField("Age"));
final HorizontalLayout mainLayout = new HorizontalLayout(grid, form);
mainLayout.setWidth("100%");
Note that FormLayout has no connection to html forms whatsoever, it does not handle any form POST or something, it’s just a way to lay out components as shown here: https://vaadin.com/book/vaadin6/-/page/layout.components.formlayout.html
If you have no idea where to put this code, I suggest you start slowly, don’t use Spring Boot but instead use https://vaadin.com/maven , play around in the MyUI.java class and when you start feeling at home, then try to implement forms.
Hi Martin, in the wonderful example you shared with me, the individual form elements are added under one common identifier “form” thus it becomes possible to reference all the form fields by that one common identifier in the layout. But in the Spring example the form elements are not referenced under a common identifier, thus there is no way to group them and then place them in a group as a form – as in the following tutorial:
https://vaadin.com/blog/-/blogs/building-a-web-ui-for-mysql-databases-in-plain-java-