[英]Catching save event in Form Builder
I would like to send submission after form has been saved in Form Builder, I was trying something like this at first (in my XBL file): 我想在表单保存在Form Builder中后发送提交,我首先尝试过这样的事情(在我的XBL文件中):
<xf:action ev:event="fr-data-save-done" ev:observer="fr-form-model">
<xf:message event="#all" level="modal">Saved</xf:message>
<xf:send submission="my-submission" ev:event="#all"/>
</xf:action>
The code above is placed in XBL file between xbl:template, outside xbl:model (though I tried to put it inside xbl:model with no luck). 上面的代码放在xbl:template之间的xbl:template之间,在xbl:model之外(尽管我试图将它放在xbl:model里面没有运气)。 Unfortunately it's not working, after I save my form in Form Builder message is not shown. 不幸的是,在我将表单保存到Form Builder中后,它不起作用。 Anyone got idea why it's not working? 有人知道为什么它不起作用吗?
You could place by hand an event handler like this: 您可以手动放置一个事件处理程序,如下所示:
<foo:bar id="my-component-id" bind="my-bind">
<xf:dispatch
event="fr-data-save-done"
observer="fr-form-model"
name="my-custom-event"
targetid="my-component-id"/>
</foo:bar>
The handler doesn't have to be within the element: 处理程序不必位于元素内:
<foo:bar id="my-component-id" bind="my-bind"/>
<xf:dispatch
event="fr-data-save-done"
observer="fr-form-model"
name="my-custom-event"
targetid="my-component-id"/>
And inside the XBL component: 在XBL组件内部:
<xbl:binding id="my-binding-id" element="foo:bar">
<xbl:handlers>
<xbl:handler event="my-custom-event" phase="target">
... XForms actions here ...
</xbl:handler>
</xbl:handlers>
...
</xbl:binding>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.