Hybrid View

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Location
    Earth
    Posts
    243
    Vote Rating
    1
    nbuesing is on a distinguished road

      0  

    Default can unselect text from combobox where allow blank is false

    can unselect text from combobox where allow blank is false


    GXT 3.0.2
    Internet Explorer 8
    Windows 7 : 64 bit

    If I create a combo box where "allow blank" is false, a blank entry is not available in the drop-down selection (as expected). However, if I type quickly enough, I can blank out text, tab out of cell, and the cell would be blank.

    I was expecting that the combo box would revert back to the previous value. Especially since "Force Selection" is also true. Blank is not a selection, so it cannot be a "forced" selection (it isn't any selection).

    In provided test code, select a value. Then do a select all of the text and do "delete" and then "tab" as quickly as possible. The combo box will be left w/out a selection.

    Code:
    		comboBox.setAllowBlank(false);
    		comboBox.setSelectOnFocus(true);
    		comboBox.setEditable(true);
    		comboBox.setTypeAhead(true);
    		comboBox.setForceSelection(true);
    		comboBox.setAutoValidate(false);
    		comboBox.setMinChars(1);
    		comboBox.setTypeAheadDelay(0);
    		comboBox.setQueryDelay(0);
    		comboBox.setTriggerAction(TriggerAction.ALL);
    		comboBox.setValidateOnBlur(false);
    ComboBoxIssue_AllowBlankFalse.zip

  2. #2
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Location
    Earth
    Posts
    243
    Vote Rating
    1
    nbuesing is on a distinguished road

      0  

    Default


    if I type "b" and tab prior to the type ahead / force selection works, I can also get a blank entry.

    A similar issue is that I want to be able to turn off "type ahead", but would like force selection to still apply causing the first item that matches what is typed to be selected (and fire the select event prior to blurring). Unfortunately, I have scenarios where user can leave combo box w/out the selection event firing.

    I am looking into alternate ways to get my invariants to remain invariant, but right now I get into an invalid state, since the selection even does fire on one combo box as the user navigates to the next.

    I have tried to add in onblur events, but at that time, if the user has partially typed something w/out forcing a selection (or with type ahead) the selected value is NULL.

    I will be trying to create a more proper scenario on this issue and reporting it as a defect; provided I can express it better than in this response.

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,241
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    With
    Code:
    combo.setValidateOnBlur(false);
    validation does not run on blur. Therefore, the allow blank validation does not run. When I comment out that line in your example validation works as expected.

    Does this solve your issue?

  4. #4
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Location
    Earth
    Posts
    243
    Vote Rating
    1
    nbuesing is on a distinguished road

      0  

    Default


    No, this still allows for a blank entry, it just says it isn't valid.

    I want to prevent a blank entry, which is what I would expect with "allowBlank=false".

    Also, we are not using your validation in our application, so I wouldn't want the validation icon and decorations to show, either. We want a combo-box that once a valid is entered, it cannot be undone.

    We have combo boxes that affect the behavior of other combo boxes. Once we trigger a change in one combo box it triggers changes in the others. By making it not allow blanks, we don't have to worry about "resetting" the UI back to the initial state. There are also other usability issues to why we want allowBlank=false to prevent (and not just give a validation).

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,639
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    The allowBlank property isn't designed to say 'this field may under no conditions be blank' - that would result in (for example) un-clearable NumberField, TextField, etc, instead of reporting an issue to the user.

    Typically, the setEditable method is used to restrict the use from entering any keys at all, but using the drop down instead, but it sounds as though you want to a) let them type whatever they want, then b) if the value doesn't match exactly to a value in the dropdown, restore the previous value to the combo? This is a little further from the default functionality of the ComboBox than can be built just by config options.

    I might start with setEditable(false) and a key handler, and either invoke doQuery with each accepted key, or just select the first item in the store that matches the current input. Track and display inputs by directly modifying the contents of the ComboBox.getInputEl(), and use the provided text selection methods to manage which chars are selected. Alternatively, leave it editable, but .preventDefault() any key event which doesn't match existing items.

    Another approach could be to list for valuechange/select/invalid, and replace the value with an earlier one. Here you may need to defer the setValue call, since it might be in the middle of a re-render, or about to perform one.

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar