Untill now, I used this as a component within my plugin:
{% set searchTerm = __SELF__.searchTerm %}
<form data-request="onSend">
<input type="text" name="searchTerm" value="{{ searchTerm }}">
<button type="submit">Search</button>
</form>
Everything worked perfectly fine. Now I try to install the User Plugin. Therefor, I added this to the default Layout in order to make the Logout Links from the Documentation work.
<script src="{{ 'assets/javascript/jquery.js'|theme }}"></script>
{% framework %}
However, when I now try to run the form above, this message is shown in an alert window: “AJAX handler ‘onSend’ was not found.”
In order to make everything work again, I followed the documentation and changed the first approach of the component to the following one:
{% set searchTerm = __SELF__.searchTerm %}
<form onsubmit=\"oc.request(this, 'onSend'); return false;\">
<input type="text" name="searchTerm" value="{{ searchTerm }}">
<button type="submit">Search</button>
</form>
But I somehow wonder if this is the correct way. I doubt the only way to fix this is changing the component since this might include external components, too.
Did I miss something here in order to use the data handler API for my form (within the component) and the Ajax Framework / API for the User Plugin?
Sorry in case I use some terms wrong, didnt work a lot with the Ajax Framework in the Frontend yet.