Grid -> Inline editing of int field?

Hi,

I’ve got a simple Pojo class with some String and int fields that should be displayed in a Grid Element.
Now i would like to enable inline Editing with the Grid but I’m facing problems with setting up a suitable Binding/EditorComponent for the int Colums.
Is there any example for this or can anyone give me a hint?

Hi,

how about
IntegerField
from Viritin + component column from 8.1?

-Olli

Hi,

thanks a lot, i managed to fix my Problem though I used a different approach.
Works fine now.

Good to hear! Just curious - what was your solution?

I used a Binder as sugested in many examples…
The Trick was to use a StringToIntConverter when binding.

Here’s some code:

Binder<Position> binder = positionGrid.getEditor().getBinder();
StringToIntegerConverter stringToIntConverter = new StringToIntegerConverter("Enter a number!");
Binding<Position, Integer> bindingPosNr = binder.forField(textFieldPositionNr).withConverter(stringToIntConverter).bind(Position::getPositionNr, Position::setPositionNr);

Yeah, that’ll work :slight_smile: