Hi Erik,
I added this to the model declaration:
<xforms:model id="decor-datasets" xxforms:external-events="clear-locks-submit">
this action in the model:
<xforms:action ev:event="clear-locks-submit">
<xforms:send submission="clear-locks"/>
</xforms:action>
and the script in the model:
<xxforms:script ev:event="xforms-ready"
>
window.onunload = function() {
ORBEON.xforms.Document.dispatchEvent('decor-datasets','clear-locks-submit');
}
</xxforms:script>
But it doesn't work. Am I doing something wrong?
Are there any plans to implement the xforms-model-destruct event? This would seem like a good place to put 'housekeeping' actions, it seems to me that this would also be more reliable as it does not rely on the client triggering an event.
regards,
Gerrit
On Jul 2, 2012, at 7:31 AM, Erik Bruchez wrote:
> Gerrit,
>
> The first issue is whether it's possible to reliably determine when
> the user is leaving the form. On the client-side, we can get a
> notification upon window.unload. We might be able to send an event to
> the server at that time to tell it that the user is leaving the form.
> That's something to try but currently we don't have it in standard.
>
> So I would try this:
>
> - register a JavaScript event handler on onunload
> - dispatch an XForms event to the server, see:
>
> ORBEON.xforms.Document.dispatchEvent("my-group", "acme-super-event");
>
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-javascript-integration
>
> Note that you need to enable the external event with something like:
>
> <xforms:model xxforms:external-events="acme-super-event">
>
> -Erik
>
> On Sat, Jun 30, 2012 at 4:56 AM, Gerrit Boers <
gboers@xs4a...> wrote:
>> Hi,
>>
>> I implemented the how-to on alerting user before leaving a form. Now I would like to trigger a submission when the user leaves the form. How could this be achieved? I tried using the xforms-model-destruct event but this doesn't work.
>>
>> regards,
>>
>> Gerrit
>>
>> --
>> You receive this message as a subscriber of the
ops-users@ow2.... mailing list.
>> To unsubscribe: mailto:
ops-users-unsubscribe@ow2....
>> For general help: mailto:
sympa@ow2....?subject=help
>> OW2 mailing lists service home page:
http://www.ow2.org/wws
>>
>
> --
> You receive this message as a subscriber of the
ops-users@ow2.... mailing list.
> To unsubscribe: mailto:
ops-users-unsubscribe@ow2....
> For general help: mailto:
sympa@ow2....?subject=help
> OW2 mailing lists service home page:
http://www.ow2.org/wws
opensubscriber is not affiliated with the authors of this message nor responsible for its content.