Type ahead shows list

Hello,

What I would like to do is enter a name in a table cell and for a listener on the cell to get a list of names from the db and display them in a combo box.

I can display a combo box okay which is editable in a table cell but I cannot find a listener which listens to the text being entered.

Is there any solution to this at all?

Thanks in advance for any help.

Through a bit of lateral thinking I have come up with this sort of thing…

tablePeople.setTableFieldFactory(new DefaultFieldFactory() {
		    @Override
		    public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
		        if ("Person".equals(propertyId)) {

					final TextField tf = new TextField();
					tf.addListener(new TextChangeListener() {
						
						@Override
						public void textChange(TextChangeEvent event) {
							
							if (layerPeopleChooser == null){
								layerPeopleChooser = new VerticalLayout();
								mainLayout.addComponent(layerPeopleChooser, "top:50px;left:5.0px;");
							}else{
							}
							layerPeopleChooser.removeAllComponents();
							
							final Table t = new Table();

							t.addContainerProperty("Id", Long.class, null);
							t.addContainerProperty("Person", String.class, null);
							t.setSelectable(true);
							t.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);

							t.setHeight("100px");
							t.setWidth("200px");

							String name = event.getText();
							List<GpiPeople> people = gpi_db.findByName(name);
							t.removeAllItems();
							for (GpiPeople p : people) {
								Long id = p.getPplId();
								String pname = p.getPplSurname() + " " + p.getPplFirstname();
								t.addItem(new Object[] { id, pname }, t.getItemIds().size());
							}

							t.addListener(new ItemClickListener() {

								@Override
								public void itemClick(ItemClickEvent event) {
									Table table = (Table) event.getSource();
									Item item = table.getItem(event.getItemId());

									Property pId = item.getItemProperty("Id");
									Long id = (Long) pId.getValue();
									Property pName = item.getItemProperty("Person");
									String name = (String) pName.getValue();

									tf.setValue(name);
									mainLayout.removeComponent(layerPeopleChooser);
									layerPeopleChooser = null;
								}
							});
							layerPeopleChooser.addComponent(t);
						}
					});
					return tf;
		        }
            }

I thought I would share it.

I am new to Vaadin, I do not know if this sort of thing is good practice but it works for me! B)