¿Ves algo que mejorar? Propón un cambio.
En XForms · página 27 de 137
Motivation
Sometimes you have a large number of items to select from, for example you want to include one of many counties within a state to include in your search. In the following example there are 87 counties that might be included in a search. These county names are places in seven columns with 13 counties in all but the last column.
Link to Working Example
Sample Program
Here is a sample program. Make sure to put the page into edit mode if you want to copy and paste the code. This is because Wiki software replaces the ampersand-lt-semicolon with a "&".
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events">
Select County
type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
body {
font-family: Helvetica, sans-serif;
font-size: 10pt;
}
.table-container {
display: table-row;
}
.table-cell {
display: table-cell;
vertical-align: top;
}
xf|label {
font-weight: bold;
}
xmlns="">
anoka carver
dakota
hennepin
mower
ramsey
scott
washington
/>
nodeset="counties"
calculate="concat(../counties1, ' ', ../counties2, ' ',
../counties3, ' ', ../counties4,' ', ../counties5, ' ',
../counties6, ' ',../counties7)" />
id="code-tables">
xmlns="" id="MNCountyCode" src="counties.xml" />
Select all counties to include in the search:
class="table-container ">
class="table-cell">
ref="counties1" appearance="full">
model="code-tables"
nodeset="instance('MNCountyCode')/EnumeratedValues/Item[boolean(position() < 14)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties2" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 13) and (position() < 27)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties3" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 26) and (position() < 40)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties4" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 39) and (position() < 53)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties5" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 52) and (position() < 66)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties6" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 65) and (position() < 79)]">
ref="Label" />
ref="Value" />
class="table-cell">
ref="counties7" appearance="full">
model="code-tables" nodeset="instance('MNCountyCode')/EnumeratedValues/Item[(position() > 78)]">
ref="Label" />
ref="Value" />
ref="counties">
Counties selected:
Table for Data
The following is the shared resources file used by all the forms. Note that the values do not have any spaces in them. This way the codes can be passed through systems that use spaces as delimineters.
MNCountyCode
Aitkin
aitkin
Anoka
anoka
Becker
becker
Beltrami
beltrami
Benton
benton
Big Stone
big-stone
Blue Earth
blue-earth
Brown
brown
Carlton
carlton
Carver
carver
Cass
cass
Chippewa
chippewa
Chisago
chisago
Clay
clay
Clearwater
clearwater
Cook
cook
Cottonwood
cottonwood
Crow Wing
crow-wing
Dakota
dakota
Dodge
dodge
Douglas
douglas
Faribault
faribault
Fillmore
fillmore
Freeborn
freeborn
Goodhue
goodhue
Grant
grant
Hennepin
hennepin
Houston
houston
Hubbard
hubbard
Isanti
isanti
Itasca
itasca
Jackson
jackson
Kanabec
kanabec
Kandiyohi
kandiyohi
Kittson
kittson
Koochiching
koochiching
Lac Qui Parle
lac-qui-parle
Lake
lake
Lake of the Woods
lake-of-the-woods
Lesueur
lesueur
Lincoln
lincoln
Lyon
lyon
Mahnomen
mahnomen
Marshall
marshall
Martin
martin
McLeod
mcleod
Meeker
meeker
Mille Lacs
mille-lacs
Morrison
morrison
Mower
mower
Murray
murray
Nicollet
nicollet
Nobles
nobles
Norman
norman
Olmsted
olmsted
Otter Tail
otter-tail
Pennington
pennington
Pine
pine
Pipestone
pipestone
Polk
polk
Pope
pope
Ramsey
ramsey
Red Lake
red-lake
Redwood
redwood
Renville
renville
Rice
rice
Rock
rock
Roseau
roseau
Saint Louis
saint-louis
Scott
scott
Sherburne
sherburne
Sibley
sibley
Stearns
stearns
Steele
steele
Stevens
stevens
Swift
swift
Todd
todd
Traverse
traverse
Wabasha
wabasha
Wadena
wadena
Waseca
waseca
Washington
washington
Watonwan
watonwan
Wilkin
wilkin
Winona
winona
Wright
wright
Yellow Medicine
yellow-medicine
Discussion
The ideal way to do this would be to use a style sheet to pour the items into different cells of a table. Unfortunately there is little documentation on how the itemset results can be styled into different tables.
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.
En estas publicacionesXForms
Licencia: CC BY-SA 4.0 · Adaptado de en.wikibooks.org
1
0
0
0

Comentarios






