Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 2 min read

Support

Motivation

You want to select one item from multiple column of items.

Method

To do this we must unselect all of the column not selected so that only one column has a value in the output.

Source Code

xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms">

Select1 Multi Column

type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
body {
font-family: Helvetica, sans-serif;
font-size: 10pt;
}

/* vertical align the selectors in each column. I am not sure why none of these CSS selectors work */
.state-selector tr td {
vertical-align:text-top;
align: top;
valign: top;
}

/* this is also not working */
.state-selector xf:label {
font-weight: bold;
}
]]>

xmlns="" id="cols">

nodeset="cols" calculate="concat(../col-1, ../col-2, ../col-3)"/>

id="log">
xmlns="">

ev:event="xforms-ready">
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'xforms-ready'"/>

Select1 Multi Column

border="1">

valign="top">
ref="col-1" appearance="full">

Red
red

Orange
orange

ev:event="DOMActivate">
ref="instance('cols')/col-2" value="''"/>
ref="instance('cols')/col-3" value="''"/>
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'col 1 xforms-value-changed'"/>

valign="top">
ref="col-2" appearance="full">

Yellow
yellow

Green
green

ev:event="DOMActivate">
ref="instance('cols')/col-1" value="''"/>
ref="instance('cols')/col-3" value="''"/>
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'col 2 xforms-value-changed'"/>

valign="top">
ref="col-3" appearance="full">

Blue
blue

Indigo
indigo

ev:event="DOMActivate">
ref="instance('cols')/col-1" value="''"/>
ref="instance('cols')/col-2" value="''"/>
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'col 3 xforms-value-changed'"/>

Clear
ev:event="DOMActivate">
ref="col-1" value="''"/>
ref="col-2" value="''"/>
ref="col-3" value="''"/>
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'clear'"/>

refresh
ev:event="refresh">
ref="col-1" value="''"/>
ref="col-2" value="''"/>
ref="col-3" value="''"/>
nodeset="instance('log')/event" at="last()" position="after"/>
ref="instance('log')/event[last()]" value="'refresh'"/>

ref="cols">
Color selected:

ref="col-1">
Column 1:

ref="col-2">
Column 2:

ref="col-3">
Column 3:

id="log">

Event Log

id="results-repeat" nodeset="instance('log')/event">
ref="."/>

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
xmlns=" xmlns:xf=" 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 Fro
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