Open main menu

Wikibooks β

XForms/Incremental Many to One

< XForms



Sometimes a single input field will be used to create a new output. Not only does the input field need to be updated, but other fields that depend on this input also need to change.

Here is an example program that has three input fields. As an example, it uses a data dictionary entry (called a Data Element). The name of the Data Element is a concatenation of three fields: the Object Class Name, the Property Name and the Representation Term. The first two are text fields and the third is a value that is picked from a list.

This form creates a single output based on the values of the input fields. This shows that the model can take many different inputs and create a single output.

Link to working XForms ApplicationEdit

Sample CodeEdit

    <title>Many to one</title>
         <xf:instance xmlns="">
               <ObjectClassName />
               <PropertyName />
               <RepresentationTerm />
      <xf:group nodeset="/DataElement">
            <legend>Data Element Name</legend>
            <xf:label>DataElementName: </xf:label>
            <xf:output value="concat(ObjectClassName, ' ', PropertyName, ' ', RepresentationTerm)"/>
               <xf:input ref="ObjectClassName" incremental="true">
                  <xf:label>Object Name:</xf:label>
               <xf:input ref="PropertyName" incremental="true">
                  <xf:label>Property Name:</xf:label>
               <xf:select1 ref="RepresentationTerm" incremental="true">
                  <xf:label>Representation Term:</xf:label>


How can you then take that output and put it back into the model? This will be covered later in the tutorial.

Next Page: Spreadsheet like updating | Previous Page: Input Example

Home: XForms