Managing user actions in an OWL component
To make the user interface interactive, components need to handle user actions such as click, hover, and form submission. In this recipe, we will add a button to our component, and we will handle a click event.
For this recipe, we will continue using the
my_library module from the previous recipe.
How to do it...
In this recipe, we will add a delete button to the component. Upon clicking the delete button, the component gets removed. Perform the following steps to add a delete button and its event in the component:
- Update the QWeb template and add an icon to remove the bar:
static template = xml` <div class="bg-info text-center p-2"> <b> Welcome to Odoo </b> <i class="fa fa-close p-1 float-right" ...