• ValuePicker Search - Enter in box triggers two AJAX events

    By Paul S Withers 1 decade ago

    I'm adding a MapPicker dataProvider to a Value Picker. By default it does a search that returns entries that start with the search key. I'm modifying it to return only the entries that contain the search key. The code to get the entries is working fine.

    However, pressing enter with the focus in the search box in Internet Explorer is triggering two AJAX requests, resulting in duplicate entries in the results.

    Can an event.preventDefault() be added in the onKeyPress for the search input box to prevent that?

    Alternatively, if there's any way in the readEntries() method to identify if a search has already been done or to intercept the content of the picker box to eliminate duplicates, I'm open to that. Currently, even though readEntries() only returns one element, because it's triggered twice, it returns two lots of one element and adds both lots into the results panel.

    • Pressing Enter in search box adds two lots of results for simpleValuePicker too

      By Paul S Withers 1 decade ago

      It looks like the problem is more widespread with the ValuePicker. Even with a simpleValuePicker dataProvider, I'm finding in IE9 that it's loading two copies of search results when you enter search criteria and press Enter.

      • Reproduced on 9.0 and 9.0.1...

        By Paul Hannan 1 decade ago

        Thanks Paul.

        I'm able to reproduce this on 9.0 and 9.0.1, and we're tracking this issue with 'PHAN9DNDGM'

    • Further Update,Reproducable in Demo Db

      By Paul S Withers 1 decade ago

      I can reproduce the problem with the demo database and IE9 (probably also other IE versions).

      On Value Pickers page, "US States coming from a custom bean", "Listbox with Single search value". Search for WA and press enter. Produces duplicate results. Search for WA and click the search button - single result set.

      Fine in Firefox.

      Looks like the form is submitting because it's a form with a single edit box, so need event.preventDefault() to make it work consistently.