jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox remoteAutoComplete does not execute search when search string is cleared

This topic contains 4 replies, has 2 voices, and was last updated by  Marc 12 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • Marc
    Participant

    In a combo box with auto-complete if the user types a few characters and then erases them, the list reverts to its initial state. For instance, if ‘caf’ is entered in the Settings demo combo box with auto-complete enabled and then erased, the list will start with Affogato.

    In the remote auto-complete example, if ‘Lon’ is entered into the combo box and then erased, only entries beginning with ‘Lo’ will be displayed in the list. It appears that search is called when the character count goes from three to two, but not when it drops below two or when it returns to zero.

    Marc


    Peter Stoev
    Keymaster

    Hi Marc,

    Thank you for the feedback. There’s a setting which specifies that a search process begins when at least 2 characters are entered. There’s still no option for changing that built-in value, but we’ll add in the next version. In addition, if you would like you can also manually update the list with items:

     dataAdapter.dataBind();

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Marc
    Participant

    Thanks Peter, I understand that the incremental searches begin only after two characters are entered, but in this case characters are being deleted. When the combo box is being initialized it does a search with an empty search string. However, if the user clears the contents of the combo box (either by backspacing or selecting the content and deleting it) the list is not refreshed. In a normal auto-complete combo box, the list reverts to its initial content in this case.

    Marc


    Peter Stoev
    Keymaster

    Thank for the feedback. We’ll revise the widget’s behavior in the future versions.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Marc
    Participant

    Thanks Peter, I seem to have worked around this issue by using jquery to get the contained input element (as illustrated in one of your other replies on this forum) and binding to the keyup event. If the length of the value in the input field in the handler is zero then I call clearSelection and set the searchString to null before invoking dataBind.

    In the same handler, I am also detecting if the user presses the Enter key and capturing the content of the input box so the user can enter a value in the combo box which is not one of the selections in the list (similar to how the comboBox on the Google search page works). It would be nice if there was an option (e.g., enterEnabled) which would result in an event being generated when the user pressed the Enter key, with the text content of the input box being made available to the event handler.

    On a separate note, the searchString property is not documented on the comboBox API page.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.