Multi Autocomplete clears ApplyTo field data when result of search is empty

Forums Autocomplete Multi Autocomplete clears ApplyTo field data when result of search is empty

This topic contains 5 replies, has 2 voices, and was last updated by  Alexander Bautz 4 months, 3 weeks ago.

  • Author
    Posts
  • #25783

    Martin Čuchran
    Participant

    Hi,

    I am using last version of autocomplete. Configuration is set to multiple values. I do not prefill any other fields.

    Problem:

    When i choose several existing items from search in my autocomplete field, save this data and then try to add new items with autocomplete, all data are wiped out in case that search return 0 values. Input field is red, i see old values under input field but value of field is empty string. Result is that previously saved data are lost.

    I have attached screenshot where you can see that data are shown under input field but function getFieldValue returns empty string after search which returned 0 values.

    Is it bug or feature ?

    AC configuration:
    spjs.ac.textField({
    “applyTo”: “Lokalita”,
    “helpText”: “”,
    “loadText”: “”,
    “listGuid”: “{B7CEDA7F-9E4A-4E1F-9ED3-D842D0CBBCA8}”,
    “listBaseUrl”: “/sites/UCD”,
    “showField”: “Title”,
    “searchFields”: [],
    “filterCAML”: “”,
    “useREST”: false,
    “preloadData”:false,
    “filterREST”: “”,
    “optionDetailFields”: [],
    “optionDetailPrefix”: [],
    “enforceUniqueValues”: true,
    “rowLimit”: 15,
    “listOptionsOnFocus”: false,
    “minLengthBeforeSearch”: 3,
    “reValidateOnLoad”: false,
    “allowAddNew”: false,
    “isLookupInSelf”: true,
    “addNewAdditionalFields”: [],
    “multiselect”: true,
    “multiselectSeparator”: “; “,
    “orderBy”: [“Title”],
    “clearSetFieldsOnInvalidSelection”: false,
    “setFields”: [],
    “debug”: false
    });

  • #25798

    Alexander Bautz
    Keymaster

    Hi,
    You are right, there is unfortunately a bug that clears the current selections in the hidden textarea when you search and return 0 values and you have multi-select turned on.

    I will include the fix in the next DFFS package, but in the meantime you can replace only the SPJS-ac.js file in your /SPJS/DFFS/plugins folder with the one attached. Please ensure it lists as v1.6.30 when checking the version by hovering over the “Enhanced with DFFS” link below the form. If it doesn’t you must clear the browser cache.

    PS: You must unzip the file before replacing it.

    Sorry for the inconvenience and best regards,
    Alexander

  • #25802

    Martin Čuchran
    Participant

    Hi Alexander,

    i have replaced SPJS-ac.js, but it still does not work. Cache has been cleared, forms reloaded. I have send link to video to your personal email where you can see behavior of bug and version of AC.

    Thanks

  • #25806

    Alexander Bautz
    Keymaster

    Thanks for the video – it helped me see what was wrong. Because the query is handled differently when you use “useREST”: falsw and “useREST”: true I did not find all problems in the version I attached yesterday. I have now fixed what I hope is the last bug and attached a new version.

    Please ensure it shows as v1.6.31 and let me know how it works out.

    Alexander

  • #25809

    Martin Čuchran
    Participant

    Hi,

    it is working now. Thank you.

    Is it possible to remove RED border if no results is selected? For example after click X icon in input ?

    Thanks

  • #25817

    Alexander Bautz
    Keymaster

    I’m glad it worked out – and yes, I have removed the red border when you clear the selection in the field – see attached version.

    Alexander

You must be logged in to reply to this topic.