Hub Nexus
Mis à jour

AuteurPas encore d'auteurLa reprendre

Quelque chose à améliorer ? Proposez une modification.

Soutien

Dans XForms · page 29 sur 137

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.

Dans ces publicationsXForms

LanguesEnglish

Licence : CC BY-SA 4.0 · Adapté de en.wikibooks.org

1

0

0

0

Spinner Logo

commentaires

Spinner Logo
Version: 2CC0 1.0 — public domain
The runaway star that left the Tarantula Nebula
Version: 2CC0 1.0 — public domain
The Blackwell School, where segregation had no law behind it
Version: 2CC0 1.0 — public domain
The Eagle Nebula, seen in the infrared
Version: 2CC0 1.0 — public domain
The house where the Equal Rights Amendment was written
Version: 2CC0 1.0 — public domain
The Aleutians, the forgotten front of the Second World War
Version: 2CC0 1.0 — public domain
The Cosmic Cliffs are not cliffs