开发者

Orbeon XForms: Reuse http service for several actions

The seperation between h开发者_运维问答ttp services and actions in Orbeon forms would enable to reuse a http service for several actions. But according to https://github.com/orbeon/orbeon-forms/blob/master/src/resources/forms/orbeon/builder/form/dialog-actions.xml#L67 this advantage has been disabled - each action needs its own http service. I can't see any reason for this, why are used submissions filtered out?

Thank you!


Initially, this was done for, let's say, historical reasons! I agree that it's an unwanted limitation.

However practically you can't just remove the restriction in the dialog: the reason is that each action has code like this:

<action ev:event="xforms-submit-done" ev:observer="my-service-submission">

This means that if you create more than one action, each action will register an event handler for the completion of the same service, and both actions' handlers will run, which would be incorrect behavior.

What's needed here is something along these lines:

  • each action, when starting the service, passes a unique identifier (for example the id of the action) to the service
  • upon completion, the unique id is passed to xforms-submit-done
  • the event handler for each action can filter on this id
  • only the handler for the action that started the service runs

This would require an enhancement to the XForms engine to implement this feature, which has been already suggested for XForms 2.0, by the way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜