[CLOSED] Combobox with forceselection allow null

  1. #1

    [CLOSED] Combobox with forceselection allow null

    Dear Support,

    Are there any property or method that could force the combobox to select the last selected item when it is empty?

    Thanks.
    Last edited by fabricio.murta; Oct 14, 2016 at 8:05 PM.
  2. #2
    Hello @kwcitadmin!

    You can use the change listener to revert to last selection if value is empty! But notice the change event will trigger as soon as the text matches one or none value. Another good pick is to revert to last selected value on the blur event (when the combo box loses focus). So the user can type whatever he wants and the selected value is only enforced once the user moves on to next field.

    There's also the keypress event but it probably wouldn't trigger if the user clicks the combo field's 'clear' button and special treatment for this case might be taken.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks fabricio.murta,

    I have add the following blur handler in the combobox, you could close the case.
    Thanks.

    var blurHandler = function(cbx){
      if(cbx.selection == null)
        cbx.select(cbx.lastSelectedRecords[0]);
    };
  4. #4
    Hello @kwcitadmin!

    Glad you could find a solution that fits your needs! Thanks for sharing!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] ComboBox ForceSelection with Store Data vs DataSource
    By tylert in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 31, 2014, 4:10 PM
  2. [OPEN] [#136] ComboBox ForceSelection problem
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 15
    Last Post: May 15, 2014, 5:13 AM
  3. Combobox with forceselection and loadRecord
    By nukarsoft in forum 2.x Help
    Replies: 0
    Last Post: Jan 07, 2013, 2:38 PM
  4. [CLOSED] ComboBox ForceSelection=False and Change Event
    By Steve in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 13, 2009, 2:48 AM
  5. [CLOSED] What does ForceSelection do in ComboBox?
    By harafeh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 16, 2009, 1:48 PM

Tags for this Thread

Posting Permissions