Home › Forums › Autocomplete › Autocomplete setFields clears Fileds
- This topic has 7 replies, 2 voices, and was last updated 6 years, 1 month ago by Alexander Bautz.
-
AuthorPosts
-
-
November 5, 2018 at 14:07 #22688
Hi,
i have a problem regarding the setFields Function in the autocomplete plugin.
As soon as the configured field was focused (for example someone clicked on the field and then clicked on another field) the “conected” fields are overwritten / cleared.If the ac field was justed focused, but nothing enterd, the connected fields are set to nothing / cleared.
Is there a way that the setField Option only fires AFTER a valid autocomplete selection?Best Regards,
Michael -
November 6, 2018 at 16:49 #22696
I’m not able to recreate this behavior – which version of the spjs-ac plugin are you using?
If you are using the latest version, please post the config for the spjs.ac here so I can look at it.
Alexander
-
November 7, 2018 at 10:02 #22724
Hi Alexander,
here is the information:
SPJS-Autocomplete plugin v1.6.26spjs.ac.textField({ "applyTo":"FileLeafRef", "helpText":"Bitte geben Sie eine Nummer ein", "listGuid":"{b6b26d93-ea2d-4afb-94de-edc84ffc4e36}", "listBaseUrl":"/path/site", "showField":"Nummer", "optionDetailFields":["Nummer1","Nummer2"], "enforceUniqueValues":true, "rowLimit":15, "listOptionsOnFocus":false, "minLengthBeforeSearch":3, "reValidateOnLoad":false, "allowAddNew":false, "isLookupInSelf":false, "addNewAdditionalFields":[], "filterCAML":"", "multiselect":false, "multiselectSeparator":"; ", "orderBy":[], "setFields":[{ "fromFIN":["Nummer2"], "joinBy":"", "toFIN":"Kunde", "parseFunction":"", "skipIfEmpty":false } ] });
Best Regards,
Michael -
November 7, 2018 at 19:17 #22736
Ah, I see now what you mean. If the autocomplete field is not filled in with a valid choice and you focus on it and then removes focus without setting a valid option, any existing values in the setFields will be cleared.
Can you explain how you use this, because I would think the setFields should be set by the autocomplete and not have a value if the primary autocomplete field is not set.
Alexander
-
November 8, 2018 at 08:02 #22757
Hello Alexander,
the field were autocomeplete is appended is “CustomerNumber” Field and the the field that is set is “CustomerName”.
When a new item in the list is created, it is possible that we do not have a “CustomerNumber” in this phase of the project, so this field is not used, but because we need a customername to identify the item the “CustomerName” Field is visible an can be edited / filed manually.
As soon as we have a customernumber, the item should be edited and the correct customer name should be pulled from our customerlist (selected by customernumber) and the manually entered value should be replaced.Now if somebody “checks” if the entry is availabel in the customerlist, the customername field is cleared if no value is found.
Regards,
Michael -
November 8, 2018 at 19:22 #22766
OK, I’ll add a new option in the configuration in the next version (during the weekend) and so you can prevent the fields from being cleared on invalid selections.
Alexander
-
November 9, 2018 at 08:20 #22780
Hi Alexander,
as always: Thanks for your help!
Best Regards,
Michael -
November 10, 2018 at 12:00 #22816
I have updated the DFFS package – including the fix for spjs-ac: https://spjsblog.com/2018/11/10/dffs-package-updated-to-v4-4-3-58/
See the instructions for the ac plugin here: https://spjsblog.com/dffs/dffs-plugins/spjs-autocomplete/#clearSetFieldsOnInvalidSelection
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.