Hub Nexus
업데이트됨

작가아직 작성자가 없습니다맡기

개선할 점이 보이나요? 변경을 제안하세요.

후원

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.

Select Multi Column

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.

이 페이지가 속한 매거진XForms

언어English

이용 허락: CC BY-SA 4.0 · 출처 en.wikibooks.org

1

0

0

0

Spinner Logo

코멘트

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