Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
ComboBox help
Hi all:
When selecting a row and press the Edit button , I need to see the default item in the table , but while loading it first appears white and then I can select the item pre loaded, appreciate your help.
The code is:
UsuarioDAO uDAO = new UsuarioDAO();
List<Usuario> c = uDAO.buscarPorId(id);
for (int i = 0; i < uDAO.buscarPorId(id).size(); i++) {
System.out.println("" + i);
System.out.println("NOMBRE" + c.get(i).getNombre());
txtNombre.setValue(c.get(i).getNombre());
txtApepat.setValue(c.get(i).getApepat());
txtApemat.setValue(c.get(i).getApemat());
txtFono.setValue(c.get(i).getFono());
txtCelular.setValue(c.get(i).getCelular());
comboCiudad.addItem(c.get(i).getCiudad().getNombre());
txtEstado.setValue(c.get(i).getEstado());
comboCiudad.setNewItemsAllowed(true);
comboCiudad.setImmediate(true);
}
I leave attached image of what I currently have .
Last updated on
The Answer is:
comboCiudad.setNewItemsAllowed(true);
comboCiudad.addItem(c.get(i).getCiudad().getNombre());
comboCiudad.setValue(c.get(i).getCiudad().getNombre());
Bye.
Last updated on
You cannot reply to this thread.