1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    57
    Vote Rating
    1
    MickeyMiner is on a distinguished road

      0  

    Default Unanswered: SimpleComboBox setForceSelection(false) not working

    Unanswered: SimpleComboBox setForceSelection(false) not working


    Hi,

    I have a SimpleComboBox with some predefined values. The ComboBox should not be limited to these values, but after I type "Senator" and leave the combobox, the value is set to null...

    Thank you!

    mm

    Code:
    public class TestCase implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
    
            SimpleComboBox<String> comboTitle = new SimpleComboBox<String>(
                    new StringLabelProvider<String>());
            comboTitle.setTriggerAction(TriggerAction.ALL);
            comboTitle.setEditable(true);
            comboTitle.setAllowBlank(false);
            comboTitle.setForceSelection(false);
            comboTitle.add("Dr.");
            comboTitle.add("Prof.");
            comboTitle.add("Dipl.Ing.");
    
            VerticalLayoutContainer p = new VerticalLayoutContainer();
            p.add(new FieldLabel(new TextField(), "Name"), new VerticalLayoutData(1, -1));
            p.add(new FieldLabel(comboTitle, "Title"), new VerticalLayoutData(1, -1));
            p.add(new FieldLabel(new TextField(), "Address"), new VerticalLayoutData(1, -1));
    
            FormPanel f = new FormPanel();
            f.setWidth(350);
            f.add(p);
    
            RootPanel.get().add(f);
        }
    }

  2. #2
    Sencha User
    Join Date
    Dec 2007
    Posts
    57
    Vote Rating
    1
    MickeyMiner is on a distinguished road

      0  

    Default


    Hi,

    I kindly ask for an answer. Is this a bug, or am I doing something wrong?
    I can not type any new values into my SimpleComboBox.

    I have tried to catch the BlurEvent, but I can not find out the value user has Typed into ComboBox.

    m

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Answers
    109
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    There is a bug related to setForceSelection(false) not working, but that said, even if it were fixed to the same behavior in 2.x, it wouldn't return something other than null, it just wouldn't clear the value.

    Instead, you almost certainly want a customer PropertyEditor that returns the raw string instead of only finding values in the store you provided.

    The bug is filed at http://www.sencha.com/forum/showthread.php?196281, and I went into more depth there about a month ago at the top of the second page.

Thread Participants: 1