Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 1 min read

Support

Motivation

You want to store lists in the model, not in the user interface. This allows a list to be used many places in a form and also enables lists to be read from external files (see the next example).

Execute Sample XForms Application

Load XForms Application

Sample Program

This example shows how to use the XForms itemset element to get data from the selection list directly from the model. Note that itemset is very similar to the group command in syntax: the outer loop tells you where to get your data and the inner loop binds a data element to a form value or item.

xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">

Getting Selection List Data From the XForms Model
type="text/css">
body {font-family: Helvetica, Verdanan, sans-serif;}
]]>

id="my-item" xmlns="">

red

id="code-tables" xmlns="">

ItemColorCode

Red
red

Orange
orange

Yellow
yellow

Green
green

Blue
blue

Getting Selection List Data From the XForms Model
ref="ItemColorCode" appearance="full">

nodeset="instance('code-tables')/code-table[code-table-id='ItemColorCode']/item">
ref="label"/>
ref="value"/>

Output: ref="ItemColorCode"/>

Discussion

This is a much more flexible way to manage lists. The instance document may be fetched dynamically from a remote database and the form does not need to be updated when lists change.

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Get each new page of

XForms

Following means one email when a page is added, nothing when a page changes.

Following means one email when a page is added, nothing when a page changes.

Comments

Spinner Logo

Next in XForms

CC BY-SA 4.0
In this example the file that contains the codes is just a well-formed XML file in the same directory that the form is located in. ## Loading XML instance data from a local file or web service The following code fragment, usually in the HTML head, demonstrates how to read XML data from a local file
CC BY-SA 4.0
Click on the calendar icon and select a date. Note that you can change the day and the month using the calendar picker. ## Discussion The key line is: nodeset="MyDate" type="xs:date" /> Note that if you do not use the bind command, the input will work like an ordinary text field. The format that is
CC BY-SA 4.0
type="text/css"> @namespace xf url(' .hidden .xf-value { display:none; } ]]> xmlns=""> 2006-09-12 nodeset="/MyModel/MyDate" type="xs:date" /> class="hidden" ref="/MyModel/MyDate" incremental="true"> Select Date: value="concat(substring(/MyModel/MyDate,6,2), '/', substring(/MyModel/MyDate,9,2), '/',
CC BY-SA 4.0
xmlns=" xmlns:xf=" xmlns:ev=" xmlns:xs=" xmlns:xsi=" > xmlns=""> xsi:type="xs:anyURI"/> ref="/Data/File"> file:///C:/tmp/*.xml text/xml ref="/Data/File"> File: ## Discussion At the time of this writing, there is little documentation on how the upload control works. The screen shot above was taken fr
CC BY-SA 4.0
Using a trigger abstraction allows your XForms to be more portable. ## Sample Program xmlns=" xmlns:xf=" xmlns:ev=" > Button Example xmlns=""> Button If you press this you will get a hello world message. level="modal" ev:event="DOMActivate">Hello World! ## Discussion This example has both a label an
CC BY-SA 4.0
This example demonstrates how to control the button appearance using labels, hint text and images. To see the button images appear you will need to create a file called XForms-button.jpg in the folder that this program is executed from. This example requires an image to be used in the program. This