0

I have a FormLayout with multiple logical rows. I'd like to be able to swap or remove rows on button click, or add a new row to the certain location in FormLayout. Is it possible with FormLayout? If so, could you please tell how?

Also, as far as I understand, the FormLayout doesn't have the real row concept. So, in case I'd like to remove the logical row, physically I should keep their object references somewhere in my application (not-Vaadin) memory in order to be able to access them?

alexanoid
  • 24,051
  • 54
  • 210
  • 410
  • The FormLayout is not made for what you are trying to do. You could try to achieve something like this with https://vaadin.com/docs/latest/components/virtual-list – Simon Martinelli Jul 28 '22 at 07:11
  • Thanks for your answer. How about the idea to play with `FormLayout` with something like `formLayout.getElement().insertChild(1, button.getElement());` where I may insert/remove components by indices and try to simulate such behavior? – alexanoid Jul 28 '22 at 11:38
  • 1
    In that case I would probably create a custom component and not use the FormLayout – Simon Martinelli Jul 28 '22 at 12:15
  • 1
    Or you could have a look a the CSS grid https://vaadin.com/directory/component/css-grid-layout – Simon Martinelli Jul 28 '22 at 12:16

0 Answers0