{"action":"opened","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/14458","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/14458/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/14458/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/14458/events","html_url":"https://github.com/odoo/odoo/issues/14458","id":191498589,"number":14458,"title":"[IMP] The web.Dialog API should use a form in its widgets to have native HTML5 validation","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-24T11:37:39Z","updated_at":"2016-11-24T11:37:39Z","closed_at":null,"body":"Impacted versions: 9, 10\r\n\r\nCurrent behavior: If you try to extend any dialog widget to have a form that includes native validation, you need to subscribe your resolution methods to the form's `submit` event, that will only get fired when form is valid. However all core implementations are [inputs outside a form](https://github.com/odoo/odoo/blob/10.0/addons/web/static/src/xml/base_common.xml#L6-L17), with [`<button type='button'>`](https://github.com/odoo/odoo/blob/10.0/addons/web/static/src/xml/base_common.xml#L20) being used for submission.\r\n\r\nExpected behavior: \r\n\r\n- the web.Dialog object should have a default qweb template where the modal contains a form. \r\n- Buttons should be able to get a `type=submit` to trigger validation. \r\n- It should include a direct way to subscribe to inner form's submit event. \r\n- BTW, if we could have a [not so hardcoded qcontext](https://github.com/odoo/odoo/blob/10.0/addons/web/static/src/js/framework/dialog.js#L48), then we could extend base qweb templates and make real use of it.\r\n\r\ncc @ged-odoo "}}
{"actor":{"display_login":"Yajo"}}