[CLOSED] TagField and Default button in FormField

  1. #1

    [CLOSED] TagField and Default button in FormField

    Hello, I have TagField in a FormPanel having a Default button:

    <ext:FormPanel runat="server">
                    <Items>
                      <ext:TextField ID="txtNome" Name="Nome" runat="server" FieldLabel="Nome"  AnchorHorizontal="100%" />
                      
                      <ext:TagField runat="server" ID="tagSinonimi" Name="Sinonimi" TypeAhead="True" AnchorHorizontal="100%" AllowBlank="True" 
                            CreateNewOnEnter="True"
                            CreateNewOnBlur="True" FieldLabel="Sinonimi" Note="INVIO per aggiungere un sinonimo">
                      </ext:TagField>
    
    <!-- Other items -->
                    </Items>
    <Buttons><ext:Button Text="Ok" OnClientClick="alert('ok');" /> </Buttons>
                  </ext:FormPanel>
    Both in Chrome and in IE 11, sometimes it works: Writing something and pressing ENTER will result the TagField to show the new tag.
    But very often the default button's trigger is launched and the tag is not created in the tagfield
    Last edited by Daniil; Feb 05, 2014 at 3:34 AM. Reason: [CLOSED]
  2. #2
    Hi @sbg,

    Thank you for the report.

    Please try this:
    Ext.net.TagField.override({
        onKeyDown: function(e, t) {
            var me = this,
                key = e.getKey(),
                rawValue = me.inputEl.dom.value,
                pos = this.getCursorPosition(),
                stopEvent = false;
    
            if (me.readOnly || me.disabled || !me.editable) {
                return;
            }
    
            if (me.isExpanded && (key == e.A && e.ctrlKey)) {
                me.select(me.getStore().getRange());
                me.collapse();
                me.inputEl.focus();
                stopEvent = true;
            }
    
            if (stopEvent) {
                me.preventKeyUpEvent = stopEvent;
                e.stopEvent();
                return;
            }
    
            if (key == e.ENTER) {
                e.stopEvent();
                //e.preventDefault();
            }
            else if (key == e.LEFT) {
                if (pos == 0 && this.inputMoving) {
                    this.tagLabel.moveInput(-1, pos);
                    this.focus();
                    this.selectText(0, 0);
                }
            }
            else if (key == e.RIGHT) {
                if (pos == rawValue.length && this.inputMoving) {
                    this.tagLabel.moveInput(1, pos);
                    this.focus();
                    this.selectText(pos, pos);
                }
            }
    
            if (me.isExpanded && (key == e.ENTER) && me.picker.highlightedItem) {
                me.preventKeyUpEvent = true;
            }
    
            if (me.enableKeyEvents) {
                me.callParent(arguments);
            }
        }
    });
  3. #3
    It has been fixed in the SVN trunk, revision #5653. It will go to the v2.5 release.

    Thank you again for the report.

Similar Threads

  1. [CLOSED] TagField: cannot override default delimiter
    By rsnead in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 04, 2014, 1:36 PM
  2. [CLOSED] Set default button
    By michaeld in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 03, 2013, 4:07 AM
  3. Still unable to make login button as default button
    By santhu12smart in forum 1.x Help
    Replies: 3
    Last Post: Oct 05, 2011, 8:13 AM
  4. Panel Default Button
    By speddi in forum 1.x Help
    Replies: 8
    Last Post: May 23, 2010, 7:32 PM
  5. [CLOSED] Default button
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 08, 2008, 5:51 PM

Tags for this Thread

Posting Permissions