Search in sources :

Example 1 with TextChangeEvent

use of com.vaadin.event.FieldEvents.TextChangeEvent in project Activiti by Activiti.

the class SelectUsersPopupWindow method initSearchField.

protected void initSearchField() {
    HorizontalLayout searchLayout = new HorizontalLayout();
    searchLayout.setSpacing(true);
    addComponent(searchLayout);
    // textfield
    searchField = new TextField();
    searchField.setInputPrompt(i18nManager.getMessage(Messages.PEOPLE_SEARCH));
    searchField.setWidth(180, UNITS_PIXELS);
    searchField.focus();
    searchField.setTextChangeEventMode(TextChangeEventMode.EAGER);
    searchLayout.addComponent(searchField);
    // Logic to change table according to input
    searchField.addListener(new TextChangeListener() {

        public void textChange(TextChangeEvent event) {
            searchPeople(event.getText());
        }
    });
    initSelectMyselfButton(searchLayout);
}
Also used : TextChangeEvent(com.vaadin.event.FieldEvents.TextChangeEvent) TextField(com.vaadin.ui.TextField) TextChangeListener(com.vaadin.event.FieldEvents.TextChangeListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

TextChangeEvent (com.vaadin.event.FieldEvents.TextChangeEvent)1 TextChangeListener (com.vaadin.event.FieldEvents.TextChangeListener)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 TextField (com.vaadin.ui.TextField)1