Directory

← Back

AddRowButton Add-on

Add-on encapsulating Add row to Grid - Edit - Delete by Cancel sequence in extended Button

Author

Rating

Popularity

<100

Vaadin 7 Grid does not yet have editor event. This is a small short coming if you want to create button to add a row to your grid with the following logic

  1. Click button to add a row
  2. Activate editor on the new row
  3. Delete row if user selected to click cancel instead of save

Hence I wrote this experimental add-on, which encapsulates needed logic in form of extended Vaadin Button.

Notes

  • Works currently only with BeanItemContainer
  • Uses threads, hence Push needs to be enabled
  • Beans used with AddRowButton must have default constructor without parameters in order to intanstiate
  • Doesn't work with Vaadin 7.6.1 - 7.6.2 due layout bug in Editor
  • Doesn't work with Vaadin 7.5.4 and older due bug Grid row book keeping

Status of this utility is experimental. I hope this is also useful demo case how to work with Vaadin using threads.

Usage:

Setup the Grid first.

Usage

  • Create new AddRowButton using its constructor.

AddRowButton button = new AddRowButton(String caption, Grid grid,Class<?> MyBean.class);

caption: the caption of the button MyBean: the beantype of your bean grid: the grid you use this utility with

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2016-02-24
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.5+
Browser
Browser Independent

AddRowButton Add-on - Vaadin Add-on Directory

Add-on encapsulating Add row to Grid - Edit - Delete by Cancel sequence in extended Button AddRowButton Add-on - Vaadin Add-on Directory
Vaadin 7 Grid does not yet have editor event. This is a small short coming if you want to create button to add a row to your grid with the following logic 1. Click button to add a row 2. Activate editor on the new row 3. Delete row if user selected to click cancel instead of save Hence I wrote this experimental add-on, which encapsulates needed logic in form of extended Vaadin Button. Notes * Works currently only with BeanItemContainer * Uses threads, hence Push needs to be enabled * Beans used with AddRowButton must have default constructor without parameters in order to intanstiate * Doesn't work with Vaadin 7.6.1 - 7.6.2 due layout bug in Editor * Doesn't work with Vaadin 7.5.4 and older due bug Grid row book keeping Status of this utility is experimental. I hope this is also useful demo case how to work with Vaadin using threads. ### Usage: Setup the Grid first. Usage - Create new AddRowButton using its constructor. AddRowButton button = new AddRowButton(String caption, Grid grid,Class MyBean.class); caption: the caption of the button MyBean: the beantype of your bean grid: the grid you use this utility with
Online