Open AzurielNacnud opened 1 year ago
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Hello? This issue is about to be closed if nobody replies.
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Hello all,
I'm currently working on adding the ux-autocomplete component in a project.
It works perfectly for all the search types concerning an Entity managed by Doctrine.
However I tried using it manually as described in the official documentation for an object that is not managed by Doctrine but fetched from a custom API.
The problem is the following: I created a custom searchType
With this code, I have an the following error: "Class "Namespace\Customer" seems not to be a managed Doctrine entity. Did you forget to map it?", which is true. However if I delete the 'class' option, then I get the following error: "An error has occurred resolving the options of the form "Namespace\CustomerSearchType": The required option "class" is missing.".
I tried this because in the docs, there is a paragraph that indicates it should be possible to make it work this way.
From the official documentation: "If you want to create an AJAX autocomplete endpoint that is not for an entity, you will need to create this manually. The only requirement is that the response returns JSON with this format: ...
generate the URL to your controller and pass it to the url value of the stimulus_controller() Twig function, or to the autocomplete_url option of your form field."
So how am I supposed to use the component for an entity that isn't managed by Doctrine as in the documentation? https://symfony.com/bundles/ux-autocomplete/current/index.html#manually-using-the-stimulus-controller
Thank you in advance.