XForms/Insert with Origin

Motivation
You want to insert new values into an instance of the model and specify where to find the initial values of the insert.

Method
You can add an origin attribute to the insert statement to tell XForms where to get the initial data for the insert. This is the preferred method over doing many setvalues. The syntax of the insert is the following:

Screen Image
A sample screen image. Many people do not have the ability to run the examples so this is critical.

Use this format:



Make SURE you label all images with a license. Please use creative commons "share alike 3.0 with attribution" if you can.

XForms Application
Load XForms Application

Make sure that the mime-type is set in the svn system to be text/xml.

Sample XForms Template
     Insert with Origin   First Name:    Family Name:    Gender: </xf:label> <xf:item> <xf:label>Male</xf:label> <xf:value>male</xf:value> </xf:item> <xf:item> <xf:label>Female</xf:label> <xf:value>female</xf:value> </xf:item> <xf:item> <xf:label>Unknown</xf:label> <xf:value>unknown</xf:value> </xf:item> </xf:select1> <xf:input ref="XFormsAwareIndicator"> <xf:label>Indicator: </xf:label> </xf:input> </xf:repeat> <xf:trigger> <xf:label>Add</xf:label> <xf:insert ev:event="DOMActivate" nodeset="instance('persons')/Person" at="last" position="after" origin="instance('init')/Person"/> </xf:trigger>