Use case for dispatching xforms-submit-done

All,

In "5.2.2 Creating instance data from external resources" [1], we decided
to dispatch `xforms-submit-error`, and raised the question of whether to
dispatch `xforms-submit-done` in case of success. The argument for it is
symmetry, but we were missing a use case.

A simple use case would be post-processing of the instance. If the instance
is inline, there is full control upon its content. But if it is loaded from
an external resource, that is not always the case. So you could have things
like:

<instance
    id="my-instance"
    src="https://example.org/my-data">
    <form>
        <name/>
    </form>
</instance>

<action event="xforms-submit-done" observer="my-instance">
    <delete ref="//@foobar"/>
</action>

This is just an example, but any kind of post-processing can apply.

In light of this use case, I would suggest specifying that
`xforms-submit-done` is dispatched upon success.

-Erik

[1]
https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Creating_instance_data_from_external_resources

Received on Wednesday, 24 October 2018 04:24:28 UTC