I'm using the Balbus adaption now, it seems like the most promising candidate so far,
If you have any complete working code examples of it, I would love to see what you did :)
Currently I installed the formfield files in my modules directory then tweaked them with Balbus's code. I did have them in the mysite directory at first but for some reason that wouldn't work (See first 3 posts)
I always ran dev/build?flush=1 each time I moved file contents around
Now regarding the example you set here:
static $db = array(
'MyField' => 'Varchar'
)
$fields->addFieldsToTab('Root.Content.Main', array(
new AutocompleteField(
$name = 'MyField',
$title = 'Enter a value'
)
));
This is a different format compared to what I am using.
My form looks like this instead:
$fields = new FieldSet(
[other fields]
new AutocompleteField(
$name = 'MyField',
$title = 'Enter a value'
)
[other fields]
);
$form = new Form($this, [name], $fields, $actions, $validator);
Is it absolutely important that write my forms in the format you specified?
Also did you ever need to rename some things in order to avoid conflict with the original AutocompleteField? I think that is what is happening to my current autocomplete field.
Even though I declared it like this:
new AutocompleteField(
$name = 'City',
$title = 'Enter the name of a city'
)
it turns out like this:
<input type="text" value="" name="City" id="Form_BookSector_City" class="text autocomplete_input {'url' : 'bookingmanager/editprofile'}" autocomplete="off">
When it should be this:
<input type="text" src="/bookingmanager/BookSectorController/index/field/City/Suggest" autocomplete="off" value="" name="City" id="Form_BookSector_Author" class="text AutocompleteField">
I bolded the part that is causing the autocompletefield to autosuggest an entire web page. The editprofile page is being linked in the fields class for some reason
The bold part is coming from another file outside of my module and it is overriding what the formfield code originally set. Let me see if I can find it again, I spotted the offending code yesterday but I forgot where it was.