AI OnAI Off
In your element template you need to generate a DataList for specifed textbox (which is in AddressCollection).
<%= Model.RenderDataList() %>
public virtual string RenderDataList() { var options = GetAutofillValues(); if (options.Count() == 0) { return string.Empty; } var dataListBuilder = new StringBuilder(); dataListBuilder.AppendFormat("<datalist id=\"{0}\">", Content.GetElementName()); foreach (var item in options) { dataListBuilder.AppendFormat("<option value=\"{0}\" />", item); } dataListBuilder.Append("</datalist>"); return dataListBuilder.ToString(); }
You might need to modify the method to get id of the textbox and render suggested values accordingly.
Hello,
I have created a sample form on the Alloy template was able to successfully use IExternalSystem and IAutofillProvider on default form elements. I then created a custom form element derived from TextboxElementBlock (with its respective view):
Snippet
Dragging this control to form area successfully renders textboxes and I can download submitted form data. Here's a sample:
Using autofill on elements text and text_1 is not a problem, but how do I map external data to textboxes inside the adressCollection?