Why there is no LongFIeld Component?

There is IntegerField(for Integer Type), NumberField(For Double Type), TextField(for String Type), BigDecimalField(For BigDecimal Type),
but there is no LongField. Why?

I am using automatic bind, by property names from Object Class:

	@Entity(name = "Ven_Pedido")
	public class Pedido {
		@NotNull
		@Column( name = "id_Pedido",nullable = false )
		@Id
		@GeneratedValue(strategy = GenerationType.IDENTITY)
		private Integer idPedido;

		@Column( name = "Id_venpedidoext",nullable = false )
		private Long idVenpedidoext;
		//...
	}	

	public class PedidoForm extends FormLayout  {
		IntegerField idPedido 			= new IntegerField("Id. Pedido");
		//There is no :(
		LongField idVenpedidoext 	= new LongField("Id. Ped. Ext");
		//...
		Binder<Pedido> binder = new BeanValidationBinder<>(Pedido.class);
		public PedidoForm() {

			binder.bindInstanceFields(this);
		//...
	}

If I use IntegerField ou NumberField I receive this error:

Property type ‘java.lang.Long’ doesn’t match the field type ‘java.lang.Integer’. Binding should be configured manually using converter.

I would like to use automatic Binder “binder.bindInstanceFields(this)”, without use converter.

Is there some approach to solve this?

Thanks for attention

}

The @Matti Tahvonen answer my question in other place.
See my question in: https://vaadin.com/learn/training/v14-forms

The approach was use a TextField with a converter like this:

TextField txtIdVenpedidoext 	= new TextField("Id. Ped. Ext");
...
binder.forField(txtIdVenpedidoext)
			.withNullRepresentation("")
			.withConverter( new StringToLongConverter("Informe um número")).bind("idVenpedidoext");

But i hope the Vaadin Team, implement a LongField in the future versions. :slight_smile:

Thanks!

Weles…bom dia…poderia me ajudar? Não sei se é parecido com seu caso…mas de uma olhada por favor

https://vaadin.com/forum/thread/18512297/create-method-to-generate-id