[FIXED] [#1206] [3.3] TagField control getValue() issue when adding custom values

Page 1 of 2 12 LastLast
  1. #1

    [FIXED] [#1206] [3.3] TagField control getValue() issue when adding custom values

    Hi, it looks like the TagField control has an issue when interacting through the keyboard to add a custom value.

    If you look at your examples:
    https://examples3.ext.net/#/Form/Tag/TagField/

    Try with "Basic" ,... if you insert a custom value using the keyboard and pressing "enter", then trying to get the value of the control through script (eg. Chrome Console) you can see that getValue() returns NULL or only the "last value"...

    Try with this code on an ASPX custom project to see the behavior:
    <ext:TagField 
                    ID="From"
                    runat="server"
                    ItemID="From"
                    CreateNewOnEnter="true">
                    <TagLabelConfig ID="TagLabelConfig1" runat="server">
                    </TagLabelConfig>
    </ext:TagField>
    If you insert items on the editor through keyboard you can see that calling the "getValue()" retrieves only the last one.

    Thank you for a quick fix on the same.
    Cheers & have a great holidays,
    Last edited by Daniil; Jan 13, 2016 at 9:34 AM. Reason: [FIXED] [#1206] [3.3]
  2. #2
    Hello @adrianot!

    There is an error raising when choosing custom items (outside the store) that is interrupting the add process in the middle. If you choose only items in the dropdown menu (when you type 'B' for "Bob" on that field, for example), you will probably get it added correctly. The problem seems to be with custom values in the tag fields. So, for now, enforcing only expected tag values might be the solution for you if acceptable.

    I will investigate this and open an issue about the custom values' input on tag fields.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi Fabricio, and thank you for your quick feedback.

    Unfortunately I can't apply that limitation because we're using this control to insert multiple e-mail addresses, and this can' tbe selected from a list given that they are never known in advance.

    Thank you for help,
    Cheers
  4. #4

    Info

    Hi any updates on this issue?
    Thank you in advance,
    Cheers
    Adriano
  5. #5
    Hello, @adrianot!

    Really sorry for the delay, and thank you very much for the heads up!

    For now, you can use this to overcome this issue:
        <script type="text/javascript">
            Ext.define('Ext.view.AbstractView', {
                override: 'Ext.view.AbstractView',
                updateIndexes: function (startIndex, endIndex) {
                    var nodes = this.all.elements,
                        node,
                        records = this.getViewRange(),
                        i,
                        myId = this.id;
                    startIndex = startIndex || 0;
                    endIndex = endIndex || ((endIndex === 0) ? 0 : (nodes.length - 1));
    
                    for (i = startIndex; i <= endIndex; i++) {
                        node = nodes[i];
                        node.setAttribute('data-recordIndex', i);
                        node.setAttribute('data-recordId', (records[i]) ? records[i].internalId : undefined);
                        node.setAttribute('data-boundView', myId);
                    }
                }
            });
        </script>
    As this TagField is not an actual Sencha ExtJS component, but we might be still using the component from before it was merged into ExtJS, thus it got issues with newer versions.

    I will update the issue so we switch to ExtJS specific TagField. Breaking changes impact analysis will also need to take place here.

    Hope you can make it with the override for now. Let me know if even with the workaround above you still get issues with it.
    Fabrício Murta
    Developer & Support Expert
  6. #6
    It has been fixed. The fix will be included into the 3.3 and 4.0 beta releases.

    Your feedback if it is fixed for you would be appreciated.
  7. #7
    Hi Fabricio/Daniil I was just writing you now. Thanks for the workaround, however it works only on the UI, I mean that the UI updates correctly but when doing "getValue()" after inserting the new value on the TagField manually it still returns only the last one.

    Thank you!
  8. #8
    Thanks for the feedback!

    Just to clarify - we committed another changes, not that override.
  9. #9
    Hi Daniil/Fabricio,
    unfortunately we can't upgrade Ext.Net right now since we could add other possible issues; do you think you can help us with the override above so that when the new value is inserted, both UI and getValue() methods work correctly?

    Thank you!
  10. #10
    I would recommend to extract the required changes from the SVN log.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 12
    Last Post: Jul 28, 2015, 10:11 AM
  2. Replies: 9
    Last Post: Mar 13, 2014, 3:30 PM
  3. Adding control values to the grid
    By Vaishali in forum 1.x Help
    Replies: 0
    Last Post: Apr 17, 2012, 11:55 AM
  4. [CLOSED] Adding events to custom control
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 29, 2012, 8:16 PM
  5. Replies: 2
    Last Post: Jan 09, 2012, 7:18 AM

Posting Permissions