W3C home > Mailing lists > Public > www-forms@w3.org > May 2006

Re: multimodal labels and trees too far away for XForms? [was: Re: Deploying (accessible) XForms today?]

From: Mikko Honkala <honkkis@tml.hut.fi>
Date: Mon, 08 May 2006 15:40:25 +0300
Message-ID: <445F3C39.8010406@tml.hut.fi>
To: www-forms@w3.org

Hi,

for those who are interested, here's the tree module as implemented 
currently in X-Smiles:

XForms User Interface

The XForms Tree Module

The tree Element

Attributes: Common, UI Common, Single Node Binding
Minimal Content Model: label, treeitem (help, hint, alert, etc?)

The tree element allows the user to navigate a indefinitely deep nested
structure. The structure shown to the user is rooted at the bound node and
includes all relevant element nodes including the bound node. The tree element
has a mandatory unique id. The tree element has a mandatory treeitem child
element.

The tree control is only used to select a context node, which is exposed to the
rest of the user interface using the nodeindex() XPath function. The tree
control itself does not allow editing the structure or the individual nodes.
Note that nodes, which are irrelevant, and their descendants are not presented
to the user.

Informative: In a graphical implementation, the tree can be represented as a
tree widget, which can be opened or collapsed by the user [add screenshot
here].

The treeitem Element

Common Attributes: Common, UI Common
Minimal Content Model: label (help, hint, alert, etc?)

The treeitem element's label (executed with the context of corresponding node,
with it as the only node in the context nodeset) is used to determine the label
of each node.


The nodeindex function

node-set nodeindex(string)

This function takes an idref of an tree widget, as an argument and returns the
instance node, which corresponds to the currently selected node in a tree
widget.
The argument is converted to a string as if by a call to the string function.
This string is treated as an IDREF, which is matched against tree elements in
the containing document. If a match is located, this function returns a
node-set containing just the instance node, which corresponds to the currently
selected node in a tree widget. In all other cases, an empty node-set is
returned.
--------------------------------------------------------------------------
Example:

The following would display a tree of folders and files. When a user selects a
node, an editor for that node is shown in the group below.
<instance xmlns="xformsns...">
    <data xmlns="">
       <folder name="xxx">
           <folder name="xxx">
               <folder name="xxx">
                   <file name="xxx" description="xxx" xxx="xxx"/>
               </folder>
               <file name="xxx" description="xxx" xxx="xxx"/>
               <file name="xxx" description="xxx" xxx="xxx"/>
           </folder>
       </folder>
    </data name="xxx">
</instance>
<group xmlns="xformsns...">
<tree ref="/data/folder" id="folders">
    <label>The directory structure</label>
    <treeitem>
        <label ref="@name"/>
    </treeitem>
</tree>

<group ref="nodeindex('folders')">
    <group ref="self::node()[localname()='folder']>
       <label>Folder</label>
       <input ref="@name"/>
    </group>
    <group ref="self::node()[localname()='file']>
       <label>File</label>
       <input ref="@name"/>
       <input ref="@description"/>
    </group>
</group>
</group>
Received on Monday, 8 May 2006 12:44:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:04 GMT