How to insert data between more than one model.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to insert data between more than one model.

Chriss-2
Hi,

I have separately deployed Java Application and I want to create submit button. My idea with the button is to create trigger and at first insert data from all models and instances to one additional instance, which will afterwards contain all the data and then send only additional instance to the service. Sample:

<!-- Additional instance -->
<xf:model id="Allinstances">
    <xf:instance id="AllinstancesSubmission" xmlns="">
        <instancesubmit>             
       <!-- I want to insert all the data from other models and instances here. -->
        </instancesubmit>
    </xf:instance>
    <xf:submission .../>
</xf:model> 

<!-- Normal data -->
<xf:model ...>
   <xf:instance ...>
...


In this solution I need just one submission element in my additional instance. But how to use xf:insert with many models? My idea is to use only XForms elements, not elements from xxf namespace, like xxf:element, which may solve my problem.

I've tried:

<xf:insert ev:event="DOMActivate" nodeset="instance('AllInstancesSubmission')" origin="..." model="AllInstances"/>

I put model as a parameter, so it doesn't allow me to use many models. In nodeset and origin parameteres I can use instance function, but there is no model function in XForms.

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: How to insert data between more than one model.

Erik Bruchez
Administrator
Try something like:

<xf:insert
  ev:event="DOMActivate"
  context="xxf:instance('AllinstancesSubmission')"
  ref="*"
  origin="xxf:instance('my-source-instance')"/>

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: How to insert data between more than one model.

Chriss-2
It works! At the beginning my idea  was not to use methods from xxf namespace, however it works well and there shouldn't be any problems with it.

I wonder how should I use insert element - in the documentation (http://www.w3.org/TR/xforms/#action-insert) I didn't find information about ref attribute. Is it correct to use it?

W dniu środa, 20 listopada 2013 18:46:41 UTC+1 użytkownik ebruchez napisał:
Try something like:

<xf:insert
  ev:event="DOMActivate"
  context="xxf:instance('AllinstancesSubmission')"
  ref="*"
  origin="xxf:instance('my-source-instance')"/>

-Erik

--
View this message in context: http://discuss.orbeon.com/How-to-insert-data-between-more-than-one-model-tp4657681p4657683.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: How to insert data between more than one model.

Alessandro  Vernet
Administrator
Using ref="..." instead of nodeset="..." is something from XForms 2, which is not a W3C recommendation yet, but is largely implemented in Orbeon Forms. And if you have existing code you don't want to change, you can leave it as is with its nodeset="...", which should still be supported.

http://www.w3.org/TR/xforms20/#Differences_between_XForms_2.0_and_XForms_1.1

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to insert data between more than one model.

Chriss-2
Good to know - thank you for your help Alex.

Regards,
Chriss

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].