+ All Categories
Home > Documents > Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Date post: 12-Sep-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
704
Lotus® Forms 3.5.1 XFDL Specification Version 7.7 Version 3 Release 5
Transcript
Page 1: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Lotus® Forms 3.5.1

XFDL Specification Version 7.7

Version 3 Release 5

���

Page 2: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

NoteBefore using this information and the product it supports, read the information in “Notices” on page 675.

This edition applies to version 3.5.1 of IBM Lotus Forms Designer (product number 5724-N09) and to all subsequentreleases and modifications until otherwise indicated in new editions.

© Copyright International Business Machines Corporation 2003, 2009.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

Page 3: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Contents

XFDL Version 7.7 . . . . . . . . . . . 1Origin and goals . . . . . . . . . . . . . 1References . . . . . . . . . . . . . . . 2Terminology . . . . . . . . . . . . . . 2Notation . . . . . . . . . . . . . . . . 2Overlap with other specifications . . . . . . . 2Non-repudiation and the document-centric model . . 3Form names and extensions . . . . . . . . . 4MIME types . . . . . . . . . . . . . . 4Structure of XFDL forms . . . . . . . . . . 4

Top-level structure . . . . . . . . . . . 4Overview of XForms models . . . . . . . . 5Items . . . . . . . . . . . . . . . . 6Options and array elements . . . . . . . . 8Locales . . . . . . . . . . . . . . . 16Characters in character data content . . . . . 16Base-64 and compressed encoding of binary data 17Scope identifiers (sid) . . . . . . . . . . 17Adding comments to XFDL . . . . . . . . 17Document reproducibility . . . . . . . . 18

Small XFDL form examples . . . . . . . . . 18About signing forms . . . . . . . . . . . 21

About applying multiple signatures to forms . . 21Namespaces in signature filters . . . . . . . 22Applying multiple signatures . . . . . . . 23Securing signed elements . . . . . . . . . 23Preventing layout changes . . . . . . . . 24Preventing exploitable overlaps of signedelements . . . . . . . . . . . . . . 24

Global settings . . . . . . . . . . . . . 25Form globals . . . . . . . . . . . . . 25Page globals . . . . . . . . . . . . . 28

Details on XFDL items. . . . . . . . . . . 29action . . . . . . . . . . . . . . . 30box . . . . . . . . . . . . . . . . 31button . . . . . . . . . . . . . . . 32cell . . . . . . . . . . . . . . . . 35check . . . . . . . . . . . . . . . 37combobox . . . . . . . . . . . . . . 38data . . . . . . . . . . . . . . . . 40field . . . . . . . . . . . . . . . . 41help . . . . . . . . . . . . . . . . 43label . . . . . . . . . . . . . . . . 44line . . . . . . . . . . . . . . . . 46list . . . . . . . . . . . . . . . . 47popup . . . . . . . . . . . . . . . 49radio . . . . . . . . . . . . . . . 51signature . . . . . . . . . . . . . . 53spacer . . . . . . . . . . . . . . . 56toolbar . . . . . . . . . . . . . . . 57<custom item> . . . . . . . . . . . . 58

Details on XForms items . . . . . . . . . . 58checkgroup . . . . . . . . . . . . . 59pane. . . . . . . . . . . . . . . . 62radiogroup . . . . . . . . . . . . . 65slider . . . . . . . . . . . . . . . 68

table. . . . . . . . . . . . . . . . 69Details on options and array elements . . . . . 72

acclabel. . . . . . . . . . . . . . . 75activated . . . . . . . . . . . . . . 77active . . . . . . . . . . . . . . . 79bgcolor . . . . . . . . . . . . . . . 80border . . . . . . . . . . . . . . . 82colorinfo . . . . . . . . . . . . . . 83coordinates . . . . . . . . . . . . . 85cursortype . . . . . . . . . . . . . . 86data . . . . . . . . . . . . . . . . 87datagroup . . . . . . . . . . . . . . 88delay . . . . . . . . . . . . . . . 90display . . . . . . . . . . . . . . . 92direction . . . . . . . . . . . . . . 94dirtyflag . . . . . . . . . . . . . . 96enclosuresettings . . . . . . . . . . . 98excludedmetadata . . . . . . . . . . . 100filename . . . . . . . . . . . . . . 101first . . . . . . . . . . . . . . . 102focused . . . . . . . . . . . . . . 104focuseditem . . . . . . . . . . . . . 106fontcolor . . . . . . . . . . . . . . 107fontinfo . . . . . . . . . . . . . . 108format . . . . . . . . . . . . . . . 110formid. . . . . . . . . . . . . . . 131fullname . . . . . . . . . . . . . . 132group . . . . . . . . . . . . . . . 133help . . . . . . . . . . . . . . . 135image . . . . . . . . . . . . . . . 136imagemode . . . . . . . . . . . . . 138itemfirst . . . . . . . . . . . . . . 140itemlast . . . . . . . . . . . . . . 141itemlocation . . . . . . . . . . . . . 142itemnext . . . . . . . . . . . . . . 152itemprevious . . . . . . . . . . . . 154justify . . . . . . . . . . . . . . . 156keypress . . . . . . . . . . . . . . 157label . . . . . . . . . . . . . . . 159labelbgcolor . . . . . . . . . . . . . 161labelborder . . . . . . . . . . . . . 162labelfontcolor . . . . . . . . . . . . 163labelfontinfo. . . . . . . . . . . . . 164last . . . . . . . . . . . . . . . . 166layoutflow . . . . . . . . . . . . . 168layoutinfo . . . . . . . . . . . . . 170linespacing . . . . . . . . . . . . . 172mimedata . . . . . . . . . . . . . 173mimetype . . . . . . . . . . . . . 176mouseover . . . . . . . . . . . . . 177next . . . . . . . . . . . . . . . 178numericshaping . . . . . . . . . . . 178orderingscheme . . . . . . . . . . . 180orientation . . . . . . . . . . . . . 181padding . . . . . . . . . . . . . . 183pagefirst . . . . . . . . . . . . . . 184

© Copyright IBM Corp. 2003, 2009 iii

Page 4: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pageid. . . . . . . . . . . . . . . 185pagelast . . . . . . . . . . . . . . 186pageloading . . . . . . . . . . . . . 186pagenext . . . . . . . . . . . . . . 189pageprevious . . . . . . . . . . . . 190previous . . . . . . . . . . . . . . 191printbgcolor . . . . . . . . . . . . . 192printfontcolor . . . . . . . . . . . . 193printing . . . . . . . . . . . . . . 194printlabelbgcolor . . . . . . . . . . . 195printlabelfontcolor . . . . . . . . . . . 196printsettings . . . . . . . . . . . . . 197printvisible . . . . . . . . . . . . . 202publicdata . . . . . . . . . . . . . 203readonly . . . . . . . . . . . . . . 205requirements . . . . . . . . . . . . 206rowpadding . . . . . . . . . . . . . 211rtf . . . . . . . . . . . . . . . . 213saveformat . . . . . . . . . . . . . 215scrollhoriz . . . . . . . . . . . . . 217scrollvert . . . . . . . . . . . . . . 218signature . . . . . . . . . . . . . . 219signatureimage . . . . . . . . . . . . 220signdatagroups . . . . . . . . . . . . 221signdetails . . . . . . . . . . . . . 223signer . . . . . . . . . . . . . . . 227signformat . . . . . . . . . . . . . 228signgroups . . . . . . . . . . . . . 237signinstance . . . . . . . . . . . . . 239signitemrefs . . . . . . . . . . . . . 241signitems . . . . . . . . . . . . . . 243signnamespaces . . . . . . . . . . . 245signoptionrefs . . . . . . . . . . . . 246signoptions . . . . . . . . . . . . . 248signpagerefs . . . . . . . . . . . . . 250size. . . . . . . . . . . . . . . . 251suppresslabel . . . . . . . . . . . . 252texttype . . . . . . . . . . . . . . 253thickness . . . . . . . . . . . . . . 254transmitdatagroups . . . . . . . . . . 255transmitformat . . . . . . . . . . . . 257transmitgroups . . . . . . . . . . . . 258transmititemrefs . . . . . . . . . . . 260transmititems . . . . . . . . . . . . 262transmitnamespaces . . . . . . . . . . 264transmitoptionrefs . . . . . . . . . . . 265transmitoptions. . . . . . . . . . . . 267transmitpagerefs . . . . . . . . . . . 269triggeritem . . . . . . . . . . . . . 270type . . . . . . . . . . . . . . . 271ufv_settings . . . . . . . . . . . . . 273url . . . . . . . . . . . . . . . . 285value . . . . . . . . . . . . . . . 288visible . . . . . . . . . . . . . . . 289webservices . . . . . . . . . . . . . 290writeonly . . . . . . . . . . . . . . 292xformsenabled . . . . . . . . . . . . 293xformsreadonly. . . . . . . . . . . . 295xformsrequired . . . . . . . . . . . . 296xformsvalid . . . . . . . . . . . . . 297<custom option> . . . . . . . . . . . 298

Details on XForms options . . . . . . . . . 298XForms namespace . . . . . . . . . . 299Linking input items to the XForms data model 299Single node binding . . . . . . . . . . 299Nodeset binding . . . . . . . . . . . 302Bindings and relevance . . . . . . . . . 303Metadata sub-options. . . . . . . . . . 303xformsmodels . . . . . . . . . . . . 306xforms:group . . . . . . . . . . . . 316xforms:input. . . . . . . . . . . . . 317xforms:output . . . . . . . . . . . . 320xforms:range . . . . . . . . . . . . 322xforms:repeat . . . . . . . . . . . . 323xforms:secret . . . . . . . . . . . . 325xforms:select . . . . . . . . . . . . 327xforms:select1 . . . . . . . . . . . . 333xforms:submit . . . . . . . . . . . . 339xforms:switch . . . . . . . . . . . . 340xforms:trigger . . . . . . . . . . . . 342xforms:textarea . . . . . . . . . . . . 344xforms:upload . . . . . . . . . . . . 346

Details on XForms actions . . . . . . . . . 347Syntax. . . . . . . . . . . . . . . 347Actions and XForms functions. . . . . . . 349Placing actions in a form . . . . . . . . 349xforms:delete . . . . . . . . . . . . 350xforms:insert . . . . . . . . . . . . 353xforms:message . . . . . . . . . . . 356xforms:rebuild . . . . . . . . . . . . 357xforms:recalculate . . . . . . . . . . . 358xforms:refresh . . . . . . . . . . . . 359xforms:reset . . . . . . . . . . . . . 360xforms:revalidate . . . . . . . . . . . 361xforms:send . . . . . . . . . . . . . 362xforms:setfocus . . . . . . . . . . . . 363xforms:setindex. . . . . . . . . . . . 364xforms:setvalue. . . . . . . . . . . . 365xforms:toggle . . . . . . . . . . . . 367

Details on XForms event handlers . . . . . . 367Syntax. . . . . . . . . . . . . . . 367Placing events in a form. . . . . . . . . 368DOMActivate . . . . . . . . . . . . 369xforms-deselect . . . . . . . . . . . . 370xforms-disabled . . . . . . . . . . . 372xforms-enabled . . . . . . . . . . . . 373xforms-invalid . . . . . . . . . . . . 374xforms-model-construct . . . . . . . . . 375xforms-model-construct-done . . . . . . . 376xforms-model-destruct . . . . . . . . . 377xforms-optional . . . . . . . . . . . 378xforms-readonly . . . . . . . . . . . 379xforms-readwrite . . . . . . . . . . . 380xforms-ready . . . . . . . . . . . . 381xforms-required . . . . . . . . . . . 382xforms-select . . . . . . . . . . . . 383xforms-submit . . . . . . . . . . . . 384xforms-submit-done . . . . . . . . . . 385xforms-submit-error . . . . . . . . . . 386xforms-valid. . . . . . . . . . . . . 387xforms-value-changed . . . . . . . . . 388

Details on function calls . . . . . . . . . . 389

iv Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 5: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

String functions . . . . . . . . . . . 391Math functions . . . . . . . . . . . . 407Utility functions . . . . . . . . . . . 430Time and date functions . . . . . . . . . 507Header/Footer Functions . . . . . . . . 521Bidirectional functions . . . . . . . . . 532

Details on XForms function calls . . . . . . . 544XPath . . . . . . . . . . . . . . . 544Return types . . . . . . . . . . . . 544Empty return values . . . . . . . . . . 544Boolean functions . . . . . . . . . . . 545Number functions . . . . . . . . . . . 549String functions . . . . . . . . . . . 557DateTime functions . . . . . . . . . . 560Node-set functions . . . . . . . . . . 573Utility functions . . . . . . . . . . . 575

Signature Basics . . . . . . . . . . . . 578Signing a Form . . . . . . . . . . . . 578What the user sees . . . . . . . . . . 579Setting the text that the button displays . . . 580Making signatures mandatory . . . . . . . 581Signing portions of forms . . . . . . . . 582Setting the signature type . . . . . . . . 585Available options for digital signature buttons 608

Quick reference tables . . . . . . . . . . 608

Table of items and form and page globals . . . 608Table of options . . . . . . . . . . . 611Cross reference table for items and options . . 632Destroy Function Quick Reference . . . . . 636

Default sizes . . . . . . . . . . . . . 637Order of precedence of filters . . . . . . . . 638Color table . . . . . . . . . . . . . . 642The XFDL compute system . . . . . . . . . 660

White space in computes . . . . . . . . 661Structure of mathematical and conditionalexpressions . . . . . . . . . . . . . 661Table of operators . . . . . . . . . . . 662Definition of value . . . . . . . . . . 664Quoted strings . . . . . . . . . . . . 664XFDL references to elements . . . . . . . 665Function call syntax . . . . . . . . . . 667Representing and running XFDL computes . . 667XForms and XFDL computes . . . . . . . 673

Notices . . . . . . . . . . . . . . 675Trademarks . . . . . . . . . . . . . . 676

Index . . . . . . . . . . . . . . . 677

Contents v

Page 6: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

vi Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 7: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XFDL Version 7.7

The XFDL Specification describes a class of XML documents called ExtensibleForms Description Language (XFDL) forms and partially describes the behavior ofcomputer programs that process them. An XFDL processor is a software programthat reads, processes, and writes XFDL forms. Processing may include such tasksas GUI rendering, data extraction, or modification.

The XFDL Specification 7.7 is also available as a PDF file: XFDL Specification7.7.pdf

Origin and goalsXFDL is a powerful, complex forms definition syntax that promotes applicationinteroperability and adherence to worldwide Internet standards.

From 1993 to 1998, PureEdge (since acquired by IBM®) developed the UniversalForms Description Language (UFDL). XFDL is the result of developing an XMLsyntax for the UFDL, thereby permitting the expression of powerful, complexforms in a syntax that promotes application interoperability and adherence toworldwide Internet standards. The current design goals of XFDL are to create ahigh-level computer language that:1. Represents forms as single objects without dependencies on externally defined

entities, thus allowing them to act as contractual documents.2. Is represented by human-readable plain text.3. Is a publicly accessible open standard.4. Provides a syntax for inline mathematical and conditional expressions.5. Permits the enclosure of an arbitrary size and number of base-64 encoded

binary files.6. Offers precision layout needed to represent and print dense

business/government forms.7. Facilitates server-side processing via client-side input validation and formatting.8. Permits extensibility including custom items, options, and external code

functions.9. Offers comprehensive signature support, including:v Capture of the whole context of a business transactionv Multiple signersv Different signers of (possibly overlapping) portions of a formv Freezing computations on signed portions of a form

Maintaining the data, logic, and presentation layers in a single, legally bindingdocument is a paradigm shift in electronic commerce, which traditionally separateseach layer. The decision to use a more document-centric model was not madelightly; it was necessary to provide legal non-repudiation.

The original version of XFDL was published as a W3C Note in 1998. A number offeatures of XFDL have since been incorporated into a W3C Recommendation calledXForms in 2003. XForms defines constructs for a standard XML-based data model,input validation, calculations, constraints, and other properties, server submission

© Copyright IBM Corp. 2003, 2009 1

Page 8: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

characteristics, event-based action sequences, and a user interface vocabulary thatincludes the ability to hierarchically group and to iterate user interface controls.XForms standardizes the core business processing model of a web application, butit is designed to be incorporated into host languages that provide extensions asnecessary to satisfy diverse additional requirements of Web applications. XFormsleaves to the host language the task of providing the presentation definition of theuser interface such as fonts and colors and other augmentations. The XFDLlanguage now incorporates XForms and augments its functionality with manyadditional features such as precise layout and digital signatures.

References

[1] Boyer, J. Lexical and Syntactic Specification for the Universal FormsDescription Language (UFDL) Version 4.0. PureEdge Solutions. 6 SEP 1997.

[2] Bray, T., Paoli, J. & Sperberg-McQueen, C.M. (Eds.) Extensible MarkupLanguage (XML) 1.0. W3C Recommendation. http://www.w3.org/TR/1998/REC-xml-19980210.html. 10 FEB 1998.

[3] Clark, J. & DeRose, S. (Eds.) XML Path Language (XPath) 1.0. W3CRecommendation. http://www.w3.org/TR/1999/REC-xpath-19991116.html.16 NOV 1999.

[4] Dubinko, M., Klotz, L., Merrick, R., & Raman, T.V. (Eds.) XForms 1.0.W3C Recommentation. http://www.w3.org/TR/2003/REC-xforms-20031014/.14 OCT 2003.

[5] Gordon, M. (Ed.) UFDL v4.0.1 Specification. PureEdge Solutions. 1993-1998.

TerminologyTerms are defined in Section 1.2 of the XML specification (see Reference [2]).

NotationXFDL forms are XML documents; the form definition is encoded using XMLelements and attributes.

In addition, XFDL imposes many constraints on the contents of the elements andthe values of the attributes. In this specification, the nesting and sequencerelationships between the elements and attributes are given, where possible, inDTD notation, while the constraints on certain attribute values are given in theBNF notation found in the XML specification. The DTD-syntax description of theelements and attributes is ″almost complete″ in that it illustrates XFDL constructsbut not additional markup variations allowed by XML-related standards (e.g.namespace declarations and interspersed elements or attributes in othernamespaces). Furthermore, the content models of some XFDL elements depends onan attribute value, which is also not expressible using DTD notation.

Overlap with other specificationsTo serve its purpose, XFDL requires comprehensive presentation control and datatyping machinery.

This document describes a set of elements and attributes that meet theserequirements. It may be the case that the presentation controls can be replaced by a

2 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 9: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

W3C-specified set of form controls; however, existing specifications allow too muchuser interface flexibility to be suitable for security and non-repudiation purposes.

Non-repudiation and the document-centric modelA digital signature attached to a file accurately identifies the individual who usedit, based on the digital certificate provider’s security and the security of the user’shardware. However, to provide full non-repudiation and auditability, a businesstransaction not only needs to be signed by someone whose identity is verifiable, italso needs to be representative of the context in which it was signed.

With paper-based forms and documents, this is easily accomplished. Everythingthat appears on the signed document is considered part of the transaction.Electronic forms and documents, however, present a more complex problem in thatthe exact appearance and functionality of the document must be signed as well asthe user’s input, or the transaction is meaningless. Legal standards for font sizeand color must also be observed both when the document is signed and when it issubsequently examined.

Digital signature technology alone can provide the first part of the solution, butnot the second. According to the Performance Guidelines for the Legal Acceptanceof Records Produced by Information Technology Systems, as published by theAssociation for Information and Image Managements’ (U.S.), the only way inwhich an electronic document can be considered to provide non-repudiation andauditability is if it contains the following elements, clearly recognizable, in one file:v Individual letters, numbers and symbolsv Combinations of letters, numbers and symbols forming words or sentencesv Graphics, such as signatures, logos, pictures, and so on.v Soundsv Other features of records such as color, shape, texture, and so on, that relate to

the content of the information

XFDL can be used to create forms that meet the above criteria by presenting abusiness transaction as a single entity, which is updated as the user fills it in. Itemvalues are stored in XForms instance data, which appears in the same file thatcontains the user interface and presentation layer markup.

When a user digitally signs a form, the XFDL markup for the presentation layer aswell as the underlying XForms instance data is signed. Subsequently, when theform is opened in an XFDL viewing or processing application, the current XFDLmarkup and XForms instance data are compared to those that were used to createthe digital signature. If any discrepancies exist, the signature is flagged as invalid,and the form no longer provides non-repudiation or auditability.

Secondary documents can also be placed into an XFDL form as attachments, thusenabling the user to sign both the attachments and the form itself.

This method of representing and collecting information in forms and digitallysigning and encrypting them ensures that the identity of the signer can beconfirmed and that the signer can be proven to have signed the full content andcontext of the form.

XFDL Version 7.7 3

Page 10: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Form names and extensionsTo ensure cross-platform compatibility, form names should avoid the use ofcharacters that are illegal under popular operating systems or in URLs. Formnames should also include the .xfdl extension. The extension .xfd can also be used,but it should be avoided if possible.

MIME types

XFDL supports the following MIME types:v application/vnd.xfdlv application/vnd.xfdl.design

Structure of XFDL formsThis section describes the general structure of XFDL forms.

Top-level structureAn XFDL form is an XML 1.0 document whose root element tag is XFDL. Thiselement must be in the XFDL namespace, a URI that includes the major and minorversion of XFDL. For example:[1] <XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"> ... </XFDL>

The XFDL element may contain many namespace attributes. By convention, theXFDL namespace is declared to be the default and it is also assigned to the prefix’xfdl’. Other prefixes that are likely to appear include the ’xforms’ prefix bound tothe XForms 1.0 namespace, the ’xsd’ prefix and possibly the ’xsi’ prefix from XMLschema, the ’ev’ prefix for XML events, and namespace prefixes for the datavocabulary being processed by the XFDL form.

The XFDL element must contain a <globalpage> element as the first child element,followed by one or more <page> elements.[2] <!ELEMENT XFDL (globalpage, page+)>

The <globalpage> element must contain a single <global> element, which cancontain zero or more option elements. These are referred to as form global options;they typically contain information applicable to the whole form or default settingsfor options appearing in the element content of pages. The <globalpage> and<global> elements must contain an attribute called sid which must be set to thevalue global. Although the attribute has a fixed value, it is still required becauseXFDL processors must be able to clearly identify global objects by sid even in thepresence of interspersed custom elements in non-XFDL namespaces.[3] <!ELEMENT XFDL (globalpage, page+)>

[4] <!ELEMENT global (%options;*)>

[5] <!ATTLIST globalpage sid CDATA #REQUIRED #FIXED "global">

<!-- This rule is only intended to communicate the restriction withDTD-like notation; DTDs don't allow required and fixed (XML Schema does)

-->

A <page> element contains a <global> element followed by zero or more ’item’elements. The options in the page’s global element typically contain informationapplicable to the whole page or default settings for options appearing withinelement content of items. The page global options take precedence over form

4 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 11: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

global options. A page is also required to have a ’sid’ attribute, which provides anidentifier that is unique among all <page> elements (sid is short for scopeidentifier). The ’sid’ attribute value must not be the word ’global’ and is otherwisea letter followed by any combination of zero or more letters, digits andunderscores.[6] <!ELEMENT page (global, %items;*)>

[7] <!ATTLIST page sid CDATA #REQUIRED>

[8] sid ::= (Letter | Special) (Letter | Special | Digit | '_')* -('global')

[9] Letter ::= [A-Z] | [a-z]

[10] Digit ::= [0-9]

[11] Special ::= [0x00C0-0x00FF] - (0x00D7 | 0x00F7)

The intention of using multiple pages in a form is to show the user one page at atime. Each page should contain items that describe GUI widgets including itemsthat allow users to switch to different pages without necessarily contacting a serverprogram. XFDL allows the page switching items to be defined in the form so theform developer can add computations that control the flow of pages based oncontext.

Overview of XForms modelsThe ’xformsmodels’ option is an important form global option that contains one ormore <xforms:model> elements. It is recommended that a form contain only oneXForms model, however, multiple models are allowed (though they have no abilityto interact).

An XForms model has a number of possible components, but the principalcomponents that it defines are as follows:v One or more instances of XML data over which the form operates. Instances

usually appear directly within the form, but they may also be externallyreferenced

v Optional XML schema definitions for the data instances. If XML schema areused, they are often externally referenced, but they may be placed directlywithin an XForms model.

v Model Item Property (MIP) Definitions:– calculate – Defines an XPath formula with a string result that gives the

content (value) of a node of instance data.– constraint – Defines an XPath formula with a Boolean result that helps

determine the validity of a node of instance data.– readonly – Defines an XPath formula with a Boolean result that helps

determine whether a node is modifiable.– relevant – Defines an XPath formula with a Boolean result that helps

determine whether a node is relevant to processing. By default, the GUIwidgets bound to non-relevant nodes are invisible and inactive (unlessoverridden by the appropriate XFDL options), and they are not submitted.

– type – Defines a static string (not a dynamic XPath formula) that gives a basicschema data type for a node of instance data (these can be assigned withoutusing an XML schema definition).

v Parameters for submission of data to a server (e.g. an http or https URL, amethod of get or post, and an indication of whether the result should replace adata instance or replace the entire form). The XForms submission processremoves non-relevant instance data nodes.

XFDL Version 7.7 5

Page 12: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The XFDL items that define GUI widgets include within their content XFormscontrols that allow the GUI widgets (as well as invisible ’custom’ items) to connectto instance data in the XForms models. Modifications of the XFDL items cause datato be pushed through the user interface bindings of the XForms controls and intothe instance data. The formulae definitions in the XForms model are then executedautomatically, resulting in changes to calculated values as well as updates tovalidity constraints and other model item properties. All of the changes to values,validity and properties that were made by an XForms model are then percolatedback out to the user interface layer by modifications to the GUI widgets and otherXFDL items.

The full validity of a node of instance data is assessed by combining underBoolean-And the conformance of its content to any XML schema declarations forthe node, to the schema type given by the type MIP, and to the formula given byits constraint MIP (if any of these are defined).

An instance node with a non-relevant or readonly ancestor is non-relevant orreadonly regardless of any state directly declared for the node. Whilenon-relevance and readonly status are inherited, the converse is not true. If everyancestor of a node is relevant or not readonly, then the node’s relevance andreadonly status are determined by the direct settings for the node (if any, ordefaults otherwise).

ItemsAn item is a single object in a page of a form. Some items represent GUI widgets,such as buttons, check boxes, popup lists, and text fields. Other items are used tocarry information such as attached word processing documents or digitalsignatures.

Each item must have a sid attribute, which provides a scope identifier thatuniquely identifies the item from among all child items of its parent element.

An item can contain zero or more option elements. The options define thecharacteristics of the item, and many take default values if not defined. XFormsuser interface controls appear as options of XFDL items, and the XFDL item is saidto be the skin of the XForms form control that it contains.[12] <!ELEMENT %items; (%options;*)>

[13] <!ATTLIST %items; sid CDATA #REQUIRED>

XFDL allows elements in custom namespaces to appear at the item level (as longas they contain an xfdl:sid attribute). To define the items available in the XFDLnamespace, the parameter entity reference to ″%item;″ could be defined partiallyas:[14] <!ENTITY % items "(action | box | button | check | checkgroup |

combobox | data | field | label | line | list | pane | popup |radiogroup | signature | slider | spacer | table | toolbar)">

The details of each type of item listed in the rule above are discussed in “Detailson XFDL items” on page 29, but are summarized here for your convenience.

action A non-visible item that can perform similar tasks to a button (print, cancel,submit, and so on) either after a certain period of time or with a regularfrequency.

|Skin for: <xforms:submit>, <xforms:trigger>

box An item that provides a graphic effect used to visually group a set of the

6 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 13: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

GUI widgets on the page. A box is drawn under all widgets on a page.This item is useful in some circumstances, but it is usually better to use apane item (see below) to both visually and logically group related userinterface elements.

button Performs one of a variety of tasks when pressed by the user, such assaving, printing, canceling, submitting, digitally signing the form, viewingdocuments enclosed in the form, and so on. A button can have a text orimage face.

Skin for: <xforms:submit>, <xforms:trigger>, <xforms:upload>

check Defines a single check box.

Skin for: <xforms:input>

checkgroupDefines a group of check boxes that operate together to provide amultiselection capability.

Skin for: <xforms:select>, <xforms:select1>

comboboxAn edit field combined with a popup list; its value can be either selectedor typed.

Skin for: <xforms:select1> (select or type input), <xforms:input> (dateselector)

data Used to carry binary information using base-64 encoding and compression,such as enclosed files or digital images, using base-64 encoding. This itemappears when advanced XFDL enclosure mechanisms are used. When abasic <xforms:upload> is used, the data appears in an <xforms:instance>data node.

field Used to capture single- or multiple-line textual input from the user; itincludes input validation and formatting features as well as enriched textcapabilities.

Skin for: <xforms:input> (single-line text), <xforms:secret> (single-line,write-only), <xforms:textarea> (for multiline plain text or enriched text)

label Shows either an image or a single or multiple line text value.

Skin for: <xforms:output>

line A simple graphic effect used as a separator.

list Shows a list box populated with choices from which the user may selectone.

Skin for: <xforms:select>, <xforms:select1>

pane Provides an hierarchic grouping capability for other items that are definedwithin the content of the pane. Also, may provide the ability to switchbetween multiple groupings.

Skin for: <xforms:group>, <xforms:switch>

popup Shows either the text of the currently selected choice or a label if there isno selection; the popup provides a small button that causes the list ofselectable choices to appear, from which the user may select one.

Skin for: <xforms:select1>

XFDL Version 7.7 7

Page 14: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

radiogroupDefines a group of radio buttons. Initially none may be selected, but amaximum of one radio button can be selected within the group.

signatureReceives the signature that ultimately results when a user presses asignature button.

slider Creates a sliding control, similar to a volume control, that lets the user seta value within a specific range.

Skin for: <xforms:range>

spacer An invisible GUI widget that facilitates spacing in the relationalpositioning scheme.

table Provides a template of XFDL items that are to be duplicated according tothe amount of data available to be displayed. This item provides the abilityto dynamically adjust the form rendition based on the amount of data andthe amount of changes to that data.

Skin for: <xforms:repeat>

toolbar Items associated with a toolbar item appear in a separate window paneabove the pane for the form page; it is the typical location for pageswitching and other buttons as its contents are not printed if the form isrendered on paper.

Note: The parameter entity %items is not intended as a formal definition of thecontent model of a page (after the global element). It is only intended to presentthe list of items. The items could be explicitly namespace qualified with a prefixbound to the XFDL URI (given in Rule 1). Moreover, XFDL permits form authorsto intersperse custom elements among the items as long as those elements have a’sid’ attribute in the XFDL namespace. Custom elements can be used, for example,to carry complex instructions and logic for server-side components. While simplestatic application-specific information could be represented with XML processinginstructions, many server side applications (e.g. workflow and database requests)require complex instructions that can include the use of the XFDL compute systemto collect information from around the form. For more information, see<custom_option>.

Options and array elementsAn option defines a named property of an item, page, or form. Options can appearas form globals, page globals, or as the contents of items. Array elements definesthe settings within an option. The parameter entity reference to ″%option;″ couldpartially be defined as follows:[15] <!ENTITY % options "(xformsmodels | xforms:input | xforms:secret |

xforms:textarea | xforms:range | xforms:select1 | xforms:select |xforms:trigger | xforms:submit | xforms:upload | xforms:output |xforms:repeat | xforms:group | xforms:switch | acclabel |activated | active | bgcolor | border | colorinfo | coordinates |cursortype | data | datagroup | delay | direction | dirtyflag | display |enclosuresettings | excludedmetadata | filename | filesize | first | fontcolor |fontinfo | format | formid | fullname | image | imagemode | itemlocation |justify | label | labelbgcolor | labelborder | labelfontcolor | labelfontinfo |last | layoutflow | layoutinfo | linespacing | mimedata | mimetype | next |numericshaping | orderingscheme | orientation |padding | pageid |previous | printbgcolor | printfontcolor | printlabelbgcolor |printlabelfontcolor | printsettings | printvisible |readonly | requirements | rowpadding | rtf | saveformat | scrollhoriz |scrollvert | signature | signatureimage | signdatagroups | signdetails |

8 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 15: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signer | signformat | signgroups | signinstance | signitemrefs |signitems | signnamespaces | signoptionrefs | signoptions |signpagerefs | size | suppresslabel |texttype | thickness |transmitdatagroups |transmitformat | transmitgroups | transmititemrefs |transmititems |transmitnamespaces |transmitoptionrefs | transmitoptions |transmitpagerefs | triggeritem | type | url | value | visible | webservices |writeonly | xformsenabled | xformsreadonly | xformsrequired | xformsvalid)">

Again, the definition is partial because XFDL supports namespace qualification ofoptions as well as the interspersion of custom options in non-XFDL namespaces.Typically, application-defined options occur in application-defined items, but theyare also sometimes used in XFDL-defined items to store intermediate results ofcomplex computations, thereby allowing the form developer to arbitrarily breakdown a problem into manageable pieces. For more information, see “<customoption>” on page 298.

Also, note that only a subset of these options is valid for any XFDL item. Forexample, an xforms:repeat is only valid in a table item. The XFDL options are fullydiscussed in “Details on options and array elements” on page 72 and aresummarized in the following sections.

XForms-related options<xforms:input>

Binds to a node of instance data for the purpose of collecting/presenting asingle line of text or piece of information. A <field> presents the text, andautomatically translates various data types like dates and currencies toschema compliant values. A <check> item appears checked or uncheckedbased on an xsd:boolean interpretation of the bound instance node. The<combobox> skin is specific to date selection. A custom item skin can beused to help move any data from the XFDL layer to the instance.

<xforms:secret>Binds to a node of instance data for the purpose of collecting a single-linepassword. A <field> contains this option and presents itself as write-only.

<xforms:textarea>Binds to a node of instance data for the purpose of collecting/presentingmultiline plain text or enriched text in a <field> item.

<xforms:output>Presents text or an image in a <label> item. If the control binds to a nodeof instance data, and the mediatype attribute contains an image-relatedtype (e.g. image/*), then an image is presented. Otherwise, text ispresented.

<xforms:select1>Provides the ability to select one from a set of choices. The presentation ofthe set of choices is governed by the item type that skins the control,which can be <popup>, <combobox>, <list>, <checkgroup>, or<radiogroup>

<xforms:select>Provides the ability to select choices from a set of choices presented by a<checkgroup> or <list>.

<xforms:submit>Provides the ability to activate an <xforms:submission> appearing in anXForms model, as the result of activating either an XFDL <button> or<action> item.

XFDL Version 7.7 9

Page 16: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:trigger>Provides the ability to activate a sequence of XForms actions, as the resultof activating either an XFDL <button> or <action> item.

<xforms:upload>Provides the ability for an XFDL button to attach content from the localcomputer system to a form by placing an encoded version of it into anindicated instance node.

<xforms:group>Allows a set of user interface controls to be packaged together, visuallyand logically, with the <pane> item skin.

<xforms:switch>Appears in a <pane> skin item and offers grouping capabilities similar toan <xforms:group> except that multiple grouping cases can be specifiedand switched to during the run of the form.

<xforms:repeat>Appears in the <table> item and provides the ability to iterate its contentof XFDL items once per node in a set of nodes selected from the XFormsinstance data.

<xforms:range>Sets the range of values a user can select with a <slider> item.

Options in the XFDL namespaceacclabel

Provides a special description of input items that is read by screen readingsoftware.

active Specifies whether an item is active or inactive. In XFDL items containingXForms controls, the default for this option is set by the relevant modelitem property.

bgcolor, fontcolor, labelbgcolor, and labelfontcolorSpecify the colors for an item or its label using either predefined names orRGB triplets in decimal or hexadecimal notation.

border and labelborderControl whether an item or its label has a border.

colorinfoRecords the colors used to draw the form when the user signs the form.This is only necessary when the operating system colors are used insteadof the colors defined in the form (which is a feature for users with visionimpairments).

coordinatesReceives the location of a mouse click on an image, if the image is in abutton.

cursortypeDisplays different cursor icons when the user hovers over a button.

data and datagroupUsed to create an association between data items and the buttons thatprovide file enclosure functionality.

delay Used in an action item to specify the timing for the event and whether itshould be repeated.

10 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 17: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

enclosuresettingsSets limits on the size and type of files that users can attach to a form.

excludedmetadataUsed to store special information that is automatically excluded fromsignatures.

filename, filesize, and mimetypeGive additional information about an enclosed document.

fontinfo and labelfontinfoDefines the typeface, point size, and special effects (bold, italics, andunderline) for the font used to display the item’s value or label.

formatContains sub-elements that parameterize input validation for the item’svalue.

formidDefines a unique identifier for the form, such as a serial number.

fullname, layoutinfo, signature, signatureimage, signdatagroups, signdetails,signer, signformat, signgroups, signinstance, signitemrefs, signitems,signnamespaces, signoptionrefs, signoptions, and signpagerefs

Work together to provide a full-featured digital signature as defined in“Origin and goals” on page 1 (goal 9).

image Identifies the data item containing the image for the button or label.

imagemodeSpecifies the display behavior of the image within the data item; the imagemay be clipped, resized, or scaled to fit the item.

itemlocation, size and thicknessHelp to define the location and size of the item.

justify Controls whether text in the item should be left, center, or right justified.

label Associates a simple text label with the item; labels can also be createdindependently with a label item.

linespacingAdjusts the spacing between lines of text in an item.

mimedataUsed to store large binary data blocks encoded in bas-64 gzip compressedor base-64 format.

next and previousLink the item into the tab order of the page.

paddingDefines how much extra white space is put around the pane item.

pageidDefines a unique identifier for a page, such as a serial number.

printbgcolor, printlabelbgcolor, printfontcolor, and printlabelfontcolorProvide the ability to set printing colors for each indicated option differentfrom the display colors on the screen.

printvisibleDetermines whether an item should be visible when the form is printed.Has no effect on the visibility of the item on the screen.

XFDL Version 7.7 11

Page 18: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printsettingsParameterizes the paper rendition of a form.

readonlySets the item to be readonly. In XFDL items containing XForms controls,the default for this option is set by the readonly model item property.

rowpaddingDefines how much space is applied to the top and bottom of a table row.

rtf Contains the rich text value of rich text fields.

requirementsSpecifies the requirements for the Web Services to be used by the form.

saveformat and transmitformatControl how the form is written (XFDL, HTML) when it is saved orsubmitted.

scrollhoriz and scrollvertControl whether a text field item has horizontal and vertical scroll bars orwhether it wordwraps, allows vertical sliding, and so on.

suppresslabelSuppresses the built-in label for some items, so that the label is not showneven if the label option or xforms:label option is set.

texttypeSets whether a field contains plain text or rich text.

transmitdatagoups, transmitformat, transmitgroups, transmititiemrefs,transmititems, transmitnamespaces, transmitoptionrefs, transmitoptions, andtransmitpagerefs

Work together to allow you to transmit form submissions.

triggeritemSet in the form globals to identify which action, button, or cell activated aform transmission or cancellation.

type Specifies whether the action, button, or cell item will perform a networkoperation, print, save, digitally sign, and so on.

url Provides the address for a page switch, or for a network link orsubmission.

value Holds the primary text associated with the item. In XFDL items thatcontain XForms controls, this option (and all options, such as those that arecomputed) are treated as transient, which means that any updates to thecontent are not serialized when the form is written because the updates arereflected in instance data.

visibleDetermines whether the item should be shown to the user or madeinvisible.

webservicesDefines the nameof the Web Services used by the form.

writeonlySets the item to be writeonly. This option is only for use with field itemsthat do not skin XForms controls.

12 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 19: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Implicit optionsThere are some options that are defined within XFDL for the purpose of allowingthem to be referenced without being defined by the form author. These options aredynamically added to the document object model (DOM) of the XFDL form whileit is being processed, and they are removed when it is serialized. These optionstend to be informational in nature or representative of events that can occur whilethe form is being processed.

activated, focused, and mouseoverIndicate whether the form, page or item has been activated or focused orcontains the mouse pointer.

dirtyflagIn the form global item, this option indicates whether the end-user of theform viewing program has changed the form.

focuseditemAt the page global level, records the scope identifier of the item thatcurrently has the focus.

itemprevious, itemnext, itemfirst, itemlastUsed to help create a doubly linked list of items in each page. Theitemprevious and itemnext options occur in each item, and itemfirst anditemlast appear at the page global level.

keypressRecords a keypress by the user that was not used as input to an XFDLitem. The keypress is propagated upwards to the page and form globalitems.

pageprevious, pagenext, pagefirst, pagelastUsed to help create a doubly linked list of pages in the form. Thepageprevious and pagenext options occur in each page, and pagefirst andpagelast appear at the form global level.

printingIn the form global item, this option indicates whether the form is currentlyprinting.

versionAppears in the form global item and defines the version of XFDL used towrite the form. It is obtained from the XFDL namespace declaration.

xformsenabledIndicates whether or not the XFDL item contains XForms controls.

xformsreadonlyIndicates to the XFDL compute system whether or not the bound XFormsinstance data is xformsreadonly.

xformsrequiredIndicates to the XFDL compute system whether or not the bound XFormsinstance data is required to have a value.

xformsvalidIndicates to the XFDL compute system whether or not the bound XFormsinstance data is valid.

Content models for XFDL optionsThe content of an option can take one of two formats: simple character data or asubtree of XML elements. In the latter case, the element children are typicallyreferenced as a zero-based array. The XFDL-specific options that have simple

XFDL Version 7.7 13

Page 20: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

content versus array content are defined by the parameter entity references%simpleOption; and %arrayOption; below:[16] <!ENTITY % simpleOptions "(acclabel | activated | active | bgcolor |

border | data | dirtyflag | filename | filesize | focused | focuseditem |fontcolor | formid | fullname | image | imagemode | justify |keypress | label | labelbgcolor | labelborder | labelfontcolor |linespacing | mimedata | mimetype | mouseover | next | orientation |padding |pageid | previous | printbgcolor | printfontcolor | printing |printlabelbgcolor | printlabelfontcolor | printvisible | readonly |rowpadding | rtf | saveformat |scrollhoriz | scrollvert | signature |signatureimage | signer | signformat | texttype | thickness |transmitformat | triggeritem |type | ufv_settings | url | value |version | visible | writeonly | xformsenabled)">

[17] <!ELEMENT %simpleOptions; (#PCDATA)>

[18] <!ENTITY % arrayOptions "(colorinfo | coordinates | datagroup | delay |display | enclosuresettings | excludedmetadata | fontinfo | format |itemlocation | labelfontinfo | layoutflow | layoutinfo | printsettings |requirements | signdatagroups | signdetails | signitemrefs | signitems |signnamespaces | signoptionrefs | signoptions | signpagerefs |size | transmitdatagroups | transmitgroups | transmititemrefs |transmititems | transmitnamespaces | transmitoptionrefs |transmitoptions | transmitpagerefs | ufv_settings | webservices)">

While the simple options are clearly shown above to contain character data, thefurther details of their content models are not shown. For example, all coloroptions support specification of an RGB triplet using either #RRGGBB inhexadecimal or rrr,ggg,bbb in decimal as well as any color name given in “Colortable” on page 642.

The array options defined above also each contain sub-elements that could containeither simple character data or further element depth. The following are thecontent models of the various array options, where all undefined elements resolveto simple character content (PCDATA):[19] <!ELEMENT colorinfo (window,windowtext,borderlight,bordershadow,

buttonface,buttontext)>

[20] <!ELEMEMT coordinates (x,y)>

[21] <!ELEMENT datagroup (datagroupref+)>

[22] <!ELEMENT delay (type,interval)>

[23] <!ELEMENT excludedmetadata (servernotarizations)>

[24] <!ELEMENT servernotarizations (notarization+)>

[25] <!ELEMENT fontinfo (fontname, size, effect+)>

[26] <!ELEMENT format (datatype (date, day_of_month, day_of_week,date_time, currency, float, integer, month, string, time, void,year)*, presentation (calendar, casetype, currencylocale,decimalseparator,fractiondigits, groupingseparator, keepformatindata,negativeindicator, pad, padcharacter, pattern, patternrefs, round,separator, showcurrency, significantdigits, style)*, constraintscasesensitive, checks, decimalseparators, groupingseparators, length,mandatory, message, patterns, range, separators, template, yearwindow)*)>

[27] <!ELEMENT itemlocation (x | y | width | height | offsetx | offsety |above | after | before | below | within | alignb2b | alignb2c | alignb2t |alignc2b | alignc2l | alignc2r | alignc2t | alignhorizbetween |alignhorizc2c | alignl2c | alignl2l | alignl2r | alignr2c | alignr2l |alignr2r | alignt2b | alignt2c | alignt2t | alignvertbetween |alignvertc2c | alignb2b | expandb2c | expandb2t | expandl2c |expandl2l | expandl2r | expandr2c | expandr2l | expandr2r | expandt2b |expandt2c | expandt2t)+>| expandheight| expandwidth

[28] <!ELEMENT labelfontinfo (fontname, size, effect+)>

[29] <!ELEMENT layoutinfo (pagehashes (pagehash (pageref, hash))+)>

14 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 21: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

[30] <!ELEMENT printsettings (pages, dialog, border, pagelayout,radiosaschecks, radioswithoutvalues, scroll barsonfields,singlelinefieldsaslines)>

[31] <!ELEMENT pages (filter, pageref+)>

[32] <!ELEMENT dialog (active, copies, orientation, printpages)>

[33] <!ELEMENT printpages (active, choice)>

[34] <!ELEMENT requirements (requirement*, detected)>

[35] <!ELEMENT (signdatagroups | transmitdatagroups) (filter, datagroupref+)>

[36] <!ELEMENT signdetails ((dialogcolumns (property+))?, (filteridentity(filter (tag, value))+)?)>

[37] <!ELEMENT (signitemrefs | transmititemrefs) >

[38] <!ELEMENT (signitems | transmititems) >

[39] <!ELEMENT (signnamespaces | transmitnamespaces) >

[40] <!ELEMENT (signoptionrefs | transmitoptionrefs) >

[41] <!ELEMENT (signoptions | transmitoptions) >

[42] <!ELEMENT (signpagerefs | transmitpagerefs) >

[43] <!ELEMENT size (width, height)>

[44] <!ELEMENT webservices (wsdl*)>

[45] <!ELEMENT xformsmodels (xforms:model+)>

For any character data option or array element in XFDL, an encoding attribute canbe specified for the content. As shown below, the content model of simple optionsis character data. The values “xml” (for plain text), “base64” and “base64-gzip” canbe used in the encoding attribute. The default is ’xml’ except for the mimedataoption, which as “base64-gzip” as the default. A content encoding of base64 isuseful if the content being encoded is already in a compressed format, such asPNG or JPEG. If the encoding is not “xml” then an XFDL-compliant processorapplies the requisite decoders before interpreting the content in the applicationcontext, and it applies the appropriate encoders during serialization. The XFDLencoding attribute can also be used on custom options and array elements, but itwould have to be namespace qualified since custom options are in a non-XFDLnamespace.

Any character data option or array element can be qualified with the transientattribute. The valid values are on and off, with a default of off for options andarray elements in XFDL items not containing XForms user interface elements andon in XFDL items that do contain XForms user interface controls. When an optionor array element is transient, its content can be changed during run time, but theoriginal content obtained when the form was read will be restored uponserialization. In an XFDL item whose <value> option is controlled by an XFormsuser interface binding, the instance data holds the current value bound to thecontrol, so there is no need for the presentation layer node to be changed.Transience allows options and array elements to be changed during runtime of theform without breaking a digital signature over the option.

The content of any character data option or array element can also be qualified bya compute attribute, which defines an expression used to obtain and update thecontent based on content elsewhere in the form. Typically, computations over dataare performed in an XForms model using the <xforms:bind> element and itscalculate attribute or other model item properties such as constraint, readonly,relevant, and required. However, calculations of presentation layer properties areperformed with XFDL computes, and where they are dependent on instance data,they reference the transient <value> option of a user interface item bound to thatdata. The details of XFDL computes appear in “The XFDL compute system” onpage 660

XFDL Version 7.7 15

Page 22: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

page 660, the basic idea can be gleaned from the following example, which showslabel that turns red when the value is negative:

<label sid="IncomeTax"><xforms:output ref="incomeTax/Total"/><fontcolor compute="value >= '0' ? 'black' : 'red'"/>

</label>

At the start-up, the fontcolor option has empty content. When the XForms userinterface binding creates the <value> option and places the purchase order totalvalue into it, then the compute in the fontcolor is automatically evaluated, with aresult of either red or black. When the form is serialized, e.g saved to disk,submitted or signed, the fontcolor content rendered into the serialization is emptybecause all options in an XForms controlled XFDL item are transient. Thus, XFDLcomputes can run even if the label item is signed because the countenance of thelabel can only be changed if the data changes, which can only occur if the data isnot signed.

LocalesXFDL forms are designed to be locale and language aware. This means that eachform is designed for a specific language and set of locales. Locale support isidentified through the xml:lang attribute. This attribute is primarily added to theXFDL tag in the form, and identifies which locale the form was designed for.

For example, the following form was designed for the English U.S. locale:<XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7" xml:lang="en-US">

Note: If the xml:lang attribute is not included on the <XFDL> tag, it defaults tothe en-US locale.

For more information:v About the locales supported, refer to the Locales Specification for XFDL.v Regarding language codes, see:

http://www.loc.gov/standards/iso639-2/englangn.html#ef

v Regarding country codes, see:http://ftp.ics.uci.edu/pub/websoft/wwwstat/country-codes.txt

Note: Reference to external Web sites are provided for your convenience only, andIBM makes no representations or warranties, expressed or implied, regarding anyinformation or materials posted on such Web sites.

Characters in character data contentThe ampersand (&) and left angle bracket (<) are not permitted in character datacontent of XML elements, since these characters mark the beginning of entityreferences and XML tags, respectively. There may be occasions in which adeveloper needs to include these in XFDL character content (for example, e-mailURLs). In such cases, the developer can include the ampersand and left anglebracket in a few different ways, such as using the XML entities &amp; and &lt; orsimply wrapping the character content in a CDATA section. The character sequence]]>, which normally cannot appear in character data content, appears in a CDATAsection as the delimiter token that marks the end of a CDATA section. When thesequence ]]> appears as character data, then the right angle bracket (>), ifnecessary, should be expressed with an entity reference such as &gt;.

16 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 23: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

These rules apply to all XFDL elements, but they are often used when constructinge-mail URLs, which use the ampersand to indicate additional parameters. Forexample:

<url><![CDATA[mailto:[email protected]?body=Hello]]></url>

Base-64 and compressed encoding of binary dataIn XFDL, option and suboption elements are allowed to store base-64 encoded andcompressed base-64 encoded binary data such as signatures, images, enclosedword processing or spreadsheet documents, and so on. XFDL allows an encodingattribute to control whether an element contains data in a format other than plainXML character data. Both compressed and uncompressed base-64 encoding use nocharacters that are illegal in character data. Typically, based-64 and compressedbase-64 encodings are used with the <mimedata> option in XFDL.

Since binary data tends to be long, XFDL processors are expected to ″pretty print″the lines of base-64 (whether or not the binary data is first compressed). Each levelof element depth beyond the root <XFDL> tag corresponds to three spaces. Thefirst line of base-64 is expected to be on the line after the element start tag, and thelines of base-64 are expected to be indented three spaces more than the elementstart tag. For example, the <mimedata> option’s start tag is indented 9 spaces(three for the page level, three for the item level and three for the option level), soeach line of base-64 content in a <mimedata> option begins with 12 spaces. Thisshould be followed by 76 characters of base-64 (except for the last line), then alinefeed (not a return-newline sequence). Thus, the element end tag is on the lineafter the last line of base-64 content. The end tag is indented so that it aligns underthe start tag (e.g. indent 9 spaces for the <mimedata> option).

The above method describes the creation of new base-64 encoded content.However, the normal XML preservation of white space in element content shouldbe used when reading XFDL forms so that prior white space indenting techniquesused with older XFDL forms and by custom options that use the XFDL encodingattribute will continue to function properly (esp. with regard to digital signaturevalidation).

Scope identifiers (sid)An XFDL scope identifier, or sid, uniquely identifies an element within the scopeof its logical parent. Each <page> element must have a sid attribute that uniquelyidentifies the page within the surrounding XFDL form element. An item elementmust have a sid attribute that uniquely identifies the item within the surroundingpage element.

When an item appears in an <xforms:group>, <xforms:repeat> or a case of an<xforms:switch>, then the scope identifier uniquely identifies the item within thegroup, switch case or repeat template. When a repeat template is instantiated foreach node in the repeat nodeset, the items generated are unique within eachtemplate instance (each logical row of a table).

In XFDL, each option element is defined to be uniquely identified within the scopeof the surrounding item element by its XML tag, which is why options (and arrayelements) do not require a sid attribute.

Adding comments to XFDLComments are text added to the form that is ignored by XFDL processors. Thisallows form developers to document the form from within the XFDL source code.

XFDL Version 7.7 17

Page 24: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This helps subsequent form and application developers to immediately understandthe purpose of a particular block of markup, such as a complex compute orfunction call. Comments are always wrapped in a special sequence of charactersthat indicate the beginning and end of a comment section.

XFDL respects the standard XML comment style, which opens with <! -- and closeswith -->. For example:

<! -- This is a code comment. -->

Because XFDL is an XML vocabulary, comment blocks can be of any length, fromone line to multiple lines.

Document reproducibilityXFDL processors are expected to preserve the XML prolog and epilog, thecomments within the XFDL element, and all attributes appearing in start tags butnot specifically defined by XFDL. The attributes must be associated with theirrespective start tags, and the comments must be associated with the respectivepages, items, options, or array elements to which they apply. Additionally, allforeign-namespaced elements and attributes must be preserved. The XFDLprocessor must be able to reproduce these language components for signatures andfor saving or transmitting the form.

Small XFDL form examplesThe first example in Figure 1 is designed to show a whole XFDL form. After theXML prolog, the root XFDL element declares the XFDL namespace URI to be thedefault namespace, and it binds the prefix xfdl to the XFDL namespace and theprefix xforms to the XForms namespace. Implicit in the XFDL namespace URI isthe XFDL language version (7.7) to which the form complies. There is a formglobal variable stating that all pages should have a light gray background color.However, the page global background color is set to cornsilk. Since page globalsoverride form globals, the page will have a cornsilk background (see “Color table”on page 642 for a list of valid color names in XFDL).

The form global also contains an XForms model, which creates a datasetrepresenting the three sides of a triangle (a, b, and c). The model also includes a<bind> element that set sets the value of c based on the values of a and b usingthe Pythagorean theorem.

The page global item contain a label option that declares the caption bar text forthe window used to display the page. Note that label is a keyword that is usedboth as an item type and an option scope identifier. Widgets such as fields andcomboboxes can have text labels associated with them, but image and text labelscan also be placed anywhere on the form, so a separate label item is required inthe language.

After the global options, the page contains three fields that are bound to the a, b,and c elements in the data model. The first two fields collect side lengths for aright angle triangle. The third fields displays the length of the hypotenuse, whichis automatically calculated by the <bind> in the data model based on the length ofthe other two sides. The readonly option is added to prevent the user fromaccidentally overwriting the value for field C.

18 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 25: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<?xml version="1.0" encoding="UTF-8"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns:xforms="http://www.w3.org/2002/xforms"><globalpage sid="global">

<global sid="global"><xformsmodels>

<model xmlns="http://www.w3.org/2002/xforms"><instance>

<data xmlns=""><a>3</a><b>4</b><c></c>

</data></instance><bind nodeset="c" calculate="power(../a * ../a +

../b * ../b, 0.5)"/></model>

</xformsmodels><bgcolor>lightgrey</bgcolor>

</global></globalpage><page sid="PAGE1">

<global sid="global"><label>Pythagorean Theorem Form</label><bgcolor>cornsilk</bgcolor><fontinfo>

<fontname>Times</fontname><size>24</size><effect>plain</effect>

</fontinfo></global><field sid="side1">

<xforms:input ref="a"><xforms:label>Enter length of side 1:</xforms:label>

</xforms:input><labelfontinfo>

<fontname>Times</fontname><size>24</size><effect>bold</effect>

</labelfontinfo></field><field sid="side2">

<xforms:input ref="b"><xforms:label>Enter length of side 2:</xforms:label>

</xforms:input><labelfontinfo>

<fontname>Times</fontname><size>24</size><effect>bold</effect></labelfontinfo>

</field><field sid="Hypotenuse">

<xforms:input ref="c"><xforms:label>The hypotenuse length is:</xforms:label>

</xforms:input><labelfontinfo>

<fontname>Times</fontname><size>24</size><effect>bold</effect></labelfontinfo>

<readonly>on</readonly></field>

</page></XFDL>

Figure 1. A Simple XFDL FormXFDL Version 7.7 19

Page 26: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The second example in Figure 2 (below) omits the XML prolog and thedeclarations for the root XFDL element and page. The example only shows twoitems. It is designed to demonstrate deeper element depth and more computesthan the form shown in Figure 2.

The first item is a field that purports to ask the user what portion of a bill, such asa credit card bill, will be paid. The format option contains a number of arrayelements. The first element sets the data type to ’currency’, which indicates thetype of user input that is permitted.

The <presentation> elements determine how user input is displayed. In this case,there is only one setting, which stipulates that the dollar symbol should beappended to the user’s input.

The <constraints> elements further restrict user input. The first setting turns the’mandatory’ status on, which means that input is required in that field (i.e.,emptiness is not a permitted response). The second constraint, named ’range’,contains an array of two elements that define the lower and upper bounds of theuser’s input. For a credit card bill, the range of payment is typically boundedabove by what the cardholder owes and bounded below by some small percentageof the current balance. Thus, the format option shows the possibility of unlimitedarray element depth as well as the inclusion of computes deep within the elementhierarchy. XFDL offers what is known as a fine-grain compute system.

The second item element in Figure 2 is a label that demonstrates a longer computeexpression, including several array element references. Note that at the end of thecompute, the 700 is concatenated to the end of the string rather than added to the35. Because addition is left associative, the entire portion of the string prior to the700 has already been constructed. Therefore, due to run time type identification,the last + operator performs string concatenation, not a mathematical addition.

<field sid="PayNow"><label>

What portion of this bill do you want to pay now?</label><value></value><format>

<datatype>currency</datatype><presentation>

<showcurrency>on</showcurrency></presentation><constraints>

<mandatory>on</mandatory><range>

<min compute="Balance.value * '0.05'">35</min><max compute="Balance.value">700</max>

</range></constraints>

</format></field><label sid="DemonstrateSuboptionReferencing">

<value compute="PayNow.format[datatype] + ' ' + &#xA;PayNow.format[presentation][showcurrency] + ' ' &#xA;+ PayNow.format[constraints][range][min] + &#xA;PayNow.format[range][max]">currency on 35700</value>

</label>

Figure 2. Example of Suboption Array Elements

20 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 27: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

About signing formsDigital signature technology provides part of the solution for creatingnon-repudiation in a document-centric model. As such, XFDL supports theapplication of digital signatures to any XFDL document. However, to properlyimplement support for digital signatures, both common use scenarios and overallsecurity must be considered.

For example, signatures are often used to sign only a portion of a document.Furthermore, a secondary signature is often used to sign the rest of the documentwhile also endorsing the first part of the document. The classic example of this isthe “For Office Use Only” section in any form. The implementation of digitalsignatures in XFDL must support scenarios like this, allowing both for filtering ofwhat is signed and for overlapping signatures.

Furthermore, while digital signatures clearly identify the user, the application ofdigital signatures must also add a measure of security to the document itself. Thatis, once a document is signed, it should be impossible to change any of theinformation that was signed. Thus, a number of algorithms and rules must beenforced by the XFDL processor in use.

About applying multiple signatures to formsDocuments often require multiple signatures. Furthermore, it is common practicefor some signatures to endorse other signatures. XFDL provides a signaturefiltering system to support multiple signatures in a single document.

Multiple signatures allow any combination of form elements to be included orexcluded from a signature, which in turn allows forms to be divided into logicalsections for the purposes of signing.

For example, an insurance claim requires the claimant to sign the document. Later,the insurance adjuster may also have to sign the document, both to endorse theinformation provided by the claimant and to endorse information they have addedto the claim.

XFDL includes a series of signature filters that are implemented as XFDL options.The complete list of available signature filters is:v signitems

v signoptions

v signpagerefs

v signdatagroups

v signgroups

v signitemrefs

v signnamespaces,

v signoptionrefs

Each filter applies to a different cross-section of XFDL elements. For example, thesignitems and signitemrefs filters control which items are signed or ignored, whilethe signoptions and signoptionrefs filters control which options are signed orignored. Each level of filter also has an assigned order of precedence. For example,

XFDL Version 7.7 21

Page 28: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

filters at the option level override filters at the item level. The order of precedencefor these filters is outlined in “Order of precedence of filters” on page 638.

By using these filters in combination, XFDL provides complete control over whichelements are omitted from a signature (or alternately to indicate which elementsshould be included in a signature, though ’inclusive logic’ filters should be usedsparingly and with great care).

The signatures will sign separate portions of the form, or will overlap with othersignatures, as specified by the filters used. For example, the first signature may usea set of filters that includes all elements in the top half of a page. The secondsignature may use a filter that includes the first signature and the top half of thepage. Finally, a third signature might use a filter that includes the entire page andboth the first and second signatures.

For example, a document may include a ″For Office Use Only″ section that shouldnot be signed by the original user. By applying the correct filters, this section canbe excluded from the signature, allowing office workers to complete those portionsof the document even after the document has been signed.

Namespaces in signature filtersSome signature filters refer to the elements to be omitted (or included) by theirelement tag names. These filters are signitems, signoptions and signoptionrefs.These options are lists whose members are compared to element tags. Thecomparison is namespace aware. For example, if <itemref>xfdl:field</itemref> is amember of the signitems filter, then the member will match any item-level elementwith the local name field and a namespace URI equal to the one bound to theprefix xfdl.

Note that if a namespace prefix used in an element tag is not mapped to the samenamespace URI as it is in a signature filter member, then the signature filtermember will not match the element. For example, if the xfdl prefix is mapped tothe XFDL namespace URI in the above signitems member, then the followingelements will match:

<xfdl:field xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"><field xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"><custom:field xmlns:foobar="http://www.ibm.com/xmlns/prod/XFDL/7.7">

but it will not match:<xfdl:field xmlns:xfdl="http://custom.HR"><foobar:field xmlns:foobar="http://custom.HR"><field xmlns="">

The last <field> element above has an empty namespace URI. To match such anelement, the null prefix must be used, e.g. <itemref>null:field</itemref>.

The namespace prefixes used in evaluating each member of a signature filter areobtained from the namespace context of the element containing the signature filtermember. Each member of a signature filter may define different namespaceprefixes. However, the default namespace is the XFDL namespace. For example,the member <itemref>field</itemref> in signitems matches any item-level <field>element with a default namespace URI equal to the XFDL namespace URI as wellas namespace qualified elements such as <xfdl:field> if the given prefix is bound tothe XFDL namespace URI.

22 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 29: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Signature filter members that are namespace qualified with a prefix bound to theXFDL namespace URI are logically equivalent to signature filter members that areassociated with the XFDL namespace URI by the default namespace. For example,a signitems member of <itemref>field</itemref> with the default namespace ofXFDL is logically equivalent to the following, where the prefix xfdl is bound to theXFDL namespace URI:

<xfdl:itemref>field</xfdl:itemref><xfdl:itemref xmlns="http://custom.HR">field</xfdl:itemref><xfdl:itemref xmlns="">field</xfdl:itemref>

Suboptions of a signature filter that are not in the XFDL namespace are ignored.For example, the signitems suboption <itemref xmlns=″″>field</itemref> has noeffect on signature filtration.

Applying multiple signatures

For example, an insurance claim requires the claimant to sign the document. Later,the insurance adjuster may also have to sign the document, both to endorse theinformation provided by the claimant and to endorse information they have addedto the claim.

XFDL allows any number of signatures in a single document. The signatures willsign separate portions of the form, or will overlap with other signatures, asspecified by the filters used.

For example, the first signature may use a set of filters that includes all elements inthe top half of a page. The second signature may use a filter that includes the firstsignature and the top half of the page. Finally, a third signature might use a filterthat includes the entire page and both the first and second signatures.

Securing signed elementsPaper documents rely on ink to secure the document. That is, once a document issigned, it is difficult to change the document because it is difficult to erase inkfrom paper. The very nature of paper and ink enforce the security of the document,since attempts to change the document generally leave detectable traces.

In contrast, digital documents do not share this type of inherent security. In fact,most digital documents allow easy and undetectable modification. For example,word processing documents are easily opened, changed, and saved again withoutleaving any evidence of what, if anything, was changed or who made the changes.

For this reason, the XFDL processor must provide the necessary security. Once anelement in a document is signed, it is implicit that future readers should be unableto change that element. Thus, once an XFDL document is signed, the XFDLprocessor must ensure that those elements included in the signature filters cannotbe changed.

This feature is not explicitly supported by XFDL, in that there are no flags in thelanguage that indicate whether a particular element in a document is signed.Instead, the software processing the XFDL must interpret existing signatures andenforce the rules correctly based on the filters in those signatures.

XFDL Version 7.7 23

Page 30: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Preventing layout changesOnce a document is signed, it is also implicit that the layout of that documentshould be secure. For example, if it were possible to move a paragraph, or even aline, the meaning of the document could be changed.

To reflect this, any software processing XFDL must maintain the position of signedvisual elements. This means that both the position and the size of the visualelements must be secured. If a visual element can change size, then it could beenlarged to obscure another visible element and thereby change the meaning of thedocument. Clearly, this must be prevented.

Thus, when a document is signed, the width, height, and position of all visiblesigned elements must be recorded. XFDL provides the layoutinfo option as a placeto store this information within a given signature element. Furthermore, thelayoutinfo option itself should be signed as part of the signature, ensuring that itcannot be changed.

The layout can later be tested by re-calculating the position of all signed elementsand comparing this to the information stored in the layoutinfo option for thatsignature. If the information does not match, then the document has been modifiedand cannot be trusted.

The software processing the XFDL should perform this layout test at the followingtimes:v Immediately after a signature is created, it should test the entire document. This

ensures that the process of generating the signature did not change theinformation.

v Whenever a page of the document is viewed, it should test the signed contentsof that page.

v Whenever an item is computationally added, deleted, or moved, it should testthe appropriate page.

v Whenever the details of a signature are viewed, it should test all portions of thedocument signed by that signature.

Preventing exploitable overlaps of signed elementsSince the guiding principle of signatures is that ″you sign what you see″, ascenario in which visual items are hidden or significantly overlapped cannot beallowed. If the signer cannot see elements of the form, then the signature cannot beconsidered valid.

Unlike paper documents, digital documents also offer the potential for visualelements to overlap. For example, it is possible to create a block of text in adocument, and to then obscure or hide that text with a second, overlapping blockof text. In this scenario, even if the first block of text was secured with a signature,it would be possible to move the second block of text after the document wassigned. This would change the meaning of the document by revealing informationthat was previously hidden.

When a document is signed, the XFDL processor must ensure that none of thesigned visual elements are overlapping with unsigned visual elements. If anoverlap is detected, the software must either warn the user or prevent thesignature from being created. Furthermore, if an existing signature is found toinclude elements that are overlapping with unsigned elements, the document hasbeen altered and the software must warn the user.

24 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 31: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

However, this test must allow for certain tolerances. Most of the visual elements inan XFDL document are surrounded by a small border of unused space which canbe allowed to overlap without obscuring the item itself. For example, two labelsmight overlap slightly without the text in either label being obscured. In fact, thissort of overlap is often necessary when reproducing tightly spaced paper forms.Thus, an overlap of two pixels should be allowed for each item.

This test may also ignore signed elements that overlap each other, since the layouttests discussed earlier prevent signed elements from being moved. Furthermore,this test must also make exceptions for box items. Boxes are often used to visuallycreate sections in a document, and will overlap other visual elements as a result.This overlap is allowed in the following cases:v A signed box can overlap with any unsigned item, with the exception of other

boxes.v A signed box can overlap with an unsigned box if the unsigned box appears on

top of the signed box (that is, if the unsigned box comes after the signed box inthe XFDL serialization, such that it is drawn after the signed box). This allowsthe desired behavior of signing a large box but allowing unsigned items(including boxes) to appear on top of part of the signed box, and it disallows theunsigned box from later being moved in the XFDL serialization such that itdisappears. Note that an unsigned box can be added after signing and allowedto overlap a signed box that was previously unobscured, but the other overlaprules prevent this from happening if the unsigned box overlaps other signeditems in the signed box. To protect empty spaces in signed boxes from beingobscured by unsigned boxes, the form author should place empty signedtransparent labels in the spaces.

Overlap is not allowed in the following cases:v A signed item overlapping an unsigned container pane or table item.v A signed item overlapping an unsigned surrounding box item.

The XFDL processor should perform this overlap test at the following times:v Immediately after a signature is created, it should test the entire document. This

ensures that the process of generating the signature did not create overlaps.v Whenever a page of the document is viewed, it should test that page.v Whenever an item is computationally added, deleted, or moved, it should test

the appropriate page.v Whenever the details of a signature are viewed, it should test all portions of the

document signed by that signature.

Global settingsGlobal settings specify default settings that can be applied to an entire form or apage.

Form globalsForm globals specify particular settings for the form and determine its physicalcharacteristics. These settings are applied to all pages and items in the form. Inother words, all pages and items inherit the form global settings.

Note that options defined within a page or item can override global settings forthat particular page or item. Form globals appear within the global item in the

XFDL Version 7.7 25

Page 32: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

globalpage, which appears at the top of a form. For example, the bgcolor optiondetermines the background color of all pages in the form.

Available Options

activated, bgcolor, border, dirtyflag, enclosuresettings, focused, fontcolor, fontinfo,formid, keypress, label, orientation, previous, printbgcolor, printfontcolor, printing,printsettings, publicdata, requirements, saveformat, transmitformat, triggeritem,ufv_settings, version, webservices, xformsmodels

Note: For descriptions, see “Details on options and array elements” on page 72.

Example

This example defines settings and characteristics for the form:<?xml version="1.0"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns:xforms="http://www.w3.org/2002/xforms"><globalpage sid="global">

<global sid="global"><saveformat>application/vnd.xfdl</saveformat><label>Time Sheet</label><bgcolor>ivory</bgcolor><fontinfo>

<fontname>Helvetica</fontname><size>10</size><effect>plain</effect>

</fontinfo></global>

</globalpage>...

These global settings specify that:v The form is written in XFDL version 7.7.v All saves activated from the form should save the form as an XFDL form, unless

otherwise specified in an item that initiates a save.v The title Time Sheet should appear in the title bar of all pages, unless specified

otherwise in a page global.v All pages, toolbars and boxes should have an ivory background, unless they

contain an option specifying otherwise.v All pages and items should use a plain, Helvetica, 10-point font, unless they

contain an option specifying otherwise.

Usage Details1. Define form globals within the global item of the globalpage.2. The global item and the globalpage must always have a sid of global.3. The globalpage follows the XFDL tag.4. The publicdata option is optional. If specified in the global item as public, the

instance name and bound element name are listed. For example,<publicdata>

<dataref><ref>instance('INSTANCE')/page1/field1</ref>

</dataref></publicdata>

26 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 33: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. You can give the form a title that appears in the title bar by setting a globallabel option.

6. When referencing form globals from within the form, the following syntaxapplies:

global.global.option[n|name]

For example:global.global.bgcolor

XFDL Version 7.7 27

Page 34: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Page globalsPage globals specify settings and characteristics for the page within which theyappear. In other words, it sets the defaults for all items on specified page. Pageglobals appear within a global item at the top of each page definition, and applyto the whole page.

Page globals can be overridden by option settings within items.

Available Options

activated, bgcolor, border, enclosuresettings, focused, focuseditem, fontcolor,fontinfo, itemfirst, itemlast, keypress, label, mouseover, next, previous, pagefirst,pageid, pagelast, pagenext, pageprevious, printbgcolor, printfontcolor, printsettings,saveformat, transmitformat

Note: For descriptions, see “Details on options and array elements” on page 72.

Example

The following example shows page globals on two pages within a single form:<page sid="PAGE_1">

<global sid="global"><printsettings>

<border>on</border></printsettings><bgcolor>gray84</bgcolor><label>Administration Form 1</label><next>FIELD_date</next>

</global>...

<page sid="PAGE_2"><global sid="global">

<printsettings><border>on</border>

</printsettings><bgcolor>#C0C0FF</bgcolor><label>Administration Form 2</label><next>FIELD_adminname</next>

</global>...

″PAGE_1″ has a medium-gray background, and directs the focus to the item called″FIELD_date″ as soon as it opens. It assumes the rest of its settings from the formglobal. (If no form global exists, the page will assume the XFDL defaults.)

On ″PAGE_2″, the focus is directed to the item called ″FIELD_adminname″ as soonas the page opens. ″PAGE_2″ assumes the rest of its settings from its page globaland XFDL defaults.

Usage Details1. Page globals are defined in the global item at the top of a page, after the page

declaration.2. The global item must have a sid of global.3. Page globals apply only to the page they are on.4. Page globals are optional.

28 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 35: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. To specify a title to appear in the page’s title bar, use the label option as a pageglobal.

6. When referencing page global options within the form, the following syntaxapplies:

pageid.global.option[n|name]

For example:PAGE_1.global.bgcolor

Details on XFDL itemsItems are the basic elements of a page.

The syntax of an item definition is as follows:

The sid attribute uniquely identifies an item. (See “Scope identifiers (sid)” on page17.) Every item sid in a page must be unique. The itemType element identifies thetype of item to create. (For example, <field...> defines the item as a field.) Thissection contains information about XFDL-defined item types and the optionsavailable for each.

Note: Defining an option more than once in an item’s definition is not permitted.See “Details on options and array elements” on page 72 for descriptions of eachoption type.

<itemType sid="itemTag">option definition1

...option definitionn

</itemType>

Note:

v The itemType states the type of item to create. It must be one of the item types definedin this specification, or must be a custom item that follows the rules for custom itemsoutlined in this specification.

v The sid attribute is mandatory.

v The value of each item sid must be unique in the page.

XFDL Version 7.7 29

Page 36: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

actionSpecifies form-initiated actions that execute automatically.

The actions can be any of the following types: link, replace, submit, done, display,print, refresh, pagedone, save, select, or cancel. See section “type” on page 271 fora description of each of these actions.

Action items can be defined to occur only once or repeat at specified timeintervals, and after the page opens but before the page appears. See the section onthe delay option for information on timing options. Action items can trigger eitherbackground actions or actions involving user interaction. A form can contain onlyhidden items such as action items and operate in the background. Such forms arecalled daemon forms.

Available options

activated, active, data, datagroup, delay, itemnext, itemprevious, printsettings,saveformat, transmitdatagroups, transmitformat, transmitgroups, transmititemrefs,transmititems, transmitnamespaces, transmitoptionrefs, transmitoption,transmitpagerefs, type, url, xforms:submit, xforms:trigger

Example

The following action will send a status message to the server. The transactionhappens automatically every 10 minutes (600 seconds).

<action sid="sendStatus_action"><delay>

<type>repeat</type><interval>600</interval>

</delay><type>submit</type><url>mailto:[email protected]</url>

</action>

Usage details1. Repeating automatic actions is one method of creating a sparse-stated

connection. It allows the form to indicate periodically to a server applicationthat it is still running. Use the delay option to specify repetition.

2. Actions, by the form definition rules, reside on a page; therefore, actions occuronly when the page is open, and repeating actions stop when the page closes.Actions defined to occur before the page displays, occur each time the pageopens.

30 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 37: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

boxSpecifies a rectangular box on the form. Other items may be positioned on top ofboxes (using itemlocation). The purpose of box items is simply to add visualvariety to the form.

Available options

bgcolor, border, fontinfo, itemlocation, itemnext, itemprevious, printbgcolor,printvisible, size, visible, xformsenabled

Example

The following example shows a typical box description. The box is 25 characterswide and 4 characters high. The background color is blue.

<box sid="blue_box"><bgcolor>blue</bgcolor><size>

<width>25</width><height>4</height>

</size></box>

Usage details1. To make the box more visible, assign a background color that differs from the

page background color (the default).2. When setting the size option of a box, the height and width of the box will be

based on the average character size for the font in use (set with the fontinfooption). The default font, if none is specified in the page global settings, isHelvetica 8 plain.

3. If you are creating an XForms form, you should use the pane item rather thanthe box item. For more information about the pane item, refer to “pane” on page62.

XFDL Version 7.7 31

Page 38: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

buttonSpecifies a click button that performs an action when clicked with the mouse oractivated with the space bar when it receives the input focus. Buttons can requestdata from a web server, submit or cancel the form, sign the form, save it to disk, orenclose external files.

Available options

acclabel, activated, active, bgcolor, borderwidth, coordinates, data, datagroup,enclosuresettings (enclose button only), focused, fontcolor, fontinfo, format, help,image, imagemode, itemlocation, itemnext, itemprevious, justify, keypress,linespacing, mouseover, next, printbgcolor, printfontcolor, printvisible, signature,signatureimage, signdatagroups, signdetails, signer, signformat, signgroups,signinstances, signitemrefs, signitems, signnamespaces, signoptionrefs, signoptions,signnamespaces, signpagerefs, size, transmitformat, transmititemrefs, transmititems,transmitnamespaces, transmitoptionrefs, transmitoptions, transmitpagerefs, type,url, value, visible, xformsenabled; xformsreadonly, xformsrequired, xformsvalid,xforms:submit, xforms:trigger, xforms:upload

Examples

Submit button

Buttons that trigger form processing requests must have a type option setting ofsubmit or done. The definition for such a button might look like this:

<button sid="submit_button"><value>Process Form</value><fontinfo>

<fontname>Helvetica</fontname><size>18</size><effect>bold</effect><effect>italic</effect>

</fontinfo><type>done</type><url>http://www.ibm.server.com/cgi-bin/formProcessor</url>

</button>

Enclosure button

This button encloses an external file in the form. The action to enclose a file isenclose. The datagroup option identifies the list of datagroups, or folders, in whichthe user can store the enclosed file. An enclose button might take the followingform:

<button sid="enclose_button"><value>Enclose File</value><fontinfo>

<fontname>Helvetica</fontname><size>18</size><effect>bold</effect><effect>italic</effect>

</fontinfo><type>enclose</type><datagroup>

<datagroupref>Images_Asia</datagroupref><datagroupref>Images_Eur</datagroupref><datagroupref>Images_SAmer</datagroupref>

</datagroup></button>

32 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 39: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This button will allow users to enclose files into one of three datagroups (folders):Images_Asia, Images_Eur, Images_SAmer.

Usage details1. The text displayed by the button is defined by: the value option if given and

not empty; otherwise, the xforms:label if the button contains an XFormsoption.

2. When setting the size option of a button, the height and width of the button isbased on the average character size for the font in use (set with the fontinfooption).

3. If you set the width for a button, but not the height, then the button willautomatically grow to accommodate the text within the given width. In otherwords, the text will wrap to fit within the width specified, and the height willincrease to accommodate the text.

4. If a button’s image option points to a data item that does not exist or containsno data, then the button will display its value option instead.

5. If a button’s image option points to a data item that dynamically changes itsmimedata (but not its item sid), then the button will update the image itdisplays. For information on how to update an image by enclosing a new one,see the data option description.

6. The format option is available in buttons in order to force users to sign formsbefore submitting them.

7. If a button of type enclose, extract, display, or remove contains both a datagroupand a data option, the data option takes precedence.

8. There are two steps to making a signature button mandatory:v Assign the following elements to the format option: string and mandatory.v Set the button’s value equal to the button’s signer option setting.v Setting the format to mandatory specifies that the button must have a value

setting that is not empty before the user submits the form. Equating the valueto the setting of the signer option ensures that the only way a button’s valueis set is if somebody uses it to sign the form. (The signer option stores theidentity of the person who signed the form using the button.)

v If a button that wraps an xforms:trigger option has a type of anything otherthan select, the xforms:trigger is overridden.

Usage details: Signature buttons1. A signature button is the means by which the user can sign a form. To make a

button a signature button, set its type to signature.2. A signature button can be set up to sign the whole form or just part of it by

setting up filters on the signature, using the signdatagroups, signgroups,signitemrefs, signitems, signnamespaces, signoptionrefs, and signoptions options.

Note: It is recommended that the triggeritem and coordinates options shouldbe filtered out. These options change when a submission is triggered or when auser clicks an image button, respectively. Filtering out parts of the form that asubsequent user will change, including subsequent signatures and signaturebuttons and custom options that might change, should also be taken intoconsideration.

3. Signature buttons allow users to do the following:v Sign the form or portion of the form the button specifies.

XFDL Version 7.7 33

Page 40: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v Delete their signatures (a signature can be deleted only by the user whosesignature it is, and if the signature is currently valid and not signed by someother signature).

v View the signature and view the XFDL text of what the signature applies to.4. All option references, calculations, and other formulas in any signed portion of

a form are frozen once they have been signed. Their setting will be valued atthe setting they contained at the moment when the signature was created. If theuser deletes the signature, however, then the formulas will become unfrozen,and will change dynamically as normal.

5. Review the Usage Details section in the signitemrefs, signoptionrefs,signnamespaces, and signdatagroups filters, and avoid using the other advancedfilters unless a thorough security review has been performed.The usual options for other buttons (i.e. size, image, value) can also be used withsignature buttons.

34 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 41: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

cellPopulates combobox, list and popup items.

A cell can belong to multiple comboboxes, lists and popups. See the combobox, listand popup item sections for information on associating cells with these items.

Cells fall into two categories according to their behavior:v Action cells – These cells perform the same set of actions normally associated

with buttons. This includes such things as canceling, saving, and submitting theform.

v Select cells – These cells provide users with a mutually exclusive set of valuesfrom which to choose. When chosen, these cells appear selected. In a list thismeans the cell is highlighted in some way. In a popup, the cell’s label becomesthe popup’s label.

Available options

activated, active, data, datagroup, enclosuresettings (action cell of type encloseonly), group, label, itemnext, itemprevious, printsettings, saveformat,transmitdatagroups, transmitformat, transmitgroups, transmititemrefs,transmititems, transmitnamespaces, transmitoptionrefs, transmitoptions,transmitpagerefs, type, url, value

Example

The following example shows a list with three cells. To learn how to get the valueof the user’s selection, see Usage details below.

<popup sid="CountryPopup"><label>Country</label><group>country</group><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format></popup><cell sid="albCell">

<value>Albania</value><group>country</group><type>select</type>

</cell><cell sid="algCell">

<value>Algeria</value><group>country</group><type>select</type>

</cell><cell sid="banCell">

<value>Bangladesh</value><group>country</group><type>select</type>

</cell>

Usage details1. Use the type option to establish a cell’s behavior. Select cells have a type of

select (the default type).2. Cells can have both value and label options. These options affect the form

differently depending on whether the cell is linked to a combobox, a popup, or a

XFDL Version 7.7 35

Page 42: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

list item. In general, the label of the cell will be displayed as a choice, while thevalue of the cell will be displayed if that cell is selected. For more information,refer to the appropriate item type.

3. Cells take their color and font information from the combobox, list and popupitems with which they are associated. In this way, a cell’s appearance can varyaccording to the list the user is viewing.

4. To get the value of a cell that a user has selected from a list, it is necessary todereference it in the following manner:

page_tag.list_tag.value->value

For example:page1.countryPopup.value->value

When a user selects a cell from a list, the item sid of the cell is stored as thevalue of the list. Hence the dereference syntax.

5. Starting with version 4.5, items of type cell are the only items that can befiltered using the signgroups and transmitgroups options.

36 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 43: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

checkProvides a simple check box to record a selected or not selected answer from auser. A selected check box appears filled while a deselected box appears empty.

The exact appearance of the check box is platform-dependent; but the shape isrectangular. The check box appears as a normal check box for the users of eachplatform.

Available options

acclabel, active, bgcolor, focused, fontcolor, fontinfo, help, itemlocation, itemnext,itemprevious, keypress, label, labelbgcolor, labelborder, labelfontcolor, labelfontinfo,mouseover, next, previous, printbgcolor, printfontcolor, printlabelbgcolor,printlabelfontcolor, printvisible, readonly, saveformat, size, suppresslabel, value,visible, xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:input

Example

This value option setting in this check box is on, so the check box will appearselected when it displays. The item’s label is Activate Health Plan, and the labelwill display in a Times 14 Bold font colored blue.

<check sid="healthPlan_check"><value>on</value><label>Active Health Plan</label><labelfontinfo>

<fontname>Times</fontname><size>14</size><effect>bold</effect>

</labelfontinfo><labelfontcolor>blue</labelfontcolor>

</check>

Usage details1. The value option setting indicates the user’s answer. If the user selects or checks

the check box, the value option contains on, otherwise it contains off. Thedefault value is off.

2. Check boxes do not belong to groups like radio buttons - each check box maybe turned on or off independently of the others.

3. The label option defines the label for the check box. The label appears above thecheck box and aligned with the box’s left edge. There is no default label.

4. When setting the size option of a check box, the height and width of thebounding box will be based on the average character size for the font in use(set with the fontinfo option).

5. The fontcolor option determines the color of the check box fill pattern (defaultsto red).

6. For check items that contain an xforms:input option, the on or off value istranslated into true or false, respectively, when stored in the data model.

XFDL Version 7.7 37

Page 44: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

comboboxComboboxes act like a hybrid of a field and a popup.

Unopened, a combobox with a label occupies the same space as two labels, and acombobox without a label occupies the same space as a single label. After a userchooses a cell, the combobox closes (that is, returns to its unopened state).

If none of the cells are appropriate, the user can type other information into thecombobox. When information is typed in, it is stored in the value option of thecombobox. When a cell is selected, the value option stores the value of that cell, sounlike other list items (popup and list), dereferencing is not necessary.

A combobox’s label appears above the combobox item.

Available options

acclabel, activated, active, bgcolor, borderwidth, focused, fontcolor, fontinfo,format, group, help, itemlocation, itemnext, itemprevious, keypress, label,labelbgcolor, labelborder, labelfontcolor, labelfontinfo, mouseover, next, previous,printbgcolor, printlabelbgcolor, printfontcolor, printlabelfontcolor, printvisible,readonly, size, suppresslabel, value, visible, xformsenabled, xformsrequired,xformsreadonly, xformsvalid, xforms:input, xforms:select1

Example

This is an example of a combobox containing a set of selections allowing users tochoose a color.

<combobox sid="CATEGORY_POPUP"><group>combo_Group</group><label>Choose a Color:</label>

</combobox>

The default label is ″Choose a Color:″. This will display above the combobox. Untilthe user types in something or makes a selection, the field area of the comboboxwill be blank.

These are the cells that make up the combobox. They are select cells and theybelong to the same group as the combobox: combo_Group.

<cell sid="RED_CELL"><group>combo_Group</group><type>select</type><value>Red</value>

</cell><cell sid="WHITE_CELL">

<group>combo_Group</group><type>select</type><value>White</value>

</cell><cell sid="BLUE_CELL">

<group>combo_Group</group><type>select</type><value>Blue</value>

</cell>

38 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 45: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. Place cells in a combobox by creating a group for the combobox and assigning

cells to the group. Create a group using the group option in the comboboxdefinition. Assign cells to the group using the group option in the celldefinition.

2. When first viewed, a combobox will display its value. If no value is set, thecombobox will be empty.

3. The label option sets the text displayed above the item, as with a field.4. When a combobox is opened, its list displays:v The label of each cell.v The value of each cell that does not have a label.

5. When a cell is selected from the combobox’s list, the following occurs:v If the cell is of type select, the combobox’s value is set to the value of the

selected cell and the combobox displays that value.v If the cell is of any other type, the appropriate action for the type is taken

and the combobox’s value is set to empty.6. When a value is typed into a combobox (rather than selected from the list),

the combobox’s value is set to the typed value.7. The label option for each cell is used to create a long form for each choice. For

example, a cell might have a label of ″United States of America″ and a value of″USA″. The long form is displayed in the combobox’s list, but once that cell isselected, the short form is displayed by the popup.

8. Combobox, popup, and list items with the same group reference display thesame group of cells.

9. Unlike popups and lists, comboboxes do not need to be dereferenced in orderto obtain the value.

10. When setting the size option of a combobox, the height and width of thepopup will be based on the average character size for the font in use (set withthe fontinfo option).

11. If you set the readonly option to on, the combobox will refuse all input,although it will function normally otherwise and formulas will still be able tochange the value.

12. When a format is applied to a combobox, the formatting will be applied to thevalue of each cell linked to the combobox. Those cells that fail the check willbe flagged or filtered. Those cells that pass the check will have their valuereplaced with a formatted value. See the format option for more information.If any two combobox, list, or popup items use the same set of cells, they mustapply the same formatting.

13. To make a combobox that displays a calendar widget, create a combobox withno cells and give it a date function.

XFDL Version 7.7 39

Page 46: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dataStores an information object such as an image, a sound, or an enclosed file in anXFDL form.

Whenever any of these objects are added to a form, the data that describes theobject is stored in a data item. A data item can only store the data from a singleobject. Data in data items must be encoded in base64, base64-gzip or XML format.

Data items are created automatically when files are enclosed in a form. Enclosefiles using items with a type option setting of enclose.

Available options

datagroup, filename, filesize, itemnext, itemprevious, mimedata, mimetype

Example

This is an example of a data item.<data sid="Supporting_Documents_1">

<mimetype>text/plain</mimetype><filename>HelloWorld.txt</filename><filesize>1042</filesize><mimedata encoding="base64">

SGVsbG8sIHdvcmxkIQ==</mimedata><datagroup>

<datagroupref>Supporting_Documents</datagroupref></datagroup>

</data>

Usage details1. Stores the data in the mimedata option, and the data’s MIME type in the

mimetype option.2. If a data item contains a datagroup option, it can be associated with one or more

other data items. Data items with a datagroup option are not replaced if a buttonor cell of type enclose point to new data items. The new data items simplybecome members of the same datagroup. Additionally, buttons and cells with thesame datagroupoption can access the contents of the data item.

3. If a button or cell of type enclose contains a data option that points to a dataitem (as opposed to using the datagroup option), then special rules apply to thedata item’s behavior. If a user encloses a new data item using that button, thenew information overwrites the old. For example, if the data item originallycontained a jpeg image of a dog, and then a user enclosed a png image of ahouse, then the data item’s mimedata, mimetype, and filename options updatethemselves to contain the information about the house image.

4. Starting with XFDL version 4.5, data items are the only items that can befiltered using the signdatagroups and transmitdatagroups options.

5. The filesize option is created by the XFDL processor when an attachment isadded to the form.

40 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 47: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

fieldCreates a text area where users can display and enter one or more lines of data.

The field’s characteristics determine the number of lines, the width of each line,and whether the field is scrollable.

Field data can be protected from modification, made to display in the systempassword format (typically, hidden from view), and forced to conform to data typeand formatting specifications.

Available options

acclabel, active, bgcolor, borderwidth, focused, fontcolor, fontinfo, format, help,itemlocation, itemnext, itemprevious, justify, keypress, label, labelbgcolor,labelborder, labelfontcolor, labelfontinfo, mouseover, next, previous, printbgcolor,printlabelbgcolor, printfontcolor, printlabelfontcolor, printvisible, readonly, rtf,scrollvert, scrollhoriz, size, suppresslabel, texttype, value, visible, writeonly,xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:input,xforms:secret, xforms:textarea

Example

This is an example of a single line field item that allows 20 characters of input. Aninitial value of 23000 has been defined for the field. When the form appears, thefield will contain this value.

<field sid="income_field"><label>Annual income</label><value>23000</value><size>

<width>20</width><height>1</height>

</size><fontinfo>

<fontname>Courier</fontname><size>12</size><effect>plain</effect>

</fontinfo><labelfontinfo>

<fontname>Helvetica</fontname><size>12</size><effect>plain</effect>

</labelfontinfo><labelfontcolor>blue</labelfontcolor>

</field>

Usage details1. When setting the size option of a field, the width of the field will be based on

the average character size for the font in use (set with the fontinfo option) andthe height will exclude the external font leading.

2. Use the readonly option to create a readonly field.3. Use the writeonly option to create a write only field. This is useful for

passwords.4. The format option specifies the data type of the field’s data. It also contains

flags that allow the application of specified edit checks and formatting to thedata.

5. The label option defines the field’s label. The label is placed above the field andaligned with the field’s left edge.

XFDL Version 7.7 41

Page 48: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

6. The scrollvert and scrollhoriz options govern a field’s scrolling characteristics.They must be set to always to permit scrolling. With scrolling enabled, scrollbars display along the bottom (horizontal scrolling) and right (vertical scrolling)edges of the field.

7. The texttype option determines whether a field contains plain text or rich text.Note that you cannot dynamically change a rich text field into a plain text field.

8. When using XForms, the following rules apply:v To create a single line field, use xforms:input.v To create a multi-line field, use xforms:textarea.v To create a rich text field, use xforms:textarea. In this case, it is the rtf option

that is bound to the data model (as opposed to the value option). Rich textfields do not support the use of xforms:input or xforms:secret.

v To create a write only field, use xforms:secret.

42 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 49: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

helpDefines a help message that can be used to support various external items in theform.

Separate help items can be created for every item supported, or one help item canbe used to support several items.

Available options

active, itemnext, itemprevious, value

Example

This is an example of a button item that links to a help item using the help option:<button sid="fullPicture_button">

<value>View Full-Sized Picture</value><help>button_help</help><fontinfo>

<fontname>Times</fontname><size>14</size><effect>plain</effect>

</fontinfo><type>link</type><url>http://www.ibm.server.com/application/fullPic.frm</url>

</button>

The following example shows the help item referred to in the button item definition.The contents of the value option are presented as the help message when the userasks for help with the button.

<help sid="button_help"><value>

Pressing this button will bring a full-sized image in a formdown to your viewer.

</value></help>

Usage details1. The help item’s value option contains the help message text.2. The link between the help item and the supported item is created by the help

option in the supported item’s definition. The help option contains the helpitem’s item reference.

XFDL Version 7.7 43

Page 50: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelDefines a static text message or an image to display on the form.

If both an image and a text message are defined for the label, the image takesprecedence in viewers able to display images.

Available options

active, bgcolor, borderwidth, fontcolor, fontinfo, format, help, image, imagemode,itemlocation, itemnext, itemprevious, justify, linespacing, printbgcolor,printfontcolor, printvisible, size, value, visible, xformsenabled, xformsreadonly,xformsrequired, xformsvalid, xforms:output

Example

This is an example of a multiple-line text label:<label sid="RHYME LABEL">

<value>Little Miss Muffet sat on her tuffet,Eating her curds and whey.When along came a spider, who sat down beside her,and frightened Miss Muffet away!

</value><fontinfo>

<fontname>Times</fontname><size>16</size><effect>italic</effect>

</fontinfo><justify>right</justify>

</label>

Usage details1. The text displayed by a label is defined by: the xforms:output option, if given;

otherwise the value option.2. To define an image for a label, use the image option.3. To create a multiple line text message, add line breaks to the message text.

Use the escape sequence ’\n’ to indicate a line break.4. When setting the size option of a label, the height and width of the label will

be based on the average character size for the font in use (set with the fontinfooption).

5. If you set the width for a label, but not the height, then the label willautomatically grow to accommodate the text within the given width. In otherwords, the text will wrap to fit within the width specified, and the height willincrease to accommodate the text.

6. If a label’s image option points to a data item that does not exist or containsno data, then the label will display its value option instead.

7. If a label contains both a value option and an xforms:output option, then thexforms:output overrides the value.

8. If a label contains an xforms:output with an xforms:label, the value of thexforms:label is concatenated with the value of the xforms:output (always labelfirst). This allows you to create a decoration for the text that is displayed. Forexample, you might want your label to read ″Total: 200″, where the ″Total:″ isprovided by an xforms:label and the ″200″ is provided by the xforms:output.Note that the xforms:label can only contain text and is not affected by theformat option.

44 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 51: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

9. If a label is decorated by an xforms:label, and the justify option it set to rightjustify, then the value of the label item is right justified but the additional textfrom the xforms:label remains left justified. This allows you to create spacebetween the xforms:label and the value, as shown:

Total: 200

10. If a label contains a suppresslabel option, it prevents the xforms:label from beingdisplayed.

11. If a label’s image option points to a data item that dynamically changes itsmimedata (but not its item sid), then the label will update the image itdisplays. For information on how to update an image by enclosing a new one,see the data option description.

12. Set the image display behavior with the imagemode option.13. The label’s background color defaults to being transparent - and thus the label

will allow whatever item it is over to show through. For example, it ispossible to place a label over another label holding an image. The image willshow through the top label.

14. Label contents (if text) can be formatted using format flags (see section“format” on page 110).

15. The suppresslabel option suppresses the label, so that it is not displayed.

XFDL Version 7.7 45

Page 52: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

lineDraws a simple vertical or horizontal line on the form.

Lines are useful for visually separating parts of a page.

Available options

fontcolor, fontinfo, itemlocation, itemnext, itemprevious, printfontcolor, printvisible,size, thickness, visible, xformsenabled

Example

This is an example of a horizontal line with a thickness of five pixels:<line sid="BLUE_LINE">

<size><width>40</width><height>0</height>

</size><thickness>5</thickness>

</line>

Usage details1. Specify the dimensions of a line using the size and thickness options. The size

option determines whether the line is vertical or horizontal. If the horizontaldimension is set to zero, then the line is vertical. If the vertical dimension is setto zero, then the line is horizontal. Size is calculated in characters.

2. The thickness option determines how thick the line will be. Thickness iscalculated in pixels.

3. The fontinfo option information is used when calculating the line’s size. Thesize option’s unit of measurement is characters; therefore, choice of font canaffect the size. See the size option for more information.

4. The fontcolor option defines the color of the line.

46 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 53: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

listCreates a list that allows the user to select one or more choices.

Additionally, the choices can be set to trigger actions, such as saving or submittingthe form.

The entries in the list are cell items. Selections are cells with a type option setting ofselect. Actions are cells with any other type option setting.

Available options

acclabel, active, bgcolor, borderwidth, focused, fontcolor, fontinfo, format, group,help, itemlocation, itemnext, itemprevious, keypress, label, labelbgcolor,labelborder, labelfontcolor, labelfontinfo, mouseover, next, previous, printbgcolor,printlabelbgcolor, printfontcolor, printlabelfontcolor, printvisible, readonly, size,suppresslabel, value, visible, xformsenabled, xformsreadonly, xformsrequired,xformsvalid, xforms:select, xforms:select1

Example

This is an example of a list containing three actions: submit form, save form, andcancel form.

<list sid="MAINMENU_LIST"><group>list_Group</group><label>Options Menu</label><labelfontcolor>blue</labelfontcolor><size>

<width>3</width><height>20</height>

</size></list>

These are the cells that make up the list. They are action cells and they belong tothe same group as the list: list_Group.

<cell sid="SUBMIT_CELL"><group>list_Group</group><type>submit</type><url>http://www.ibm.server.com/cgi-bin/processForm</url><value>Submit Form</value>

</cell><cell sid="SAVE_CELL">

<group>list_Group</group><type>saveas</type><value>Save Form</value>

</cell><cell sid="CANCEL_CELL">

<group>list_Group</group><type>cancel</type><value>Cancel this Form</value>

</cell>

Usage details1. Users can only select one choice from a list item, unless the item includes the

xforms:select option, in which case they can select any number of choices.2. Create non-XForms lists by using the group option to link the list to a number

of cell items.3. When first viewed, a list displays it’s label above the item (as with a field) and

as many choices as its size allows.

XFDL Version 7.7 47

Page 54: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

4. The choices in the list display:v The label of each cell.v The value of each cell that does not have a label.

5. When a cell is selected from the list, the following occurs:v If the cell is of type select, the list’s value is set to the name of the selected

cell and that cell is highlighted.v If the cell is of any other type, the appropriate action for the type is taken,

the list’s value is set to empty, and the selected cell is highlighted.6. The label option for each cell is used to create a long form and an abbreviated

form for each choice. For example, a cell might have a label of ″United Statesof America″ and a value of ″USA″. The long form is displayed in the list, butthe short form available as the cell’s value.

7. To get the value of a cell that a user has selected from a list, it is necessary todereference it in the following manner:

page_tag.list_tag.value->value

For example:compute="page1.countryPopup.value->value"

8. List, combobox and popup items with the same group reference display thesame group of cells.

9. The value option will contain one of the following:v The item reference of the most recently chosen cell, if the cell was of type

select.v Nothing, if the cell most recently chosen was of any type other than select.

10. When setting the size option of a list, the height and width of the list will bebased on the average character size for the font in use (set with the fontinfooption).

11. A vertical scroll bar will appear beside the list if the number of cells is greaterthan the height (defined with the size option) of the list.

12. When a format is applied to a list, the formatting will be applied to the valueof each cell linked to the list. Those cells that fail the check will be flagged orfiltered. Those cells that pass the check will have their value replaced with aformatted value. See the format option for more information.

13. If any two combobox, list, or popup items use the same set of cells, they mustapply the same formatting.

48 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 55: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

popupCreates a popup menu from which users can make selections (as in a list of names)and trigger actions (such as enclosing files and submitting the form). A popup cancontain both selections and actions.

The entries in the popup are cell items. Selections are cells with a type optionsetting of select. Actions are cells with any other type option setting.

Popups act like a hybrid of a label, a button, and a list. Unopened, a popupoccupies only the space required for its label. Open, the popup displays a list ofselections and actions. After a user chooses a selection or an action, the popupcloses (that is, returns to its unopened state). A popup’s label displays inside thepopup item.

Available options

acclabel, activated, active, bgcolor, borderwidth, focused, fontcolor, fontinfo,format, group, help, itemlocation, itemnext, itemprevious, justify, keypress, label,mouseover, next, previous, printbgcolor, printfontcolor, printvisible, readonly, size,suppresslabel, value, visible, xformsenabled, xformsreadonly, xformsrequired,xformsvalid, xforms:select1

Example

This is an example of a popup list containing a set of selections allowing users tochoose a category.

Here is the popup definition. The default label is ″Choose a Category:″. This willdisplay until a user makes a selection. Afterwards, the cell’s value will display asthe label.

<popup sid="CATEGORY_POPUP"><group>popup_Group</group><label>Choose a Category:</label>

</popup>

These are the cells that make up the popup. They are select cells and they belongto the same group as the popup: popup_Group.

<cell sid="HISTORY_CELL"><group>popup_Group</group><type>select</type><value>World History</value>

</cell><cell sid="SCIENCE_CELL">

<group>popup_Group</group><type>select</type><value>Physical Sciences</value>

</cell><cell sid="MUSIC_CELL">

<group>popup_Group</group><type>select</type><value>Music</value>

</cell>

Usage details1. Place cells in a popup by creating a group for the popup and assigning cells

to the group. Create a group using the group option in the popup definition.Assign cells to the group using the group option in the cell definition.

XFDL Version 7.7 49

Page 56: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. When first viewed, a popup will display its label if no value is set. If there isno value or label, the popup will be empty.

3. When a popup is opened, its list displays:v The label of each cell.v The value of each cell that does not have a label.

4. When a cell is selected from the popup’s list, the following occurs:v If the cell is of type select, the popup’s value is set to the name of the

selected cell and the popup displays the cell’s value.v If the cell is of any other type, the appropriate action for that type is taken,

the popup’s value is set to empty, and the popup displays its label option5. The label option for each cell is used to create a long form for each choice. For

example, a cell might have a label of ″United States of America″ and a value of″USA″. The long form is displayed in the popup’s list, but once that choice isselected, the short form is displayed by the popup.

6. To get the value of a cell that a user has selected from a list, it is necessary todereference it in the following manner:

page_tag.list_tag.value->value

For example:compute="page1.countryPopup.value->value"

When a user selects a cell from a list, the item sid of the cell is stored as thevalue of the list. Hence the dereference syntax.

7. Popup, combobox and list items with the same group reference display the samegroup of cells.

8. When setting the size option of a popup, the height and width of the popupwill be based on the average character size for the font in use (set with thefontinfo option).

9. When a format is applied to a popup, the formatting will be applied to thevalue of each cell linked to the popup. Those cells that fail the check will beflagged or filtered. Those cells that pass the check will have their valuereplaced with a formatted value. See the format option for more information.

10. If any two comboboxes, lists, or popups use the same set of cells, they mustapply the same formatting.

50 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 57: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

radioIntended for use with one or more other radio items. A group of radio buttonspresents users with a set of mutually exclusive choices. Each radio buttonrepresents one choice the user can make.

There is always one selected radio button in the group. As well, since radiobuttons present a mutually exclusive set of choices, only one radio button in agroup can be selected. When a user chooses a radio button, that radio buttonbecomes selected.

A selected radio button appears filled in some way. All other radio buttons in thegroup appear empty.

Available options

acclabel, active, bgcolor, focused, fontcolor, fontinfo, group, help, itemlocation,itemnext, itemprevious, keypress, label, labelbgcolor, labelborder, labelfontcolor,labelfontinfo, mouseover, next, previous, printbgcolor, printlabelbgcolor,printfontcolor, printlabelfontcolor, printvisible, readonly, size, suppresslabel, value,visible, xformsenabled

Example

This example shows a group of three radio buttons. The first radio button is theinitial choice: the value option setting is on. The buttons all belong to the groupsearch_Group.

<radio sid="NAME_RADIO"><value>on</value><group>search_Group</group><label>Search by Name</label>

</radio><radio sid="NUMBER RADIO">

<group>search_Group</group><label>Search by Number</label>

</radio><radio sid="OCCUPATION RADIO">

<group>search_Group</group><label>Search by Occupation</label>

</radio>

As shown here, only the chosen radio button needs to have a value option setting.The remaining radio buttons will receive the (default) value setting of off.

Usage details1. Group radio buttons by assigning them to the same group. Do this by

including the group option in each radio button’s definition, and using the samegroup reference in each case.

2. The value option contains the status indicator. It can be either on or off. Thevalue on indicates a status of chosen. The value off indicates a status of notchosen. The default status is not chosen.

3. When the form opens, if no radio button has the status chosen, then the lastradio button defined for the group becomes chosen. If multiple radio buttonsare chosen, then only the last ’chosen’ radio button retains that status.

4. The label option defines a label to appear above the radio button and alignedwith its left edge.

XFDL Version 7.7 51

Page 58: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. When setting the size option of a radio button, the height and width of thebounding box will be based on the average character size for the font in use(set with the fontinfo option).

6. The fontcolor option determines the color of the radio button fill pattern(defaults to red).

7. For radio items that contain an xforms:input option, the on or off value istranslated into true or false respectively when stored in the data model.

52 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 59: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signatureContains a signature and the data necessary to verify the authenticity of a signedform.

It is created by a form viewer or other program when a user signs a form (usuallyusing a signature button). The signature item contains an encrypted hash valuethat makes it impossible to modify the form without changing the hash value thatthe modified form would generate. To verify, one can generate the hash value andthen see if it matches the one in the signature.

Available options

colorinfo, excludedmetadata, fullname, itemnext, itemprevious, layoutinfo,mimedata, signature, signdatagroups, signdetails, signer, signformat, signgroups,signinstances, signitemrefs, signitems, signnamespaces, signoptionrefs, signoptions,signpagerefs

Example

This example shows a signature item below the signature button that created it.<button sid="empSigButton">

<type>signature</type><value compute="signer"></value><signer>Jane D Smith, [email protected]</signer><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><signformat>application/vnd.xfdl;

csp="Microsoft Base Cryptographic Provider v1.0";csptype=rsa_full;hashalg=sha1

</signformat><signoptions>

<filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions><signitemrefs>

<filter>omit</filter><itemref>PAGE1.mgrSigButton</itemref><itemref>PAGE1.admSigButton</itemref><itemref>PAGE1.empsignature</itemref><itemref>PAGE1.mgrsignature</itemref><itemref>PAGE1.admsignature</itemref>

</signitemrefs><signature>empsignature</signature>

</button>...<signature sid="empsignature">

<signformat>application/vnd.xfdl;csp="Microsoft Base Cryptographic Provider v1.0";csptype=rsa_full;hashalg=sha1

</signformat><signer>Jane D Smith, [email protected]</signer><fullname>

"Verisign, Inc.", Verisign Trust Network,"www.verisign.com/repository/RPA Incorp. byRef.,LIAB.LTD(c)98", Persona Not Validated,Digital ID Class 1 - Microsoft, Jane DSmith, [email protected]

XFDL Version 7.7 53

Page 60: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</fullname><signature>PAGE1.empsignature</signature><signitemrefs>

<filter>omit</filter><itemref>PAGE1.mgrSigButton</itemref><itemref>PAGE1.admSigButton</itemref><itemref>PAGE1.empsignature</itemref><itemref>PAGE1.mgrsignature</itemref><itemref>PAGE1.admsignature</itemref>

</signitemrefs><!-- The items listed above MUST have itemlocation options with

absolute and extent as the last settings in order for the filterbelow to be sufficient in terms of security -->

<signoptionrefs><filter>keep</filter><optionref>PAGE1.mgrSigButton.itemlocation</optionref><optionref>PAGE1.admSigButton.itemlocation</optionref><optionref>PAGE1.empsignature.itemlocation</optionref><optionref>PAGE1.mgrsignature.itemlocation</optionref><optionref>PAGE1.admsignature.itemlocation</optionref>

</signoptionrefs><signoptions>

<filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions><mimedata encoding="base64">

MIIFMgYJKoZIhvcNAQcCoIIFIzCCBR8CAQExDzANBgkgAQUFADALB\ngkqhkiG9w0BBwGgggQZMCA36gAwSRiADjdhfHJl6hMrc5DySSP+X5j\nANfBGSOI\n9w0BAQQwDwYDVQQHEwhJbn<Rlcm5ldDEXMBUGA1UEChM\nOVmVyaVNpZ24sIEluYy4xNDAKn1ZlcmlTaWduIENsYXNzIDEgQ0Eg\nLSJbmRdWFsIFN1YnNjcmliyZXIwHhcNOTgwMTI3MwMDAwOTgwM\M1OTU5WjCCARExETA

</mimedata></signature>

Usage details1. When a user signs a form using a signature button, the viewer creates the

signature item as specified in the button’s signature option. The viewer alsoassociates the signature with the signature button, using the signature’ssignature option.

2. When a user signs a form, the signer, signformat, signgroups, signitemrefs,signitems, signnamespaces, signoptionrefs, and signoptions options are copied fromthe button description to the signature description.

3. While signformat is not mandatory for button items, it is mandatory forsignature items.

4. A copy of the XFDL description of the form or portion of the form that issigned is included in the signature’s mimedata option. This data is encryptedusing the hash algorithm specified in the button’s signformat option.

5. signatures always filter out the mimedata option for their own signature item,regardless of the signature filter settings. This is done because the mimedata isnot populated with the signature information until after the signature has beenapplied. (In other words, the signature can’t include itself because it hasn’tbeen generated yet.)

6. When a program checks a signed form, it compares the data in the mimedataoption with that of the portion of the form that is apparently signed. If thedescriptions match, then the signature remains valid. If the signatures do notmatch, the signature breaks, and the user is prompted.

7. An attempt to create a signature will fail if:v The item named by the signature button’s signature option already exists.

54 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 61: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v The signature button is already signed by any signature in the form.v The signer’s private key is unavailable for signing.

8. Filters can be used to indicate which items and options to keep and to omit.The explicit and implicit settings of an existing filter take precedence over animplication that might be drawn from a non-existing filter. Set up these filtersin the signature button description.

9. To use certain types of digital signatures (CryptoAPI or Netscape, for example),it is necessary for the user to obtain a digital signature certificate. Other typesof digital signatures require the user to have a pen/pad device installed on theuser’s computer.

XFDL Version 7.7 55

Page 62: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

spacerCreates space between items on a form. It can be any size specified. It is invisible.

Available options

fontinfo, itemlocation, itemnext, itemprevious, label, linespacing, size,xformsenabled

Example

This example shows a spacer item that uses the size option to define the amount ofspace it will occupy.

<spacer sid="THREE_SPACER"><size>

<width>1</width><height>3</height>

</size></spacer>

This example shows the spacer item that uses a label to define the amount of spaceit will occupy. This sizing technique is useful when creating a spacer that is exactlythe same size as a real label on the form.

<spacer sid="WELCOME_SPACER"><label>Welcome to Information Line</label>

</spacer>

Usage details1. A spacer can be sized either by giving it length and width dimensions (using

size), by expanding the default size using the itemlocation option or by giving ita label. If a label is used, the spacer equals the size of the text typed into thelabel. The label does not appear; it is simply used to determine the spacer’ssize.

2. When setting the size option of a spacer, the height and width of the spacer willbe based on the average character size for the font in use (set with the fontinfooption).

3. If you set the width for a spacer, but not the height, then the spacer willautomatically grow to accommodate the text within the given width. In otherwords, the text will wrap to fit within the width specified, and the height willincrease to accommodate the text.

56 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 63: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

toolbarAllows the definition of a toolbar for a page. A toolbar is a separate and fixed areaat the top of the page that functions much like a toolbar in a word processingapplication. Items placed in the toolbar are always visible at the top of the form,no matter what portion of the page they are viewing.

The toolbar is visible no matter what portion of the page body is visible. However,if the toolbar is larger than half the form window, it is necessary to scroll to seeeverything it contains.

Available options

bgcolor, itemnext, itemprevious, mouseover

Example

This example shows a toolbar that contains a label.

Here is the toolbar definition:<toolbar sid="TOOL_BAR">

<bgcolor>cornsilk</bgcolor></toolbar>

Here is the label that will appear in the toolbar.<label sid="COMPANY_NAME">

<value>My Company</value><itemlocation>

<within>TOOL_BAR</within></itemlocation>

</label>

Usage details1. The background color of the toolbar becomes the default background color for

items in the toolbar.2. Add items to the toolbar using the within modifier of the itemlocation option.

Code the itemlocation option in each included item’s definition.3. Each page can contain only one toolbar.4. If an XForms item is placed in the toolbar, then any items controlled by it are

also placed in the toolbar, regardless of individual declarations. For example, ifa table were placed in the toolbar, then all items in that table would alsoappear in the toolbar.

XFDL Version 7.7 57

Page 64: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<custom item>Allows form designers to add application specific information to the formdefinition.

This is useful when submitting forms to applications requiring non-XFDLinformation. An example of non-XFDL information might be a SQL querystatement.

Available options

All XFDL options, the xforms:input or xforms:textarea options, and any customoptions can be used with custom items.

Example

This is an example of a custom item definition. It includes both an XFDL and acustom option.

<custom:event xfdl:sid="STATUS_EVENT"xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom"><xfdl:active>off</xfdl:active><custom:ID>UF45567/home/users/preferences01</custom:ID>

</custom:event>

Usage details1. Custom items must be in a non-XFDL namespace.2. Custom items can also change the default namespace from the XFDL

namespace URI in order to eliminate excess prefixes within the desirednamespace.

3. Custom items may omit the XFDL scope identifier, but a sid attribute in theXFDL namespace must be provided in order to reference the custom item’scontent with the XFDL compute system. Since default namespaces are notapplied to attributes, the sid attribute must still be qualified by a namespaceprefix associated with the XFDL namespace URI.

4. Both XFDL options and custom options within the custom item can havecomputed values by using the XFDL compute attribute, which must bequalified with a namespace prefix associated with the XFDL namespace URI.

Details on XForms itemsXForms items are only required when you are creating an XFDL form that containsan XForms data model.

These items are used to contain XForms constructs that do not normally exist inXFDL, such as tables and checkgroups that automatically repeat elements based onthe structure of the data model.

XForms items follow the same syntax rules as XFDL items.

58 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 65: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

checkgroupCreates a group of check boxes. This is useful if you want to create a list of optionsand allow the user to select some of them. You can configure a checkgroup toallow only one selection, or to allow any number of selections.

Each check box appears as an empty box that is filled with a marker, such as acheck mark or an X, when selected.

Note that checkgroup items are only valid for XForms forms. If you are not usingXForms, use the check item instead.

Available Options

acclabel, active, bgcolor, border, focused, format, help, itemlocation, itemnext,itemprevious, label, labelbgcolor, labelborder, labelfontcolor, labelfontinfo,mouseover, next, previous, printbgcolor, printlabelbgcolor, printlabelfontcolor,printvisible, readonly, suppresslabel, value, visible, xformsenabled, xformsreadonly,xformsrequired, xformsvalid, xforms:select, xforms:select1

Example

The following code creates a checkgroup with three choices: US dollars, Canadiandollars, and Euros. The choices themselves are defined within the xforms:selectoption.

<checkgroup sid="currency"><xforms:select ref="currency" appearance="full">

<xforms:label>Select the currencies you accept:</xforms:label><xforms:item>

<xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value>

</xforms:item><xforms:item>

<xforms:label>CDN Dollars</xforms:label><xforms:value>CDN</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Euro</xforms:label><xforms:value>Euro</xforms:value>

</xforms:item></xforms:select>

</checkgroup>

Alternatively, you could create the choices in your data model as follows:<xforms:instance xmlns="">

<data><currency/><choice show="US Dollars">USD</choice><choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

In this case, you would use the xforms:select option to link to those choices, asillustrated by the following checkgroup:

<checkgroup sid="currency"><xforms:select ref="currency" appearance="full">

<xforms:label>Select the currencies you accept:</xforms:label><xforms:itemset nodeset="instance('currency')/choice">

<xforms:label ref="@show"></xforms:label>

XFDL Version 7.7 59

Page 66: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:value ref="."></xforms:value></xforms:itemset>

</xforms:select></checkgroup>

Usage Details1. To allow the user to select any number of choices in the checkgroup, use an

xforms:select option. To limit the user to selecting one choice from thecheckgroup, use an xforms:select1 option.

2. The check boxes in a checkgroup item are arranged vertically by default (thatis, each check appears immediately below the previous choice).

3. To arrange a checkgroup item in another manner, use the <xforms:extension>element to add an itemlocation to each check in the group. For example, youmight set the checks to appear one after another horizontally with thefollowing itemlocation:

<xforms:extension><itemlocation>

<after compute="itemprevious"/></itemlocation>

</xforms:extension>

For more information about the <xforms:extension> element, refer to“xforms:select” on page 327 or “xforms:select1” on page 333.

4. Each check box in a checkgroup can have its own label. These labels aredisplayed immediately to the right of each check box (rather than above eachcheck box, as with the check item).

5. The single node binding in the xforms:select or xforms:select1 option createsa link between the value option for the checkgroup and the bound element inthe data model, so that they share data. When the user makes a selection, thexforms:value of that selection is stored in both locations.

6. If the user makes multiple selections, those choices are stored as a spacedelimited list. Because this list is space delimited, the choices themselvescannot contain spaces.

7. The contents of the value option for the checkgroup are never serialized.8. The mouseover option is active for each check box in the group, not for the

group as a whole. This means that you can use the <xforms:extension>element to make changes to individual check boxes in the group. For example,the following checkgroup changes the background color of each radio buttonwhen the mouse is over it:

<xforms:itemset nodeset="instance('currency')/choice"><xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<bgcolor compute="mouseover == 'on' ? 'blue' : 'green'"/></xforms:extension>

</xforms:select>

9. The itemlocation of check box buttons in a checkgroup is interpreted relativeto the top-left of the group, not the top-left of the form. The top-left of thegroup is set 3 pixels in from the left edge of the group, and 3 pixels downfrom the top edge of the group. This allows room for a border to be added tothe group.

10. If using relative positioning, you can give each check an itemlocation of afterthe itemprevious, as shown:

60 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 67: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:extension><itemlocation>

<after compute="itemprevious"/></itemlocation>

</xforms:extension>

This will place each check after its predecessor, except for the first check,which is placed at the top left corner of the group. For the first check, theafter command is ignored because the checkgroup position is not set untilafter the contained check items are positioned, and itemlocation keywords areignored when they refer to items that have not been positioned.

11. Use the layoutflow option to control if the content is displayed vertically orhorizontally.

12. The itemnext is set as follows:v The checkgroup itself refers to the first check in the group.v The last check in the group refers to the item that follows the checkgroup

in the build order.v The item that precedes the checkgroup in the build order refers to the

checkgroup itself.13. The size of a checkgroup is determined by the size of the radio items and

labels in that group. As such, the extent setting in the itemlocation option hasno affect on the group’s sizing.

14. You can use the constraint setting in the data model to limit the number ofselections the user can make. To do this, set the <xforms:value> of eachselection to a standard length. For example, you might have five choices andgive them values of 1-5 (each being one character long). When the user makessome selections, the values of the selections are concatenated into a spacedelimited list. You can predict the length of this list based on the length ofyour standard values. For example, if the user selects two items, then the listwill be three characters long (1 2), while selecting three items will create a listthat is 5 characters long (1 3 5). This allows you to set a constraint on thelength of that value (which is stored by the data element that is bound to the<xforms:select>) that will actually limit the number of selections the user canmake.

15. You can then set a constraint on the data element that is bound to the<xforms:select> so that it cannot exceed a certain length. In this case, limitingit to a length of less than or equal to five will only allow three selections to bemade.

16. Do not use itemprevious to compute the location of an item after ancheckgroup . Doing so can break signatures, as the items inside checkgroupsreceive random scope identifiers at runtime. If you sign the form with acompute resolved to a random sid, the compute is locked to that random sid.If you then re-open the form, the items inside the checkgroups are assignednew random sids, which do not correspond with the sid associated with thecompute and break the signature.

XFDL Version 7.7 61

Page 68: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pane

A pane is used to contain one of the following:v A group of items that can be positioned or made visible as a unit, and that can

be given a common border or background.v A switch, which allows you to group items into sets, and then display one set of

items at a time to the user.

The pane itself can also have a physical appearance, such as a border or a differentbackground color, that visually groups the items for the user.

Available Options

active, bgcolor, border, first, focused, itemlocation, itemnext, itemprevious, last,label, labelbgcolor, labelfontcolor, labelfontinfo, next, padding, previous,printbgcolor, printlabelbgcolor, printlabelfontcolor, printvisible, suppresslabel,visible, xformsenabled, xformsreadonly, xformsrequired, xformsvalid,xforms:group, xforms:switch

Example

The following example shows a data model that we will link to a group of itemscontained within a pane:

<xformsmodels><xforms:model>

<xforms:instance xlmns="" id="customerInfo"><customerData>

<name></name><address>

<street></street><city></city><country></country>

</address></customerData>

</xforms:instance></xforms:model>

</xformsmodels>

The following pane contains a group of items in an xforms:group that link to thedata model:

<pane sid="Address"><xforms:group ref="address">

<field sid="street"><xforms:input ref="street">

<xforms:label>Street:</xforms:label></xforms:input>

</field><field sid="City">

<xforms:input ref="city"><xforms:label>City:</xforms:label>

</xforms:input></field><field sid="Country">

<xforms:input ref="country"><xforms:label>Country:</xforms:label>

</xforms:input></field>

</xforms:group></pane>

62 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 69: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The following example shows a pane that contains an xforms:switch. This panecreates a ″wizard″ style form, in which the user completes one section then clicks abutton to move to the next section. Each section is enclosed by an xforms:casewithin the xforms:switch, and each section except the last contains a button thatchanges the switch to the next case:

<pane sid="wizard"><xforms:switch>

<xforms:case id="applicantName" selected="true"><field sid="firstName">

<xforms:input ref="applicant/firstname"><xforms:label>Enter your first name:</xforms:label>

</xforms:input></field><field sid="lastName">

<xforms:input ref="applicant/lastname"><xforms:label>Enter your last name:</xforms:label>

</xforms:input></field><button sid="nextCase1">

<xforms:trigger><xforms:label>Next</xforms:label><xforms:toggle case="spouseName"ev:event="DOMActivate"/>

</xforms:trigger></button>

</xforms:case><xforms:case id="spouseName" selected="false">

<field sid="spouseFirstName"><xforms:input ref="spouse/firstname">

<xforms:label>Enter the first name of your spouse:</xforms:label>

</xforms:input></field><field sid="spouseLastName">

<xforms:input ref="spouse/lastname"><xforms:label

>Enter the last name of your spouse:</xforms:label></xforms:input>

</field><button sid="nextCase2">

<xforms:trigger><xforms:label>Next</xforms:label><xforms:toggle case="address"ev:event="DOMActivate"/>

</xforms:trigger></button></xforms:case><xforms:case id="address" selected="false">

<field sid="street"><xforms:input ref="address/street">

<xforms:label>Enter your street address:</xforms:label>

</xforms:input></field><field sid="city">

<xforms:input ref="address/city"><xforms:label

>Enter the city you live in:</xforms:label></xforms:input>

</field></xforms:case>

</xforms:switch></pane>

XFDL Version 7.7 63

Page 70: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage Details1. A pane item will always expand to contain the items you place within it,

regardless of the specific size you set for the pane.2. If a pane is contained within an xforms:repeat, then the pane and all items

within the pane are duplicated for each row of the table.3. The next and previous options in the pane determine which items precede

and follow the pane in the tab order, but do not affect the tab order within thepane. Instead, the next and previous options within the items in the panecontrol the tab order within the pane.

4. The first and last options determine where the focus is initially place whenthe user tabs into a pane item.

5. If a pane is not visible, then none of the controls in the pane will be visible,regardless of their state of visibility.

6. If a pane does not have a visible option (or if it is empty), then the signednode binding of the xforms:group helps determine visibility.

7. The size of a pane is determined by the size of the items in the pane. As such,the extent setting in the itemlocation option has no affect on the pane’s sizing.

8. The padding option allows you to define how much white space is putaround the pane item. Useful when putting a Pane around rows in a table.This option lets you minimize empty space between rows.

Note: 3 pixels are required to draw a border outside the Pane item.9. Use the layoutflow option to control if the content is displayed vertically or

horizontally.10. The itemprevious is set as follows:

v The pane refers to the item that precedes the pane in the build order.v The first item in the first row of the pane refers to the pane itself.v The item that follows the pane in the build order refers to the last item in

the last row of the pane.11. The itemnext is set as follows:

v The pane itself refers to the first item in the pane.v The last item in the pane refers to the item that follows the pane in the

build order.v The item that precedes the pane in the build order refers to the pane itself.

12. The label option defaults to the xforms:label of the xforms:group within thepane.

13. Do not use itemprevious to compute the location of an item after an pane .Doing so can break signatures, as the items inside panes receive randomscope identifiers at runtime. If you sign the form with a compute resolved to arandom sid, the compute is locked to that random sid. If you then re-open theform, the items inside the pane are assigned new random sids, which do notcorrespond with the sid associated with the compute and breaks the signature.

64 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 71: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

radiogroupCreates a group of radio buttons. This is useful if you want to create a list ofoptions from which the user may select only one choice.

Each radio button appears as an empty circle that is filled with a marker, such as adot, when selected.

Note: radiogroup items are only valid for XForms forms. If you are not usingXForms, use the radio item instead.

Available Ooptions

acclabel, active, bgcolor, border, focused, format, help, itemlocation, itemnext,itemprevious, label, labelbgcolor, labelborder, labelfontcolor, labelfontinfo,mouseover, next, previous, printbgcolor, printlabelbgcolor, printlabelfontcolor,printvisible, readonly, suppresslabel, value, visible, xformsenabled, xformsreadonly,xformsrequired, xformsvalid, xforms:select1

Example

The following code creates a radiogroup with three choices: US Dollars, CDNDollars, and Euro. The choices themselves are defined within the xforms:select1option.

<radiogroup sid="currency"><xforms:select1 ref="selectedCurrency" appearance="full">

<xforms:label>Select the currency you accept:</xforms:label>

<xforms:item><xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value>

</xforms:item><xforms:item>

<xforms:label>CDN Dollars</xforms:label><xforms:value>CDN</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Euro</xforms:label><xforms:value>Euro</xforms:value>

</xforms:item></xforms:select1>

</radiogroup>

Alternatively, you could create the choices in your data model as follows:<xforms:instance id="currency" xmlns="">

<data><choice show="US Dollars">USD</choice><choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

In this case, you would use the xforms:select1 option to link to those choices, asillustrated by the following checkgroup:

<checkgroup sid="currencyType"><xforms:select1 ref="selectedCurrency" appearance="full">

<xforms:label>Select your preferred currency for payment:</xforms:label>

<xforms:itemset nodeset="instance('currency')/choice"><xforms:label ref="@show"></xforms:label>

XFDL Version 7.7 65

Page 72: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:value ref="."></xforms:value></xforms:itemset>

</xforms:select1></checkgroup>

Usage details1. To allow the user to select any number of choices use a checkgroup instead of

a radiogroup.2. Each radio button in a radiogroup can have it’s own label. These labels are

displayed immediately to the right of the radio button (rather than above theradio button, as with the radio item).

3. The single node binding in the xforms:select1 option creates a link betweenthe value option for the radiogroup and the bound element in the data model,so that they share data. When the user makes a selection, the xforms:value ofthat selection is stored in both locations.

4. The contents of the value option for the radiogroup are never serialized.5. The mouseover option is active for each radio button in the group, not for the

group as a whole. This means that you can use the <xforms:extension>element to make changes to individual radio buttons in the group. Forexample, the following radiogroup changes the background color of eachradio button when the mouse is over it:

<xforms:itemset nodeset="instance('currency')/choice"><xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<bgcolor compute="mouseover == 'on' ? 'blue' : 'green'"/></xforms:extension>

</xforms:itemset>

6. The itemlocation of radio buttons in a radiogroup is interpreted relative tothe top-left of the group, not the top-left of the form. The top-left of the groupis set 3 pixels in from the left edge of the group, and 3 pixels down from thetop edge of the group. This allows room for a border to be added to thegroup.

7. If using relative positioning, you can give each radio an itemlocation of afterthe itemprevious, as shown:

<xforms:extension><itemlocation>

<after compute="itemprevious"/></itemlocation>

</xforms:extension>

This will place each radio after its predecessor, except for the first radio,which is placed at the top left corner of the group. For the first radio, the aftercommand is ignored because the radiogroup position is not set until after thecontained radio items are positioned, and itemlocation keywords are ignoredwhen they refer to items that have not been positioned.

8. Use the layoutflow option to control if the content is displayed vertically orhorizontally.

9. The itemnext is set as follows:v The radiogroup itself refers to the first radio in the group.v The last radio in the group refers to the item that follows the radiogroup in

the build order.v The item that precedes the radiogroup in the build order refers to the

radiogroup itself.

66 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 73: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

10. The size of a radiogroup is determined by the size of the radio items andlabels in that group. As such, the extent setting in the itemlocation option hasno affect on the group’s sizing.

11. Do not use itemprevious to compute the location of an item after anradiogroup . Doing so can break signatures, as the items inside radiogroupsreceive random scope identifiers at runtime. If you sign the form with acompute resolved to a random sid, the compute is locked to that random sid.If you then reopen the form, the items inside the radiogroups are assignednew random sids, which do not correspond with the sid associated with thecompute and break the signature.

XFDL Version 7.7 67

Page 74: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

sliderCreates a sliding control, similar to a volume control, that lets the user set a valuewithin a specific range. The slider is always horizontal.

Note: This item is only available in an XForms form. There is no equivalent for anXFDL form.

Available options

acclabel, active, bgcolor, border, focused, fontcolor, fontinfo, format, help,itemlocation, itemnext, itemprevious, label, labelbgcolor, labelborder, labelfontcolor,labelfontinfo, next, previous, printbgcolor, printfontcolor, printlabelbgcolor,printlabelfontcolor, printvisible, readonly, size, suppresslabel, value, visible,xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:range

Example

The following example shows and slider that allows the user to select any numberbetween 1 and 10:

<slider sid="rating"><xforms:range ref="rating" start="1" end="10" step="1">

<xforms:label>Rate this form on a scale of 1 to 10</xforms:label></xforms:range>

</slider>

Usage details1. The numbers that indicate the value are always shown at the bottom the slider.2. The fontcolor and fontinfo option affect the numbers that show the value of

the slider.3. The single node binding in the xforms:range option creates a link between the

value option for the slider and the bound element in the data model, so thatthey share data. When the user makes a selection, that value is stored in bothlocations.

4. The contents of the value option for the slider are never serialized.5. The suppresslabel option suppresses the slider’s label, but does not affect the

numbers that indicate the value.

68 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 75: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

tableCreates a traditional table of repeated items organized into rows. This isaccomplished by creating a template row that includes all of the items that shouldappear in each row. This row is then linked to the XForms data model.

Each time a new row is added to the table, the template items are duplicated tocreate the new row. This occurs when the elements in the data model that arelinked to those items are duplicated. This allows the table to expand to any sizewhile ensuring that data for each row in the table is still maintained in the datamodel.

The template row is created within an xforms:repeat option. This option is used togroup the items that create the template row, and also links the row to particularportion of the data model. The template items can be configured with any locationrelative to one another. This means that they need not appear in horizontalsuccession.

Rows are added or removed from a table using the xforms:insert andxforms:delete action respectively. For more information about actions, see “Detailson XForms actions” on page 347.

Available Options

active, bgcolor, border, first, focused, itemlocation, itemnext, itemprevious, last,next, previous, printbgcolor, printvisible, rowpadding, visible, xformsenabled,xformsreadonly, xformsrequired, xformsvalid, xforms:repeat

Example

Before creating a table, you should create the data model that the table will reflect.The data model should group the elements you want in the table by rows. Forexample, suppose you wanted to create a purchase order form. Your table mightcollect three pieces of information: what the user wants to purchase, how manyunits they want to purchase, and what the cost of that item is. You might createthe following data model to store that information:

<po><order>

<row><product></product><quantity></quantity><lineTotal></lineTotal>

</row></order>

</po>

As you can see, the three data elements are contained by a <row> element. Thiswill allow us to duplicate any number of rows.

For the actual table, we will use the following items to reflect the data model: apopup that lets the user select which product to purchase, a field that lets thementer a quantity for the product, and a label that displays the cost of the products.Furthermore, these items will be contained within an xforms:repeat option, we willlink that option to the <row> element in the data model, as shown:

<table sid="itemsTable"><xforms:repeat nodeset="order/row">

<popup sid="Product"><xforms:select1 appearance="minimal" ref="product">

XFDL Version 7.7 69

Page 76: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:label>Choose product</xforms:label><xforms:item>

<xforms:label>Widget</xforms:label><xforms:value>widget</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Gadget</xforms:label><xforms:value>gadget</xforms:value>

</xforms:item></xforms:select1>

</popup><field sid="Qty">

<xforms:input ref="quantity"><xforms:label></xforms:label>

</xforms:input></field><label sid="LineTotal">

<xforms:output ref="lineTotal"></xforms:output><value></value>

</label></xforms:repeat>

</table>

When the user adds rows to the table, the description of the table does not change.Instead, the data model expands to include the new data. For instance, if the userhad entered two rows of data, your data model might look like this:

<po><order>

<row><product>widget</product><quantity>2</quantity><lineTotal>2.00</lineTotal>

</row><row>

<product>gadget</product><quantity>5</quantity><lineTotal>15.00</lineTotal>

</row></order>

</po>

Based on this data model, the Viewer will create two rows of the popup, field, andlabel items, with no changes to the markup for the table item. This occurs becausethe nodeset in the xforms:repeat binds to every <row> element in the <order>,duplicating the template items for each.

Usage Details1. To add rows to a table or remove rows from a table, you must use the

xforms:insert and xforms:delete actions respectively. For more informationabout these actions, refer to “Details on XForms actions” on page 347.

2. When using an xforms:insert action or an xforms:delete action, you shouldadd an xforms:bind that makes the data elements for the last rownon-relevant. For example:

<xforms:bind nodeset="order/row[postion()=last()]"relevant="false()"/>

This allows you to start with an empty table but also helps you to preserve arow of data that is used as a prototype when you insert a new row.You should also amend the delete action so that it does not delete thisprototypical row. For example:

<xforms:delete nodeset="order/row[last()>1]" at="index('table')/>

70 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 77: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

If the prototypical row of data is deleted, the xforms:repeat becomesnon-functional, as there is no data template for the xforms:insert to use. Thisis a limitation of XForms 1.0.

3. The itemlocation of items in table rows is interpreted relative to the top-left ofthe table row, not the top-left of the form. The top-left of each row isdetermined as follows:v Each row is set 3 pixels in from the left edge of the table.v The first row is set 3 pixels below the top of the table.v Each successive row is set 1 pixel below the previous row.

By default, only 1 pixel of space is inserted between rows. As such, werecommend that you position the items in your rows to add the desiredamount of additional space to the top of each row. For example, you mightset each item in a row to have a <y> value of 2, thereby adding 2 pixels ofspace to the top of the row.

4. The itemlocation of items in table rows may reference items in the same rowof a table, or items outside of the table. For instance, you might want to alignan item in a row with a column heading. However, the itemlocation cannotreference containers (such as panes or tables) that contain that item.

5. The next and previous options in the table determine which items precedeand follow the table in the tab order, but do not affect the tab order withinthe table.

6. When tabbing into a table, a forward tab places you in the first row of thetable and reverese tab places you on the last row of the table. The first andlast options determine which item in that row receives the focus.

7. Tab order within a table is determined by the next and previous optionswithin the items in each row, combined with the natural order of the rows.When you are on the last item in a row and tab forward, you move to thefirst item in the next row. When you are on the first item in a row and tabbackward, you move to the last item in the previous row.

8. When using computes with a table, the following restrictions apply:v Computes written within a row may not reference elements in a different

row.v Computes written outside a row may not reference elements within a row.

Note that this means computes within a row of a table may referenceelements outside of the table.

9. If the nodeset binding of the xforms:repeat is empty or contains non-relevantnodes, then the xforms:repeat provides a default of false to the table’s visibleand active options.

10. If the table is not visible, then none of the controls in the table will be visible,regardless of their states of visibility.

11. When working with tables, users will also need controls (such as buttons) thatcan add and delete rows. To do this, you must use the xforms:insert andxforms:delete actions. For more information about these actions, refer to“Details on XForms actions” on page 347.

12. The size of a table is determined by the size of the items in the table. As such,the extent setting in the itemlocation option has no affect on the table’s sizing.

13. The expandheight and expandwidth settings for the itemlocation optionallow you to resize height and width of an items more precisely. This isparticularly useful for resizing lines that are used to separate table rows andcolumns.

XFDL Version 7.7 71

Page 78: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

14. The layoutflow option allows you to control whether items are placed thevertically or horizontally within each row of the table.

15. The rowpadding option allows you to adjust the spacing between each row inthe table.

16. The itemprevious is set as follows:v The table refers to the item that precedes the table in the build order.v The first item in the first row of the table refers to the table itself.v The item that follows the table in the build order refers to the last item in

the last row of the table.17. The itemnext is set as follows:

v The table itself refers to the first item in the first row of the table.v The last item in the last row of the table refers to the item that follows the

table in the build order.v The item that precedes the table in the build order refers to the table itself.

18. Do not use itemprevious to compute the location of an item after an table .Doing so can break signatures, as the items inside tables receive randomscope identifiers at runtime. If you sign the form with a compute resolved to arandom sid, the compute is locked to that random sid. If you then re-open theform, the items inside the tables are assigned new random sids, which do notcorrespond with the sid associated with the compute and break the signature.

Details on options and array elementsIn the XFDL language, options that define the item characteristics. Optionsthemselves may contain any number of array elements, which further define thecharacteristics. Options can contain simple character data, computes orcomputations, or array elements.

Syntax

For simple character data content:<optionTag>character data content</optionTag>

For computed options:<optionTag compute="expression">character data content</optionTag>

For array options:<optionTag>

<!-- suboption elements --></optionTag>

An option defines a characteristic given to a form, a page, or an item. For example,the bgcolor option set at the form or page global level defines the backgroundcolor of the pages of the form itself whereas a bgcolor option set at the item leveldefines the background color for the containing item. Some form and page globaloptions define defaults for item-level options. For example, if an item has nofontinfo option, then the fontinfo in the page globals are used, and if the pageglobals contain no fontinfo option, then the fontinfo in the form globals (and theform global fontinfo has implied defaults if it is not specified).

The definition of an option consists of content between start and end tags. Theelement tag defines the type of option. This type must be one of the option types

72 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 79: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

defined in this specification, or a user-defined option that follows the rules in the″custom option″ description in this specification.

Note: For information about XForms options, refer to “Details on XForms options”on page 298.

Option content

The content of an option can take one of three formats: simple character data, acompute, or an array of subordinate XML elements. Computes are identified by acompute attribute, while arrays are identified by the presence of subordinateelements.

Simple character dataThe default is simple character data, in which case the option must containtext with no child elements. For example:

<value>This is the value</value>

Computes

If the character content must be computed, then the computationalexpression appears in the start tag of the option in an attribute namedcompute. If the XFDL computation system has been applied to the form,then the option also contains simple character data for the currentcomputed value of the expression. For example:

<value compute="price1Field.value + price2Field.value * '0.07'">205.68</value>

It is typical to have a form run its computes on a client machine, then haveserver modules simply read the current values, ignoring the content of thecompute attributes. In essence, an application can ignore the computeattributes unless it must change element values that are referenced bycomputed options. See section “The XFDL compute system” on page 660for details on how the compute expression is represented.

ArraysThe third case for an option’s content is an array of subordinate elements.The option must contain one or more array elements. For example:

<itemlocation><below>nameField</below><after>addressField</after>

</itemlocation>

Each array element may also contain an array. This recursive definitionpermits arbitrary depth for XFDL arrays.XFDL assigns names to thesearray elements so that they are easier to reference.

Order of precedence of options

An option set at a lower level in the form hierarchy overrides a similar option setat a higher level. It overrides it for only the level it is in and any that come belowit in the hierarchy. For example, the fontinfo option in the following examplewould override a global fontinfo setting for the page it is in, and also for anyitems in that page.

<page sid="Page1"><global="global">

<fontinfo><fontname>Helvetica</fontname>

XFDL Version 7.7 73

Page 80: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<size>12</size><effect>plain</effect>

</fontinfo></global>

Defining form global and page global options

Form global options are optional and must be defined in a <global> element in a<globalpage> element after the XFDL start tag and before the first <page> in aform. Page global options are optional and must be defined in a <global> elementafter the <page> start tag and before the first item in a page. To determine whetheran option is a valid form global or page global option, see section “Form globals”on page 25.

Data type designators used in option descriptions

XFDL defines a set of data types that describe type of content allowed in anoption. Each option description in this specification uses one or more of thefollowing data type designators:

char A single ASCII character.

string A series of ASCII characters.

color A color name, an RGB triplet, or a hexadecimal RGB value that representsthe color.

The syntax of an RGB triplet is:<bgcolor>Red, Green, Blue</bgcolor>

Where red, green, and blue are values from 0 to 255.

The syntax for a hexadecimal RGB value is:<bgcolor>#RRGGBB</bgcolor>

Where RR, GG, and BB are the hexadecimal values for the red, green, andblue settings.

coordinateWhole number in the range 0 to 1,000 representing one coordinate of aposition.

integerPositive or negative whole number in the range -32,768 to 32,767.

unsigned byteWhole number in the range 0 to 255.

unsignedWhole number in the range 0 to 65,535.

numeric booleanA value of 0 or 1, in which 0 is false and 1 is true.

74 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 81: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

acclabelDefines a message that is available to active screen readers. When the focus shiftsto the item containing the acclabel, the message is read aloud by the screen reader.The message should contain additional information about the item to assist userswith vision impairments.

Syntax

Table 1. acclabel parameters

Parameter Type Description

message string A message that is read aloud tousers.

Available in

button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, slider

Example

The following example shows a field that contains an accessibility message.<field sid="firstName">

<acclabel>Type your first name.</acclabel></field>

When the focus moves to the field, the acclabel message will be passed to thescreen reader, which will read ″Type your first name″ aloud.

Usage details1. Default: none2. Screen readers normally provide information in addition to the acclabel option.

This information is defined by the screen reader in use, and cannot becontrolled through XFDL.

3. If the item contains a label option, the screen reader will read the label optionas well as the acclabel option.

4. If the item has a value option, the screen reader will read the item’s value. Ifthe item has a blank value, the screen reader will say that the item is empty.

5. If the item has associated cells, the screen reader reads the value option of thecells.

6. If the item contains a help option, the screen reader will read the value of theassociated help item. The screen reader will also read this help message if theitem contains a format option and the item’s content is invalid when the usertries to tab to a new item

7. If the item contains a format option with a message flag, the screen reader willread the contents of the message flag if the item’s content is invalid when theuser tries to tab to a new item.

8. If the item is signed, the screen reader reads the signed message as well as theacclabel option. The signed message is defined by the Viewer and is notmodifiable through XFDL.

<acclabel>message</acclabel>

XFDL Version 7.7 75

Page 82: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

9. If you are using a label item to provide information for another item, theacclabel option of the second item should include the contents of the label item.Since label items never receive the focus, screen readers will never read theircontents. The acclabel option can provide the same information to users, withfurther explanation if necessary.

10. The following table provides the actions which invoke the screen reader andthe order in which it reads the messages provided by the form and theViewer:

Table 2. Table of actions for screen readers.

ActionViewer HelpOn

Item issigned Messages Read by Screen Reader

Item gains focus No No label option + acclabel + value

Item gains focus Yes No label option + acclabel + value + help

Item gains focus n/a Yes label option + acclabel + value + help +signed

Tab out of itemfailed

n/a n/a format + help

Spacebar or arrowkeys activate listof choices

n/a No cell value

76 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 83: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

activatedSpecifies whether an item, page, or form is currently activated by the user or not.This option is usually set by an external program such as a parser, but undercertain circumstances can be set by computes in the form.

The activated option for an item can be set by a compute if the item is an action,button or cell utilized on the current page. The activated option must be set toeither on or off and the item must be capable of being activated. Cells that are notgrouped with a popup, combobox or list on the current page cannot be activated.Buttons that are not visible cannot be activated.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax<activated>status</activated>

Table 3. activated properties

Parameter Type Description

status on item, page, or form is currentlyactivated by user

off item, page, or form is notcurrently activated by user

maybe button only: item might beactivated, as user has pressed it,but has not yet released it

Available in

action, button, cell, combobox, popup, page global, form global

Example

The following example shows a button that changes color when it is activated:<button sid="saveButton">

<type>saveas</type><value>Save</value><activated>off</activated><bgcolor compute="toggle(activated, 'off', 'on') == '1'

? 'white' : 'gray'"></bgcolor></button>

The button will appear white when the user activates it, and gray otherwise.

The following example shows how the activated option can be set for an itembased on user input. This use of the activated option works with the keypressoption to establish a default button on the form.

<button sid="DefaultButton"><type>cancel</type><activated>off</activated><custom:myoption compute="toggle(global.keypress, '', &#xA;

'ESC') == '1' ? set('activated','on') : &#xA;''"></custom:myoption>

</button>

XFDL Version 7.7 77

Page 84: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

When the user presses the ESC key (which is not processed by any item on theform), the activated option for the button will be set to on and the button will fire.

Usage details1. Default: off2. Activated is set to on when an item is activated, and remains on until any

transaction initiated by the item is properly under way. For example, in a printbutton, activated will be turned on when the user initiates the print action, andwill remain on until network results indicate the print action is taking place.

3. The activated option is not included in form descriptions that are saved ortransmitted.

4. Specific details on activated behavior for each item:v action — actions set activated to on when they fire, and off when the

transaction they initiate is under way.v button — buttons set activated to maybe when the user holds the mouse

pointer or space bar down on the button. They set it to on if the user releasesthe pointer or space bar while over the button, and they set activated to offwhen the transaction the button initiates is under way.

v cell — cells behave in the same manner as buttons. In the split second duringwhich a user selects a select type of cell, it sets activated to on. It turnsactivated off as soon as the action of being selected is finished. Cells thatinitiate network transactions set activated to on from the beginning of therequest to the time when the request produces results. Note that there is nomaybe status for a cell.

v combobox and popup — comboboxes and popup lists set activated to onwhen their lists are popped open, and off when the lists are not open. Notethat the ″field″ portion of a combobox does not register an activated setting.

v page — a page sets activated to on while it is open, and off when it is not. Apage can be open and activated even when the form is minimized (notactively on screen).

v form — a form sets activated to on while it is open, and off when it is not. Aform can be open and activated even when it is minimized (not actively onscreen) .

78 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 85: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

activeSpecifies whether an item is active or inactive. Inactive items do not respond touser input and, if possible, appear dimmed. For example, an inactive check boxwill be dimmed and the user will not be able to select or deselect the box.

Syntax

Table 4. active properties

Parameter Type Description

status on item is active

off item is inactive

Available in

action, button, cell, check, checkgroup, field, help, label, list, popup, radio,radiogroup, slider

Example

This sample specifies the item is active.<active>on</active>

Usage details1. Default:v XFDL: on.v XForms: Defaults to the relevant property for the data element to which the

containing item is bound.2. Setting active to off is similar to setting the readonly option to on.

<active>status</active>

XFDL Version 7.7 79

Page 86: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

bgcolorDefines the background color of a page or an item.

Syntax

Table 5. bgcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192, 192, 192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

box, button, check, checkgroup, combobox, field, label, list, popup, radio,radiogroup, slider, table, toolbar, pane, page global, form global

Examples

These samples all set the background color to forest green.<bgcolor>forest green</bgcolor><bgcolor>34,139,34</bgcolor><bgcolor>#228B22</bgcolor>

Usage details1. Default: varies depending on the objectv Form: white

v Page: The form bgcolor setting or default (white)v Item (depends on the item type):

– button items: gray (or grey)– check, combobox, field, list, popup, radio, and slider items: white

– checkgroup and radiogroup items: transparent, but the individual checkand radio items that form the group default to white.

– label, table, and pane items: transparent (if no color is specified, the labelbackground color will be the same as the page background color).

– box items: transparent with a black outline– All other items: the background color of the page.

2. The transparent color has no RGB equivalent.

<bgcolor>color</bgcolor>

80 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 87: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v If button items are set to transparent it will disables press-in/pop-outanimations, does not change background color when inactive and does notchange the default border value to off.

XFDL Version 7.7 81

Page 88: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

borderDefines whether an item is displayed with a border. Borders are drawn as a threedimensional effect.

Syntax

Table 6. border parameters

Parameter Type Description

status on Item has a border.

off Item does not have a border

Available in

box, button, check, checkgroup, combobox, field, label, list, pane, popup, radio,radiogroup, slider, table

Example

This sample sets the item to display a border:<border>on</border>

Usage details1. Default:v For label items, the default is always off.v For all other items, the default is on.

2. If a bidirectional language is used, the border will be change to theRight-To-Left (rtl) orientation.

3. Items displaying a border rendering a 3D effect where a darker line is appliedto the left and top sides. The darker line indicates the outer placement edge ofthe item. If a bidirectional language is used or the orientation option of an itemis set to Right-To-Left (rtl), the 3D darker lines are swapped to the oppositeside (top and right).

non-bidi bidi

<border>status</border>

82 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 89: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

colorinfoRecords the colors used to draw the form when a user signs it. This option is onlycreated if the user is allowing the operating system colors to override the colorsettings in the form. This is most common for users with vision disabilities whomay set the operating system colors to provide better contrast between elementson the screen.

When the operating system colors override those set by the form itself, it is usefulto create a record of those colors so that the appearance of the document, whensigned, can be recreated.

Syntax

Table 7. colorinfo parameters

Parameter Type Description

color_name text The name of the operating systemcolor. Possible color namesinclude:

v window – The color of thewindow displaying the form.

v windowtext – The color of thetext used in the form.

v borderlight – The color of allthree dimensional bordersdrawn on the form.

v buttonshadow – The color usedto draw the shadow on abutton.

v buttonface – The color used forto draw the face of a button.

v buttontext – The color used todraw the text on a button.

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

<colorinfo><color_name1>color</color_name1>...<color_namen>color</color_namen>

</colorinfo>

XFDL Version 7.7 83

Page 90: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Available in

signature

Example

When a user signs a form that is respecting the operating system color, a colorinfoblock similar to the following is added to the signature item:

<colorinfo><window>255,255,255</window><windowtext>0,0,0</windowtext><borderlight>255,255,255</borderlight><bordershadow>157,157,157</bordershadow><buttonface>224,224,224</buttonface><buttontext>0,0,0</buttontext>

</colorinfo>

Usage details1. Default: none

84 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 91: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

coordinatesRecords the position of the mouse pointer on an image. The image must exist in abutton item. The recording occurs when a user selects (i.e. clicks) the button usingthe mouse pointer.

The position is an intersection on an unseen grid overlaying the image. The pointsalong each axis of the grid range from zero (0) through 1000 with position 0,0occurring in the button’s top left corner. The coordinates map the intersectionclosest to the mouse pointer’s position.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 8. coordinates parameters

Parameter Type Description

X_coordinate coordinate The coordinate on the X axis.

Y_coordinate coordinate The coordinate on the Y axis.

Available in

button

Example

When a user clicks on a button containing an image, a coordinates option isinserted into the button item. The following coordinates option sets a position of180 on the x-axis and 255 on the y-axis.

<coordinates><x>180</x><y>255</y>

</coordinates>

Usage details1. Default: none

<coordinates><x>X_coordinate</x><y>Y_coordinate</y>

</coordinates>

XFDL Version 7.7 85

Page 92: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

cursortypeControls which cursor icon is used when the user hovers over a button.

When the value is set to arrow, the pointing-arrow icon is shown when the user’smoused hovers over a button.

When value is set to hand, the pointing-hand icon is shown when the user’smouse hovers over a button.

This option is useful to make text look like a Web link.

Syntax

Table 9. cursor parameters

Parameter Type Description

type string Icon displayed when mousehovers over a button.

Valid values are arrow and hand.The default is arrow.

Available in

button

Example

The following example displays a button with underlined blue text to simulate aWeb link in a form.<button sid="IBMWeb">

<itemlocation><x>67</x><y>84</y>

</itemlocation><value>http://www.ibm.com</value><url>http://www.ibm.com</url><border>off</border><fontcolor>#0000FF</fontcolor><bgcolor>transparent</bgcolor><printbgcolor>transparent</printbgcolor><fontinfo>

<fontname>Arial</fontname><size>8</size><effect>underline</effect>

</fontinfo></button>

Usage details1. The default value is arrow.2. When in help mode, the set cursortype is displayed regardless of help mode.

<cursortype>type</cursortype>

86 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 93: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dataAssociates an action, button, or cell item with a single data item. The data option isvalid only in items with a type setting of enclose, display, extract, or remove.

Syntax

Table 10. data parameters

Parameter Type Description

data item string The item sid of the data item toassociate with the action, button,or cell.

Available in

action, button, cell

Example

The button below is an enclosure button associated with a single data item.<button sid="encloseImageButton">

<value>Update Image</value><type>enclose</type><data>displayImage</data>

</button>

If a user enclosed another file, then the data item referred to in the button’s dataoption would be replaced with the new data item. (The data item would use thesame item sid; the one that is referred to in the data option.)

Usage details1. Default: none

2. A data option specifies only zero or one data items.3. If an item with a type setting of enclose and a data option is used to enclose a

second data item, then the second data item will replace the first.4. If an enclosure mechanism is used to replace an image stored in a data item

with a new image (see above), then buttons and labels whose image option isset to the identifier of the image data item will be updated to display the newimage.

5. A data item referred to in a data option might also have a datagroup option andthus belong to the datagroups of other actions, buttons, or cells.

<data>data item</data>

XFDL Version 7.7 87

Page 94: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

datagroupProvides a way of associating related data items to each other and to certain otheritems.

There are two ways of using this option. In the first case, it enables you to create agroup of data items, called a datagroup. In the second case, this option enables youto reference such a datagroup from button, action, or cell items.

This option is most often used to group file enclosures. For example, you can usethis feature to create folders with which users can organize their enclosures. Eachenclosed file can belong to several datagroups, and each datagroup can containseveral enclosed files.

Syntax

Table 11. datagroup parameters

Parameter Type Description

datagroup reference string Identifies a data group. This candone in one of two formats:

v datagroup_name for datagroupson the same page.

v page_sid.datagroup_name fordatagroups on a different page.

Available in

action, button, cell, data

Example

If this sample were part of a data item definition, it would mean the data itembelonged to the datagroups Business_Letters, Personal_Letters, and Form_Letters.

If this sample were part of an action, button, or cell item, it would mean the usercould store the enclosure in one of the three datagroups.

<datagroup><datagroupref>Business_Letters</datagroupref><datagroupref>Personal_Letters</datagroupref><datagroupref>Form_Letters</datagroupref>

</datagroup>

In the following example, the Enclose button references the datagroupsBusiness_Letters and Personal_Letters. As a result, when users click this button,

<datagroup><datagroupref>datagroup reference1</datagroupref>...<datagroupref>datagroup referencen</datagroupref>

</datagroup>

Note: Include a datagroup reference entry for each datagroup this item accesses.

88 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 95: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

they can choose to place the file they are enclosing into one of these folders.Because the datagroup Form_Letters is not specified in the datagroup reference, itis not available to “BUTTON1”.

<button sid="BUTTON1"><value>Click to Enclose File</value><type>enclose</type><datagroup>

<datagroupref>Business_Letters</datagroupref><datagroupref>Personal_Letters</datagroupref>

</datagroup></button>

Usage details1. Default: none2. The grouping of data items into datagroups cannot span multiple pages. That is,

all the data items assigned to a given datagroup must belong to the same page.On the other hand, buttons, actions, and cells from one page can referencedatagroups from another page, provided that you specify the page sid in thedatagroup reference.

3. Used with items handling enclosures, datagroup lists the datagroups the itemcan access. Used with a data item, datagroup lists the datagroups to which theenclosure belongs. Enclosures are stored in data items.

4. Items that handle enclosed files perform enclose, extract, remove, and displayactions. These actions types are set using the type option.

5. When a user selects an item that handles enclosed files, the list of datagroupsappears. The user chooses the datagroup (or folder) with which to work. If theaction is enclosing, the enclosed file is added to that datagroup. Otherwise, alist of files in the datagroup appears. The user chooses a file from the list.

6. The action of enclosing a file creates the data item, and stores the user’s choiceof datagroup (or folder) in the data item’s datagroup option.

XFDL Version 7.7 89

Page 96: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

delayDelays the execution of an automatic action or specifies an automatic action repeatfactor.

Repeated actions stop when the page containing the action definition closes. Defineautomatic actions using an action item.

Syntax

Table 12. delay parameters

Parameter Type Description

repeatFactor repeat Queue the action to repeat at the<interval> specified.

once Perform the action once after the<interval> specified.

interval integer The frequency of repeated actionsor the delay before performingsingle occurrence actions. The unitof measurement is seconds.

-1 Perform the action before the pagedisplays. Only valid with a repeatfactor of once.

Available in

action

Example

This sample sets the action to occur once, 15 minutes (900 seconds) after the pageopens.

<delay><type>once</type><interval>900</interval>

</delay>

Usage details1. Defaults:v repeat factor:once

v interval: zero seconds2. This means the action will occur when the page appears.3. Repeating automatic actions is one method of creating a sparse-stated

connection. It allows the form to indicate periodically to a server applicationthat it is still running.

4. All actions with the same interval occur in the order they are defined in thepage.

<delay><type>repeatFactor</type><interval>interval</interval>

</delay>

90 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 97: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. The page does not display while actions with an interval of -1 are running.

XFDL Version 7.7 91

Page 98: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

displayDefines if an object is drawn on a form. If it is not, it takes up no space on theform.

The position of items on the form can be precisely controlled and are often affectedby the position of other items. Setting the visibility of an item can be done byeither setting the visible or display options.v If the property option visible is set off, the item is not visible in the Viewer but

still takes up room on the form. A blank space is left on the form where it waspositioned.

v If an items has the option display set to off , the item is not visible in theViewer and does not take up room on the form if another relative aligned itemis in the build order. As a result, the next relative aligned item in the build olderis positioned in it’s place and space is saved on the form.

This option is useful for creating collapsing sections in a form.

Syntax

Table 13. display parameters

Parameter Type Description

status string Toggle on or off the display ofitems on the screen and in print.Reposition items on the form. Thedefault value is on.

Available in

box, button, check, combobox, field, label, line, list, popup, radio, signature, slider,table, toolbar.

Example

The following example uses two fields and a label. All items are relatively alignedbelow each other. FIELD1 has its property option display set to off. As a result,FIELD2 is repositioned directly below LABEL2 in the position FIELD1 wouldnormally fill when viewed in the Viewer.<label sid="LABEL2">

<itemlocation><x>71</x><y>141</y>

</itemlocation><value>Relative Position - display off</value>

</label><field sid="FIELD1">

<itemlocation><below>LABEL2</below>

</itemlocation><scrollhoriz>wordwrap</scrollhoriz><value></value><visible>off</visible><display>off</display>

<display>status</display>

92 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 99: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</field><field sid="FIELD2">

<itemlocation><below>FIELD1</below>

</itemlocation><scrollhoriz>wordwrap</scrollhoriz><value></value>

</field>

Usage details1. The default value is on.2. Valid values are on and off.v The value on sets the item as visible. The bounding box is calculated in the

layout of the form.v The value off sets the item as invisible. The form layout is affected. The

item’s position may then be used by another item on the form.3. Form layout is affected on the screen and in print.

XFDL Version 7.7 93

Page 100: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

directionDefines the direction of plain and rich text in items. This is typically used whenworking with bidirectional languages, such as Arabic and Hebrew.

Syntax

Sets direction for text in Label option of Check and Radio items and text in valueoptions for other items. This affects both plain and rich text.

This affects only text. To affect other features of the item, such as border,itemlocation, and so on, use the orientation option.

Table 14. direction parameters

Parameter Type Description

status ltr Toggle ltr (Left-To-Right) tochange the direction of text.

rtl Toggle rtl (Right-To-Left) tochange the direction of text.

Available in

button, check, combobox, field, label, list, popup, radio.

Example

The following is an example of an Arabic form (xml:lang=″ar-SA″) using thedirection function to change the flow of text for the check label.<xfdl:XFDL xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom"xmlns:designer="http://www.ibm.com/xmlns/prod/workplace/forms/designer/2.6"

xml:lang="ar-QA"xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"></xfdl:XFDL>...

<field sid="FIELD1"><scrollhoriz>wordwrap</scrollhoriz><value></value><direction>ltr</direction><scrollvert>always</scrollvert><itemlocation>

<x>636</x><width>249</width><y>188</y><height>100</height>

</itemlocation><label>Label positionng is set by orientation</label>

</field>

Usage details1. Default: Per parent’s orientation. If not set, the direction is defaulted to ltr

(Left-To-Right).

<direction>status</direction>

94 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 101: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. If a bidirectional language is specified, and the orientation option is set, textstyle such as color, bold, and so on are ignored.

XFDL Version 7.7 95

Page 102: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dirtyflagRecords whether the form has been updated since the last save or submission. Ifthe user attempts to close the form when the dirtyflag is set to on, the user willfirst be prompted to save their changes.

The dirtyflag is set to on whenever the user makes a change to the form. Suchchanges include typing information into the form, selecting choices in lists or withradio buttons, and so on. The dirtyflag is set to off whenever the user saves orsubmits the form.

Note that the dirtyflag is not set by computed changes to the form. For example, ifthe user clicks a button that triggers a compute, and that compute copiesinformation to a field in the form, the dirtyflag would not be set. In these cases,the form should include additional computes that set the dirtyflag.

If necessary, the save prompt can be disabled by using a compute to set thedirtyflag to off.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 15. dirtyflag parameters

Parameter Type Description

status on indicates that the user haschanged the form since the lastsave or network submission

off indicates that the user has notchanged the form since the lastsave or network submission

Available In

form global

Example

This example shows how the dirtyflag can be set to off.<button sid="ApplicationSpecificSave">

<value>Save</value><type>cancel</type><custom:myoption xfdl:compute="toggle(activated, 'off', 'on') &#xA;

== '1' ? &#xA;MySaveFunction() + set('global.global.dirtyflag', &#xA;'off') : ""></custom:myoption>

</button>

<dirtyflag>status<dirtyflag>

96 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 103: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage Details1. Defaults: none

2. The dirtyflag option is not saved or transmitted with the form description.

XFDL Version 7.7 97

Page 104: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

enclosuresettingsSets limits on the size and type of files that users can attach to a form.

Syntax

Table 16. enclosuresettings parameters

Parameter Type Description

maxsize integer The maximum size in kilobytes ofany one attachment in a form. Thefile size of each attachment mustbe less than or equal to this value.If -1 or if not present, there is nolimit on maximum size.

totalsize integer The maximum size in kilobytes ofall attachments in a form. Thesum of the file sizes of allattachments in a form must beless than or equal to this value. If-1 or if not present, there is nolimit on maximum size.

mediatype string A whitespace-delimited list of filetypes that can be attached to aform. The list can be MIME types,file name extensions, or acombination. You can use * as awildcard in the MIME subtype.For example:

text/* application/pdf .png .gif .jpg .jpeg

The file extensions must beginwith the . character, and are notcase sensitive. That is, .jpgincludes .JPG and all othercombinations of case. If notpresent, all file types are allowed.

name string If set to true, all attachments in aform must have unique filenames. File name comparisons arecase sensitive. If false or if notpresent, duplicate file names areallowed.

Available in

button of type enclose, cell of type enclose, page global, form global

<enclosuresettings><maxsize>maxsize</maxsize><totalsize>totalsize<totalsize><mediatypes>mediatype<mediatypes><uniquenames>name<uniquenames>

</enclosuresettings>

98 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 105: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

The following example shows an enclosuresettings option that limits the size ofeach individual attachment to a maximum of 1 megabyte with an overall limit of10 megabytes. Any number of files can be attached as long as the sum of their filesizes is less than 10 megabytes. Also, only PDF and plain text files can be attached.

<button sid="enclose_button"><value>Enclose File</value><fontinfo>

<fontname>Helvetica</fontname><size>18</size><effect>bold</effect><effect>italic</effect>

</fontinfo><type>enclose</type><enclosuresettings>

<maxsize>1024</maxsize><totalsize>10240<totalsize><mediatypes>.pdf text/*<mediatypes>

</enclosuresettings></button>

Usage details1. Default: If the enclosuresettings option is not present, no limits are enforced.2. The uniquename setting affects only form global. It is ignored in the button

item, cell item, and page global.3. When enclosing a file in an xfdl:data element that is not part of a data group,

the xfdl:data element may already contain a file. In this case the file will bereplaced by the file currently being added, therefore, the name of the file beingreplaced will not be considered when checking for a distinct name.

4. When enclosing a file in an xfdl:data element that is part of a data group, thedata group may already contain an xfdl:data element with the same file name.In this case the matching file will be replaced by the file currently being added.As a result, the name of the file being replaced will not be considered whenchecking for a distinct name.

5. A file must pass all in-scope enclosuresettings constraints before it can beattached. For example, if a button enclosuresettings limits the file size to 1024kilobytes, and the form global enclosuresettings limits file size to 512 kilobytes,then the maximum size of any one file that can be attached to the form is 512kilobytes.

XFDL Version 7.7 99

Page 106: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

excludedmetadataAllows additional data about a signature to be included, but never signed. Thismakes it possible to store the notarization of signatures without interfering withother, overlapping signatures.

For example, if signer1 signs a form and then signer2 affixes an overlappingsignature, you could not modify the first signature without breaking the second. Inthis case, you would not be able to notarize the first signature, since affixing thenotarization would change the mimedata of that signature and break the secondsignature.

The excludedmetadata provides a place to store the notarization for the firstsignature without breaking the second signature. You can add information to thisoption at any time, since the excludedmetadata option is never signed.

Syntax

Table 17. excluded metadata parameters

Parameter Type Description

notarization string A compressed base64 encodedPKCS-7 signature that signs thehash of the mimedata option andthe details of the signature that isbeing notarized.

Available in

signature

Example

The following example shows an excludedmetadata option with two notarizingsignatures. Note that the base64 blocks would be much larger in practice.

<excludedmetadata><servernotarizations encoding="base64-gzip">

<notarization>asdfkj439fgasdf81hgb</notarization><notarization>opkbt1ed7f8y3476p294</notarization>

</servernotarizations></excludedmetadata>

Usage details1. Default: none

<excludedmetadata><servernotarizations>

<notarization>notarization1</notarization>...<notarization>notarizationn</notarization>

</servernotarizations></excludedmetadata>

100 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 107: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

filenameIdentifies the name of an enclosed file. This name appears in the list of enclosedfiles.

Syntax

Table 18. filename parameters

Parameter Type Description

name of file string the name of the enclosed file

Available In

data

Example

This sample specifies the name of an enclosed file:<filename>std_logo.xfd</filename>

Usage Details1. Default: none

2. To ensure cross-platform compatibility, limit filenames to the following set ofcharacters: lowercase letters from a to z, uppercase letters from A to Z, theintegers 0 through 9, and the underscore (_).

3. To ensure cross-platform compatibility, limit form names to a maximum ofeight characters, followed by a .xfd extension.

<filename>name of file</filename>

XFDL Version 7.7 101

Page 108: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

firstIdentifies the first item in a repeat, group, or switch. This is the item that firstreceives the focus when the user tabs into a group, a particular case in a switch, ora new row in a repeat.

This option affects the tab order in the following ways:v When the user tabs forward into a table or pane, the focus goes to this item first.

In the case of a table, the focus goes to this item in the first row.v When the user tabs forward from the end of a row, the focus goes to this item in

the next row (if there is one), or to the item stipulated by the table’s next option.v When the user tabs backward from this item, the focus goes to the preceding

row, or to the item that precedes the table or pane.

Syntax

Table 19. options first parameters

Parameter Type Description

item reference string An XFDL reference to the firstitem in a row of a table or the firstitem in a pane.

Available in

pane, table

Example

The following example shows a table in which the first option contains a referenceto the second item in the table row. In this case, when the user first tabs into thetable, the focus skips the first cell in the table and goes to the second cell (productpopup).

<table sid="itemsTable"><first>Product</first><last>Qty</last><xforms:repeat nodeset="order/row">

<field sid="Qty"><previous>Product</previous><xforms:input ref="qty">

<xforms:label></xforms:label></xforms:input>

</field><popup sid="Product">

<next>Qty</next><xforms:select1 appearance="minimal" ref="product">

<xforms:label>Choose product</xforms:label><xforms:item>

<xforms:label>Widget</xforms:label><xforms:value>widget</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Gadget</xforms:label><xforms:value>gadget</xforms:value>

</xforms:item>

<first>item reference</first>

102 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 109: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</xforms:select1></popup><label sid="LineTotal">

<xforms:output ref="lineTotal"/></label>

</xforms:repeat></table>

Usage details1. Default: if no first item is specified, the first item in the <xforms:repeat> or

<xforms:group> element, or the first item in the selected case of the<xforms:switch> element is used.

2. When a pane contains an xforms:switch, this option is not effective unless allcases contain an element with the same sid that is identified as first.

XFDL Version 7.7 103

Page 110: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

focusedSpecifies whether an item, page, or form currently has the input focus. This optionis usually set by code outside XFDL, but can also be set by a compute, providedthat the compute is setting the focus of an item to on, the item is on the samepage, and the item receiving the focus is capable of doing so.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 20. focused parameters

Parameter Type Description

status on item, page, or form has inputfocus.

off item, page, or form does not haveinput focus.

Available in

button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, slider,page global, form global

Example

The following example shows a button that changes its color to white if it has theinput focus, and to blue if it does not.

<button sid="saveButton"><type>saveas</type><value>Save</value><focused>off</focused><bgcolor compute="focused=='on' ? 'white' : 'blue'"><bgcolor>

</button>

The following example shows how the focus can be moved to a different itembased on user input.

<check sid="CHECK1"><value>off<value><label>Check here to skip next section</label><custom:myoption compute="toggle(value, 'off', 'on') == &#xA;

'1' ? set('FIELD14.focused','on'): ''"></custom:myoption></check>

Usage details1. Default: off

2. The focused option is set to on when an item, page, or form receives the inputfocus, and is set to off when the focus is moved to another item, page or form.

3. An object’s focused option does not change when the form applicationdisplaying it becomes active or inactive on a desktop. For example, a page that

<focused>status</focused>

104 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 111: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

is open on screen will have a focused option set to on, even if the page isminimized or is not the currently active application on the desktop.

4. In objects that are hierarchical, it is possible for more than one object to havethe focus at one time. For example, a form, a page, and a field can all befocused at the same time.

5. When a form viewing application is closing a form, it should set all focusedoptions to off and then resolve all formulas before shutting down.

6. The focused option is not included in form descriptions that are saved ortransmitted.

XFDL Version 7.7 105

Page 112: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

focuseditemSpecifies which item in the page currently has the focus.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 21. focuseditem parameters

Parameter Type Description

sid string The sid of the item that currentlyhas the focus.

Available in

page global

Example

The following example shows a label that uses a compute to set its value. Thecompute copies the name of the item that currently has the focus from thefocuseditem option. The label then displays this name.

<label sid="itemWithFocus"><value compute="PAGE1.global.focuseditem></value>

</label>

Usage details1. When the page changes, the focuseditem for the previous page is set to empty.

For example, if the user changed from “PAGE1” to “PAGE2”, the focuseditemoption for “PAGE1” would be set to an empty string.

2. The focuseditem option is maintained by the form viewing application, and isnot included in form descriptions that are saved or transmitted.

<focuseditem>sid</focuseditem>

106 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 113: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

fontcolorDefines the font color for the text or filler portion of an item.

In radio and check items, fontcolor defines the color of the bullet and check,respectively. In line items, fontcolor defines the color of the line. In other items, itdefines the text color.

Syntax

Table 22. fontcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

button, check, combobox, field, label, line, list, popup, radio, slider, page global,form global

Examples

These samples all set the font color to chocolate.<fontcolor>chocolate</fontcolor><fontcolor>210,105,30</fontcolor><fontcolor>#993300</fontcolor>

Usage details1. Defaults behave as follows:v If there is no fontcolor setting at the item level, the item will derive its

fontcolor setting from the page or form global level. If no fontcolor setting isspecified at the page or form level, the default is black.

v For check and radio items, the default is not inherited from the page or globallevel, and is always red.

<fontcolor>color</fontcolor>

XFDL Version 7.7 107

Page 114: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

fontinfoDefines the character set, font name, point size, and font characteristics for the textportion of an item. Note that the font selected for an item influences the item’ssize.

Syntax

Table 23. fontinfo parameters

Parameter Type Description

font name string The name of the font.

point size unsigned byte The size of the font.

effect string Can be any of the following:

v plain – Use plain face font.

v bold – Use bold face font.

v underline – Use underlinedfont.

v italic – Use italic font.

Available in

box, button, check, combobox, field, label, line, list, popup, radio, slider, spacer,page global, form global

Example

This sample sets the font information to Times 14, bold italic:<fontinfo>

<fontname>Times</fontname><size>14</size><effect>bold</effect><effect>italic</effect>

</fontinfo>

Usage details1. Defaults first to the page setting for fontinfo, then to the global setting for

foninfo. If neither setting exists, then the defaults are: Helvetica, 8, plain.2. If any of the fontinfo settings are invalid, then the defaults will be used.3. The size option calculates item size using the font’s average character width.

Therefore, choice of font affects item width.4. XFDL supports the following fonts and font sizes:v Fonts: Courier, Times, Symbol (symbol), Helvetica, and Palatino.

<fontinfo><fontname>font name</fontname><size>point size</size><effect>effect1</effect>...<effect>effectn</effect>

</fontinfo>

Note: fontname and size must appear first, and in the order shown.

108 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 115: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v Sizes: 8, 9, 10, 11, 12, 14, 16, 18, 24, 36, 48.5. Other fonts and font sizes may be used. However, especially for cross-platform

Internet applications, it is best to choose from the ones cited above since theyare guaranteed to work.

XFDL Version 7.7 109

Page 116: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

formatAllows you to apply formatting to the contents of an item, or to create edit checksfor that item. It also allows you to set button items to be mandatory.

Syntax

Table 24. format parameters

Parameter Type Description

data types currency, date, time, etc., The type of data the item cancontain.

presentation settings calendar, decimalseparator,pattern, etc.,

The formatting to apply to thedata in this item.

constraint settings casesensitive, mandatory,range, etc.,

The constraints to apply to userinput.

Available in

button, checkgroup, combobox, field, label, list, popup, radiogroup, slider

<format><datatype>data type</datatype><presentation>presentation settings</presentation><constraints>constraint settings</constraints>

</format>

Note: Datatype is mandatory and must appear first; the other settings are optional.

110 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 117: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Data typesYou can only declare one data type for each item. If you do not set the data type,XFDL will default to string.

Table 25. XFDL supports the following data types

Data Type Description Format Defaults To:

currency a fixed point decimalnumber with a scale of 2and a range equal to therange of a float

Any number. Automatically adds .00to end, if no decimal value specified.

date a date includingday-of-month, month, andyear

3 Mar 2005

day_of_month the number of a day of themonth

12

day_of_week the name or number of aday of the week

Thu

date_time The date, including year,month, day, and the time,including at least hours andminutesNote: If a date_timeformatted field references avalue in the instance, whenthe value is populated it isnormalized to UTC. Whenthe form is subsequentlyopened, the field willdisplay a date and time thatis localized to the time zonethat the form was opened in.

5 Oct 2005 6:45:21 PM

float a positive or negativefloating point decimalnumber in the range of 1.7 *10-308 to 1.7 * 10308

Any decimal number.

integer a positive or negative wholenumber in the range of-2,147,483,648 to+2,147,483,647

Any whole number.

month the name or number of amonth

Mar

string free form character data upto 32K long

Any group of characters.

time a time value containinghours and minutes from the12 hour or the 24 hour clock

11:23:21 PM

void disable entire format option(including data type,presentation, andconstraints)

no effect on contents of the item

year a numeric year designation 2005

XFDL Version 7.7 111

Page 118: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Presentation settingsPresentation settings control the output of the text. For example, you can specifythat the text should include a currency symbol or that it should round all numbersup. There is no limit to the number of presentation settings that you can set for anitem.

Presentation settings follow this syntax:

The following list defines the valid settings:

calendarThis sets which calendar is used for formatting dates. It supports thefollowing settings:v gregorian – A solar calendar. The primary calendar for North America.v japanese – A Japanese era calendar (based on the reign of the current

emperor). Used in Japan, along with Gregorian calendar. The calendaridentifies the year by the combination of the emperor name and the yearnumber within the era (For example 2008 is Heisei 20). For moreinformation see style below).

Using this setting forces the calendar to be type selected, regardless of thelocale of the form. This setting is only valid for date types, such as date,time, and so on.

Default for en_US locale: gregorian.

Default for other locales:gregorian.

casetypeForces the value to be set to a particular case. Valid settings are:v upper – Sets all letters to upper case.v lower – Sets all letters to lower case.v title – Capitalizes the first letter of each word.v none – Leaves the capitalization unchanged.

This setting is only valid for string and date (date, time, and so on) datatypes.

Default: none.

currencylocaleAllows you to set a different locale for a particular currency field. Forexample, you could set one field to use US dollars and another field to useBritish pounds.

Valid settings include all valid locales. For a complete list of locales andtheir corresponding codes, see Locale Specification for XFDL.

Note that this setting does not convert currencies in any way.

Default: the locale of the form.

<format><presentation>

<settingname1>setting</settingname1>...<settingnamen>setting</settingnamen>

</presentation></format>

112 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 119: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

decimalseparatorThe symbol(s) used to separate the decimal place. This is often a period, asshown:

100.00

You can use any string. This setting is only valid for int, float, andcurrency data types.

Default for en_US locale: a period.

Default for other locales: refer to the Locale Specification for XFDL.

fractiondigitsSets the number of digits shown after the decimal place. For example, asetting of 3 would allow three digits after the decimal place, as shown:

13.764

All values are rounded according to the round setting. If no round settingis specified, all values are rounded up. (See the round setting for anexplanation of rounding up.)

Fractiondigits is only valid for float and currency data types. Note thatsetting both fractiondigits and significantdigits may cause conflictingformats. In this case, significantdigits takes precedence.

Default: the maximum number of digits allowed for the data type.

groupingseparatorThe symbol(s) used to separate groups of numbers (for example, thousandsin North America). This is often a comma, as shown:

1,000,000

You can use any string, with the keyword none representing no separatorsat all. However, you should not use strings that already have a meaning,such as the period.

This setting is only valid for int, float, and currency data types.

Default for en_US locale: a comma.

Default for other locales: refer to the Locale Specification for XFDL.

keepformatindataSets whether formatting, such as dollar signs and other “decoration”, ismaintained when the value is copied to the XForms model. Valid valuesare:v on – maintain all formatting.v off – strip all formatting.

Default: off.

negativeindicatorSets the symbols that are used to indicate a negative value. You can placesymbols both before and after the number by setting a prefix and a suffix.To do this, you must include the <prefix> and <suffix> tags in yourdefinition, as shown:

<negativeindicator><prefix>prefix</prefix><suffix>suffix</suffix>

</negativeindicator>

XFDL Version 7.7 113

Page 120: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The prefix and suffix are defined as strings. For example, if you set theprefix to an open bracket and the suffix to a close bracket, you will get abracket negative. The following shows the bracket notation for negative100:

(100)

You can also leave either the prefix or suffix blank, so long as the othersetting has a value.

Note:

v The pattern setting overrides the negativeindicator setting.v Do not use this setting with currency data types.v Do not use symbols that already have meanings, such as the period.

Default for en_US locale: minus sign (-).

Default for other locales: refer to the Locale Specification for XFDL.

pad Sets the number of digits to show, regardless of the value. For example,setting a pad of 5 would result in all numbers having five digits, as shown:

0000200100

If the value has more characters than dictated by the pad setting, the valueis not changed and is displayed as entered.

Pad is only valid for integer, float, and currency data types. Use thepadcharacter setting to control which character is used to pad the value.

Default : 0 (no padding imposed).

padcharacterSets the character to use for padding. For example, if you set thepadcharacter to a zero and the pad setting was 5, numbers would bedisplayed as follows:

0001001245

You may only specify a single character as the pad character. Furthermore,you must use a pad character that is valid for your data type. For example,you cannot use a Z in an integer value.

Padcharacter is only valid for integer, float, and currency data types. Usethe pad setting to control how many pad characters are used.

Default for en_US locale: 0.

Default for other locales: refer to the Locale Specification for XFDL.

patternAllows you to set a pattern for number and date data types. This pattern isused to display the data. For example, you might want all numbers to beformatted with two digits after the decimal place.

To learn how to represent number and date patterns, refer to “Datepatterns” on page 123.

Note that the pattern setting overrides both the style andnegativeindicator settings.

patternrefsAllows you to set one or more patterns for string data types that are used

114 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 121: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

to display the data. For example, you may want to ensure that all phonenumbers are displayed with dashes, as shown: 250-604-8734.

You must define each pattern in its own <patternref> tag, as shown:<patternrefs>

<patternref1>pattern</patternref1>...<patternrefn>pattern</patternrefn>

</patternrefs>

If you define only one pattern, that pattern is used for all input regardlessof the number of constraints you define.

If you define more than one patternref, you must define an equal numberof patterns in the constraints. Each pattern is then matched to thecorresponding constraint. For example, the first pattern is matched to thefirst constraint, the second pattern is matched to the second constraint, andso on. This allows you to define a different pattern for each constraint.

To learn how to represent string patterns, refer to “String patterns” onpage 127.

Note that the patternrefs setting overrides the style setting.

Default: as dictated by the style setting.

round Determines how values are rounded. Valid settings are:v floor – Always rounds down, towards negative infinity. For example,

$45.687 becomes $45.68. -$45.687 becomes -$45.69v ceiling – Always rounds up, towards positive infinity. For example,

$45.687 becomes $45.69. -$45.687 becomes -$45.68.v up – Rounds away from zero. For example, $45.687 becomes $45.69 and

-$45.687 becomes -$45.69.v down – Rounds towards zero. For example, $45.687 becomes $45.68 and

-$45.687 becomes -$45.68.v half_up – Rounds values greater than 5 up, and values less than 5

down. For values equal to 5, it rounds up. For example, 46.5 becomes 47,while 46.4 becomes 46; -46.5 becomes -47 and -46.4 becomes -46.

v half_down – Rounds values greater than 5 up, and values less than 5down. For values equal to 5, it rounds down. For example, 46.5 becomes46, while 46.6 becomes 47; -46.5 becomes -46, while -46.6 becomes -47.

v half_even – Rounds values greater than 5 up, and values less than 5down. For values equal to 5, rounds up if the preceding digit is even,and down if the preceding digit is odd. For example, 46.5 becomes 47,while 45.5 becomes 45; -46.5 becomes -47, while -45.5 becomes -45.

Round is only valid for integer, float, and currency data types.

Note that if the significantdigits setting is used, then the round setting isreset to half_even.

Default: half_even.

showcurrencySets whether the appropriate currency symbol is shown. This is only validfor a currency data type. Valid settings are on, which shows the symbol,and off, which does not.

XFDL Version 7.7 115

Page 122: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The symbol used is determined by the currencylocale setting. If there is nocurrencylocale setting, it defaults to normal currency symbol for thecurrent locale.

Default: on.

significantdigitsSets the number of significant digits allowed. This is generally the totalnumber of digits allowed in the number. For example, 134.56 has fivesignificant digits.

If the data entered exceeds the number of significant digits allowed, thenonly the least significant digits are shown. For example, if you allow fivesignificant digits and 12,345.56 is entered, then only 12,345 is shown. If youallow five significant digits and 1,234,543.21 is entered, then only 1,234,500is shown.

significantdigits is only valid for integer, float, and currency data types.

Note that setting both fractiondigits and significantdigits may causeconflicting formats. In this case, significantdigits takes precedence.

Default: the maximum number of digits allowed for the data type.

style Sets how various data types are displayed. For example, you can use thestyle to set whether times include seconds, and whether dates are spelledout or numeric.

Valid settings are:v numeric

v short

v medium

v long

v full

For more information about how the styles affect the different data types,see “Data type styles” on page 117.

Note that both the pattern and patternrefs settings override the stylesetting.

Default: medium.

116 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 123: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Data type styles:

Data type styles affect how various data types are displayed in the form. Differentlocales may have different styles for displaying information related to dates andtime, such as dates, days of month, days of week, and years.

The following table shows how the style affects the presentation of various datatypes in the en_US locale. For other locales, refer to the locale in the LocaleSpecification for XFDL. The symbols used to define each format are explained in“Date patterns” on page 123.

Table 26. data types and their styles as shown in the US-English locale.

Data Type Style Format Example

date numeric yyyyMMdd 20041123

short yyyy-MM-dd 2004-11-23

medium d MMM yyyy 23 Nov 2004

long MMMM d, yyyy November 23, 2004

full EEEE, MMMM d, yyyy Tuesday, November 23,2004

day_of_month numeric d 3

short d 3

medium d 3

long d 3

full d 3

day_of_week numeric e 3

short e 3

medium EEE Wed

long EEEE Wednesday

full EEEE Wednesday

date_time numeric yyyyMMdd H:mm 20041123 08:15

short yyyy-MM-dd H:mm 2004-11-23 08:15

medium d MMM yyyy h:mm a 23 Nov 2004 8:15 AM

long MMMM d, yyyy h:mm a November 23, 2004 8:15 AM

full EEEE, MMMM d, yyyyh:mm:ss a z

Tuesday, November 23,2004 8:15:23 AM PST

month numeric M 9

short M 9

medium MMM Sep

long MMMM September

full MMMM September

time numeric H.mm 17.30

short H:mm 17:30

medium h:mm a 5:30 PM

long h:mm a 5:30 PM

XFDL Version 7.7 117

Page 124: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 26. data types and their styles as shown in the US-English locale. (continued)

Data Type Style Format Example

full h:mm:ss a z 5:30:14 PM PST

year numeric yyyy 2004

short yy 04

medium yyyy 2004

long yyyy 2004

full yyyy G 2004 AD

118 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 125: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Constraint settingsConstraint settings control the text that the user is allowed to input. For example,you can limit input to a range of numbers, to a particular length, or to a specificpattern, such as the common ###-####.

Constraint settings follow this syntax:

The following list defines that valid settings:

applyifinvisibleSets whether invisible or inactive items are included in the formatvalidation check.v on – Items that are not displayed, visible, or active are included in

format validation check.v off – Items that are not displayed, visible, or active are NOT included in

format validation check.

casesensitiveSets whether the data entered must match the case of the defined patternconstraints. Valid settings are:v on – The data entered must match the case of the defined templates.v off – The data entered does not need to match the case of any defined

templates.

Default: off.

checksAllows you to force the format check to fail, or to ignore all constraintssettings. Valid settings are:v fail – Forces the format check to fail.v ignore – Ignores all constraint settings. Note that the data type and the

presentation settings are still respected.v none – Has no effect.

Default: none.

decimalseparatorsDefines one or more symbols that are allowed to indicate the decimalplace. This is often a period, as shown:

100.00

List each separator in its own separator tag, as shown:<decimalseparators>

<decimalseparator1>separator</decimalseparator1>

<format><constraints>

<settingname1>setting</settingname1>...<settingnamen>setting</settingnamen>

</constraints></format>

Note: You can define any number of settings.

XFDL Version 7.7 119

Page 126: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

...<decimalseparatorn

>separator</decimalseparatorn></decimalseparators>

You can use any string, such as a comma or a comma followed by a space.This setting is only valid for integer, float, and currency data types.

Note:

v The user must use the same separator in a given string. For example, ifyou define both comma and space as valid separators, the user musttype either 1,000,000 or 1 000 000. Mixing the separators, as in 1,000 000,is not allowed.

v If this setting is empty, it inherits the decimalseparator defined in thepresentation settings.

Default: a comma.

groupingseparatorsDefines one or more symbols that are allowed to separate groups ofnumbers (such as thousands in North America) during input. This is oftena comma, as shown:

1,000,000

List each separator in its own separator tag, as shown:<groupingseparators>

<groupingseparator1>separator</groupingseparator1>

...<groupingseparatorn

>separator</groupingseparatorn></groupingseparators>

You can use any string, such as a comma or a comma followed by a space,with the keyword none representing no separator at all. This setting is onlyvalid for integer, float, and currency data types.

Usage details

v The user must use the same separator in a given string. For example, ifyou define both comma and space as valid separators, the user musttype either 1,000,000 or 1 000 000. Mixing the separators, as in 1,000 000,is not allowed.

v If this setting is left empty, it inherits the groupingseparator defined inthe presentation settings.

Default: a comma.

length Sets a range of lengths that the data entered must fall within. To do this,you must include the <min> and <max> tags in your definition, as shown:

<length><min>shortest length allowed</min><max>longest length allowed</max>

</length>

For example, if you wanted all values to be between 4 and 7 characters inlength, you would set the min to 4 and the max to 7. This allows the userto enter a value that is either 4 characters or 7 characters in length, as wellas all lengths in between.

120 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 127: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The length is calculated after all formatting has been applied, and willinclude all formatting characters such as the negative sign, currencysymbols, and so on.

If you add a length setting to a field, the field is treated as mandatory.

Default: the maximum range of lengths allowed for the data type.

mandatorySets whether the user must enter a value. Valid settings are:v on – The user must enter a value.v off – The user need not enter a value.

This value works in conjunction with the required property for the linkedelement in the XForms model. If either setting indicates that input ismandatory, then it is mandatory.

Default: the required property of the linked XForms data element, or off.

messageSets the message that is displayed when the input is invalid. This can beany text.

Default: none.

patternsAllows you to set one or more patterns for strings, date, or numbers thatare valid as input. For example, you might want to constrain dates to thefollowing format: YYYY-MM-DD.

You must define each pattern in its own <pattern> tag, as shown:<patterns>

<pattern1>pattern</pattern1>...<patternn>pattern</patternn>

</patterns>

If you define more than one patternref in the presentation settings, youmust define an equal number of patterns in the constraints. Eachpatternref is then matched to the corresponding constraint pattern. Forexample, the first patternref is matched to the first constraint pattern, thesecond patternref is matched to the second constraint pattern, and so on.This allows you to define a different pattern for each constraint.

Note that unlike the template setting, the pattern setting will not showusers any of the text you include in your patterns, since there is no way totell which pattern the user will follow.

range Sets a numerical range that the data entered must fall within. To do this,you must include the <low> and <high> tags in your definition, as shown:

<range><min>smallest number allowed</min><max>highest number allowed</max>

</range>

The low and high values are inclusive. For example, if you wanted tocreate a range from 1 to 100, you would set the low value to 1 and thehigh value to 100. This allows the user to enter either 1 or 100, as well asall values in between.

If you set a range for a string, the data is evaluated on a character bycharacter basis. For example, you might set your low value to “fg” and

XFDL Version 7.7 121

Page 128: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

your high value to “jk”. In this case, the first character entered would haveto be in the f-j range, and the second character would have to be in the g-krange. This check ignores case.

If you add a range setting to a field, the field is treated as mandatory.

Default: the maximum range allowed for the data type.

templateAllows you to display symbols in the input area before the user enterstheir data. This is useful if you want to show formatting placeholders, suchas parentheses for the area code in a phone number.

To create a template, use a period to represent any 1 character that the usertypes in. All other characters are shown to the user as typed.

For example, if you create the following template:(...)...-....

The user will see the following:( ) -

Setting a template in no way limits the user input. If you want to limit theuser input, you must also use the patterns setting. Futhermore, you canonly set one template.

yearwindowSets how to interpret two digit dates. This provides two options forinterpreting dates:v Fixed Date – You can specify a specific year, such as 70. All numbers

from that year and up are assumed to be in the 20th century (forexample, 1975). All numbers before that are assumed to be in the 21stcentury (for example, 2004).To set a fixed date, you must include the <fixedyear> tag as shown:

<yearwindow><fixedyear>the year</fixedyear>

</yearwindow>

v Sliding Date – You can specify a range rather than a fixed date. Thismeans that the date on which the decision is based changes as timepasses. The date is calculated by taking the current date and subtractinga number you specify. For example, if you set your range to 30 yearsand it is 2004, your decision date would be 2004 - 30 = 1974. In this case,all numbers from 74 and up would be in the 20th century, and allnumbers below 74 would be in the 21st century.To set a sliding date, you must include the <factor> tag as shown:

<yearwindow><factor>range</factor>

</yearwindow>

You can set either a fixed date or a sliding date, but not both. If you do setboth, the sliding date will override the fixed date.

Default: a sliding date with a factor of 30.

122 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 129: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Date patterns:

The following symbols are used to create date patterns:

Table 27. format date pattern

Symbol Description Example

G The era, expressed as AD orBC.

AD

y The year. 1997

Y The year. 1997

u The extended year. 4601

M The month. 11

d The day of the month. 23

h The hour for a twelve-hourclock (1-12).

11

H The hour for a twenty-fourhour clock (0-23).

23

m The minute of the hour (1-59) 34

s The second of the minute(1-59).

12

S The fractional second,expressed as a decimal value.

234

E The day of the week, as text. Tuesday

e The day of the week, as anumber (1-7).

2

D The day of the year (1-366). 234

F The occurrence of thatweekday in the month (1-5).For example, the secondWednesday in the month.

2

w The week in the year (1-52). 27

W The week in the month (1-5). 3

a The meridiem, expressed asAM or PM.

AM

k The hour in the day (1-24). 23

K The hour in the day (0-11) 3

g The Julian day. 2451334

A The millisecond in the day. 69540000

' Use to enclose text you wantto display.

’Date=’

'' Use to write a single quoteas part of text.

’o’clock’

When creating date patterns, you can repeat the placeholder to determine whichformat to use. For example, a single e represents the day of the week as a single

XFDL Version 7.7 123

Page 130: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

digit, such as 3. Two e’s (ee) represents the day of the week as two digits, such as03. Three E’s (EEE) represents the day of the week as short text, such as Wed. Andfinally, four E’s (EEEE) represents the day of the week as full text, such asWednesday.

124 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 131: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Number patterns:

The following symbols are used to create number patterns:

Table 28. number patterns

Symbol Description Example

0 Use to specify a digit that must appear. Forexample, 0.00 would require input with a singledigit before the decimal place, and two digitsafter. Similarly, #0.00 would allow one or moredigits before the decimal place, and two digitsafter.

#0.00

@ Use to specify the number of significant digitsto show. significant digits are the largest valuedigits in the number. For example, in thenumber 12345, the 1 is the most significant, the2 is the second most, and so on. Typing thatnumber into a template of @@@ would producethe number 12300.

A significant digit is always shown, even if itsvalue is zero. Furthermore, you cannot use thissymbol with a decimal value.

@@@

# Represents zero or more digits. For example, #.#would accept any of the following values: 1,1.1, 0.1, or 123.34.

#.#

. Decimal separator. #.#

1-9 Each number represents a digit that mustappear, and is used to set the increment forrounding. This means that #5 would round thenumber to the nearest five. Similarly, #29 wouldround the number to the nearest multiple of 29.

For example, if you set a pattern of #35 and theuser typed 138, the number would be roundedto 140 (the nearest multiple of 35).

#5

- A negative indicator. Note that this is aplaceholder for the characters defined in thenegativeindicator setting. For example, if youdefined your negative indicator as parentheses,then -#.# would result a value like: (123.45).

-#.#

, A separator indicator, representing the characterused to separate increments of one thousand innumbers. Note that this is a placeholder for thecharacters defined in the separator setting. Forexample, if you declared your separator as acomma followed by a space, then 0,000 wouldresult in a value like: 4, 000.

0,000

\u00A4 A currency indicator. Note that this is aplaceholder for the indicator defined in thecurrencylocale setting. For example, if youdeclared your currencylocale to be the US, andyour template was \u00A4#0.00, you would geta value like: $534.23.

If this symbol appears twice, it is replaced bythe international currency symbol.

\u00A4#0.0

XFDL Version 7.7 125

Page 132: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 28. number patterns (continued)

Symbol Description Example

E Separates the mantissa from the exponent inscientific notation. For example, 0.#E# wouldresult in a value like: 1.23E4

Note that when using # in scientific notation,this represents the number of digits that willalways appear after the decimal. So 0.# willresult in one digit after the decimal, while 0.###will result in three digits.

0.#E#

+ Use this to prefix positive exponents with theplus sign. For example, 0.#E+# would result ina value like: 1.34E+4.

0.#E+#

; Separates the positive and negative versions ofa pattern. For example, if you wanted a patternof #.# or -#.#, you would declare: #.#;-#.#

#.#;-#.#

% Multiply the data by 100 and show as apercentage. For example, if you set a templateof #% and entered a value of 0.12, you woudget: 12%.

#%

\u2030 Multiply the data by 1000 and show as permille. For example, if you set a template of#.#\u2030 and entered a value of .123, youwould get: 123 per mille.

#.#/u2030

* Precedes a pad character, which you can use toinsert specific symbols. For example, *0##.##would result in a value like: 012.23.

*0##.##

126 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 133: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

String patterns:

All string patterns are written with UNIX-style regular expressions.

Regular expressions are well-defined through a variety of public sources – such aswww.regular-expressions.info – and as such are not discussed in detail.

Note: The reference to www.regular-expressions.info is provided for yourconvenience only, and IBM makes no representations or warranties, expressed orimplied, regarding any information or materials posted on such Web site.

When using regular expressions, be aware that the patternrefs you set for thepresentation are intended to match corresponding patterns in your constraints. Thismeans that you can define groups in your constraints, and then refer to thosegroups from the presentation setting using the standard $# notation.

XFDL Version 7.7 127

Page 134: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Examples

This example specifies a field containing integer data with a range of values from10 to 1,000 inclusive, and formatted with commas separating the thousands:

<format><datatype>integer</datatype><presentation>

<groupingseparator>,<groupingseparator></presentation><constraints>

<range><min>10</min><max>1000</max>

</range></constraints>

</format>

This example specifies a field that contains currency data that is mandatory. Anerror message appears if the data is not entered correctly.

<format><datatype>currency</datatype><constraints>

<mandatory>on</mandatory><message>Entry incorrect -- try again.</message>

</constraints></format>

This example specifies a field in which date data will be formatted as month,day-of-month, and year (for example, November 23, 2004):

<format><datatype>date</datatype><presentation>

<style>long</style></presentation>

</format>

This example sets up a template and patterns for both presentation and constraints.The template sets up a format of (###) ###-#### for a telephone number. Thismeans that when the field is first displayed, it will show the parentheses and thedash to the user. The constraint pattern uses a regular expression to create thesame pattern, thereby limiting the input to match the template. Finally, thepresentation patternref uses a regular expression to define how the input should beformatted when displayed on the screen. This expression refers to the groupsdefined in the constraint pattern.

<format><datatype>string</datatype><constraints>

<template>(...) ...-....</template><patterns>

<pattern>\((\d{3})\)\s(\d{3})-(\d{4})</pattern></patterns>

</constraints><presentation>

<patternrefs><patternref>($1) $2-$3</patternref>

</patternrefs></presentation>

</format>

128 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 135: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. Default datatype: string.2. Default presentation:v calendar — gregorian (en_US locale)v casetype — none

v currencylocale — the locale of the formv decimalseparator — period (.) (en_US locale)v fractiondigits — maximum number of digits allowed by data typev negativeindicator — minus sign (-) (en_US locale)v pad — 0

v padcharacter — 0 (en_US locale)v pattern — n/av round — up

v groupingseparator — comma (,) (en_US locale). To remove the groupingseparator, use none.

v showcurrency — on

v significantdigits — the maximum number of digits allowed for the datatype

v style — medium

Note: The default values for other locales are listed in the locale in the LocaleSpecification for XFDL.

3. Default constraints:v casesensitive — off

v checks — none

v decimalseparator — period (.) (en_US locale)v length — maximum range of lengths allowed for the data typev mandatory — the required property of the linked XForms data element, or

off

v message — the <xforms:alert> setting for the item, if present.v patterns — n/av range — the maximum range allowed by the data typev groupingseparators — comma (,)v template — n/av yearwindow — a sliding date with a factor of 30

4. In some cases, it’s possible to create formatting that will have unpredictableresults. For example, if you specify that the grouping separator should be aperiod, this may cause problems since the decimal separator is also a period.Use good judgement when defining your formats.

5. All constraints are applied to the input data. This may create an item the usercannot complete. For example, the combination of data type date andconstraint pattern of #.# creates such a situation. A date type cannot beformatted as a decimal number.

6. You should use caution if you are designing forms that use two digit dates.While the yearwindow setting provides a mechanism for interpreting two digitdates, the best solution is to use four digit dates.

7. When applying a format to a combobox, list, or popup, the formatting will beapplied to the value of each cell linked to the item. Those cells that do not

XFDL Version 7.7 129

Page 136: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pass the check will be flagged or filtered. If a cell passes the checks, its valuewill be replaced with a formatted value before the item is displayed. The labeloption for these cells will remain unaffected.

8. When applying a format to a combobox, list, or popup item, a cell with anempty value will fail all format checks but will still be selectable, even if inputis mandatory. This allows users to erase their previous choice (which will alsoreset all formulas based on that choice). However, users will still need toselect a valid cell before they can submit the form.

9. If any two comboboxes, lists, or popups use the same set of cells, they mustapply the same formatting.

10. The void data type disables a format line completely through the use of acompute. Void formats never fail regardless of the checks in the formatstatement.

11. For details on using the format option in buttons, see the Usage Details in thebutton item description.

12. The message constraint overrides the <xforms:alert> setting for the item. .13. An item is mandatory if either the mandatory constraint is set to true or the

required property for a bound data element is set to true.14. If an element in the XForms data model is both empty and invalid, then any

item on the form that is bound to that element is set to be mandatory.

130 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 137: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

formidDefines a unique identifier for the form.

Syntax

Table 29. form id parameters

Parameter Type Description

form title string Provides a title for the form.

serialnumber string Provides a unique identifyingstring for the form. This isgenerated by an external programsuch as a form design program.

version number number in the formatAA.Bb.cc

Shows the major (AA), minor (Bb)and maintenance (cc) numbers forthe form. This is generated by anexternal program such as a formdesign program, but can also beset manually.

Available in

form global

Example

This sample shows how the formid option appears in the global characteristics of aform.

<formid><title>Admin_Form</title><serialnumber>{94EC8BA0-7D33-11D2-B5E3-0060}</serialnumber><version>4.8.2</version>

</formid>

Usage details1. Defaults:v title: none

v serialnumber: none

v version : 1.0.0

2. This option is intended for use with form design programs and licensingmodels.

<formid><title>form title</title><serialnumber>serial number</serialnumber><version>version number</version>

</formid>

Note:

v serialnumber and version are mandatory; title is optional

XFDL Version 7.7 131

Page 138: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

fullnameUsed in a signature item to record the fully qualified name of the signer. Thisname is retrieved from the digital certificate used to the sign the form.

Syntax

Table 30. fullname parameters

Parameter Type Description

name string The fully qualified name of thesigner, as supplied by the digitalcertificate used to sign the form.

Available in

signature

Example

This sample shows a fullname option as part of a signature item:<signature sid="empsignature">

<signer>Jane D Smith, [email protected]</signer><fullname>

"Verisign, Inc.", Verisign Trust Network,"www.verisign.com/repository/RPA Incorp. byRef.,LIAB.LTD(c)98", Persona Not Validated,Digital ID Class 1 - Microsoft, Jane D Smith,[email protected]

</fullname></signature>

Usage details1. This option is added to the form during the signing process, and is created by

the software that enables signing (such as a form viewer).

<fullname>name</fullname>

132 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 139: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

group

Provides a way of associating related items. There are two ways of using thisoption. In the first case, it enables you to create groups of cells or radio buttons. Inthe second case, the group option enables you to populate lists, popups, andcomboboxes by referencing a group of cells. Items with the same group referenceare considered members of the same group.

Syntax

Table 31. group parameters

Parameter Type Description

group reference string identifies the group. Can be oneof:

v group_name for groups on thecurrent page

v page_sid.group_name forgroups on other pages

Available In

cell, combobox, display, list, popup, radio

Example

In the following sample, the group option creates a group called “LIST1_GROUP”containing the cell items “CELL1” and “CELL2”.

<cell sid="CELL1"><group>LIST1_GROUP</group><value>red</value><type>select</type>

</cell><cell sid="CELL2">

<group>LIST1_GROUP</group><value>green</value><type>select</type>

</cell>

In the following code, the group option is used to populate the list item with thecells from the preceding sample.

<list sid="LIST1"><group>LIST1_GROUP</group><label>Colors</label><value></value>

</list>

Usage Details1. Default: none

2. The association of cells or radio buttons into groups cannot span multiplepages. That is, all the cells or radio buttons assigned to a given group mustbelong to the same page. On the other hand, you are allowed to populate a list,

<group>group reference</group>

XFDL Version 7.7 133

Page 140: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

popup, or combobox with a group of cells defined on another page, as long asyou specify the page sid in the group reference.

3. List and popup items are populated with cells that have the same groupreference as the item. It is possible to have multiple list and popup items withthe same group reference. In this way, the same group of cells can populatemore than one list or popup.

4. All radio items having the same group reference will form a mutually exclusivegroup.

134 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 141: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

helpPoints to the help message for the item.

The item reference identifies the help item containing the help message. There canbe many items pointing to the same help message.

Syntax

Table 32. help parameters

Parameter Type Description

item reference string A reference to the help item thatcontains the help message.

Available in

button, check, checkgroup, combobox, field, label, list, popup, radio, radiogroup,slider

Example

This sample points to the help item general_help defined on the page calledpage_1.

<help>page_1.general_help</help>

Usage details1. Defaultv XFDL: none

v XForms: if no help item is referenced, then the concatenated value of the<xforms:hint> and <xforms:help> settings are used to create a help messagethat is shown for the item. For more information about these settings, refer to“Metadata sub-options” on page 303.

2. The help option overrides the <xforms:hint> and <xforms:help> settings for theitem.

<help>item reference</help>

XFDL Version 7.7 135

Page 142: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

imageAssociates an image with an item. The item reference identifies the data itemcontaining the image. This image replaces any text label if the viewer is able todisplay images.

Syntax

Table 33. image parameters

Parameter Type Description

item reference string identifies the data item

Available In

button, label

Example

This sample points to the data item company_logo defined on the page calledpage_lst.

<image>page_1st.company_logo</image>

Usage Details1. Default: none

2. Use this option to associate images with button and label items.3. If an enclosure mechanism is used to replace an image stored in a data item

with a new image, then buttons and labels whose image option is set to theidentifier of the image data item will be updated to display the new image. Fordetails, see the data option description.

4. Use the imagemode option to control the display behavior of the image.5. Before using images on your forms, you should consider the type, quantity,

and size of the images you include on your forms. Images can make a formlarger and therefore slower to transmit, as well as have increased storagerequirements. To help keep your images small, most graphics editingapplications provide you with the ability to reduce file size by reducing thenumber of colors, reducing the resolution, altering the compression, orchanging to either black and white or gray scale.XFDL supports the following image formats:v Bitmap (.bmp)v Joint Photographic Experts Group (.jpeg)v Portable Network Graphics (.png)v Graphics Interchange Format (.gif)

Note:

v Transparency or animation are not supported.v GIF graphic formats support only the 89 format. This does not include the

89a format.v Interlaced GIFs are supported.

<image>item reference</image>

136 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 143: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v PNG graphic formats using Alpha Channel data are not supported.v Progressive JPEG is not supported.

XFDL Version 7.7 137

Page 144: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

imagemodeDefines how the image will be displayed in the item.

Syntax

Table 34. imagemode parameters

Parameter Type Description

image mode clip If the image is smaller than theitem, the image is centered in theitem. Otherwise, the image isplaced in the item from the topleft corner and the parts of theimage that extend past the item’sbounding box are cut off.

resize Image is placed in the item fromthe top left corner. The image isthen expanded or contracted inboth directions so that it fits theitem exactly.

scale If the image is smaller than theitem, the image is centered in theitem. Otherwise, the image isplaced in the item from the topleft corner. The image is expandedor contracted, keeping the originalaspect ratio, to the point at whichone of the sides fits snugly in theitem and the other side is smallerthan the item.

Available In

button, label

Example

This sample displays a company logo as a re-sized image.<image>page_1st.company_logo</image><imagemode>resize</imagemode>

Usage Details1. Default: resize

2. An imagemode of clip draws the image in the upper left corner of the item. Ifthe image is too big for the item’s space, and the image is clipped at the item’sedge. If the image is smaller than the item in either horizontally or vertically,the image is centered appropriately.

3. An imagemode of resize re-sizes the image to be the exact size of the item,whether that means an increase in size, decrease in size, or an increase in onedimension and decrease in the other.

<imagemode>image mode</imagemode>

138 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 145: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

4. An imagemode of scale also re-sizes the image to fit the item, except that it willpreserve the aspect ratio of the original image. If either dimension of the imageis larger than the item, then the image will be made small enough to fit in thegiven space as follows:v The larger dimension will fit snugly in the space.v The other dimension will be scaled by the same factor.

Likewise, if both dimensions of the image are smaller than the space givenby the button or label, then the image will be expanded to fit the given spaceas follows:

v The larger dimension will fit snugly in the space.v The other dimension will be scaled by the same factor.

5. Use this option with the image option to control the image’s appearance withbutton and label items.

XFDL Version 7.7 139

Page 146: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

itemfirstIdentifies the first item on the page, excluding the global item.

An item is first when it appears first in the build order (in other words, it is firstin the XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 35. itemfirst parameters

Parameter Type Description

item reference string A reference to the first item on thepage, excluding the global item.

Available In

page global

Example

This sample shows how the itemfirst option appears in the page globals of a form.<page sid="PAGE1">

<global sid="global"><itemfirst>LABEL1</itemfirst>

</global></page>

Usage Details1. Defaults: none

2. The itemfirst option is not saved or transmitted with form descriptions.

<itemfirst>item reference</itemfirst>

140 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 147: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

itemlastIdentifies the last item on the page, excluding the global item.

An item is last when it appears last in the build order (in other words, it is last inthe XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 36. imagelast parameters

Parameter Type Description

item reference string A reference to the last item on thepage, excluding the global item.

Available In

page global

Example

This sample shows how the itemlast option appears in the page globals of a form.<page sid="PAGE1">

<global sid="global"><itemlast>BUTTON2</itemlast>

</global></page>

Usage Details1. Defaults: none

2. The itemlast option is not saved or transmitted with form descriptions.

<itemlast>item reference</itemlast>

XFDL Version 7.7 141

Page 148: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

itemlocationSpecifies the location of an item in the page layout and also allows you set the sizeof the item, either in relation to another item, or in absolute terms.

Itemlocation offers three ways to position items on the page:1. Absolute positioning – Anchors the top left corner of an item to a particular

location on the page, using an x-y coordinate. For example, you might place anitem 10 pixels in from the left margin, and 10 pixels down from the top of thepage.

2. Relative positioning – Places items on the page in relation to one another. Forexample, it might place one item below another.

3. Offset positioning – Allows you to place an item on the page relative to anotheritem, and then move it a set amount. For example, you might place an itembelow another, and then move it 10 pixels to the right.

Itemlocation also provides two ways to set the size for an item:1. Relative positioning – Allows you set the size of an item relative to another item

on the page. For example, you might expand an item so that it’s right edgelines up with the right edge of a different item.

2. Extent sizing – Allows you to set the absolute size of an item, to the pixels. Forexample, you might set an item to be 100 pixels wide and 30 pixels tall.

Note: You can also combine these methods for positioning and sizing. Forexample, you might place an item on the form using absolute positioning, andthen place a second item below the first using relative positioning.

Syntax

Table 37. itemlocation parameters

Parameter Type Description

settings (see below) v The setting describes where toposition the item and how tosize it. This can take four forms:absolute positioning, relativepositioning, offset positioning,and extent sizing. Thesemethods are described in moredetail below.

Available in

box, button, check, checkgroup, field, label, line, list, popup, combobox, radio,radiogroup, slider, spacer.

Absolute positioning

Absolute positioning places the item at a specific x-y coordinate on the page. Thislocation is measured from the top left corner of the page to the top left corner of

<itemlocation>settings

</itemlocation>

142 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 149: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

the item, and is expressed in pixels. When using absolute positioning, the syntaxis:

Table 38. absolute positioning parameters

Parameter Type Description

x-coordinate short (must be positive) The horizontal distance in pixelsfrom the form’s top left corner.

v If the item is parented under acontainer item using theLeft-To-Right orientation, xsuboption defines the offset ofthe item’s leftmost edge fromthe container’s leftmost edge.

v If the item is parented under acontainer item using theRight-To-Left orientation, xsuboption defines the offset ofthe kid’s rightmost edge fromthe container’s rightmost edge.

y-coordinate short (must be positive) The vertical distance in pixelsfrom the form’s top left corner.

Example

This sample places a label on the page so that its top left corner is 20 pixels infrom the page’s left edge, and 30 pixels down from the top of the page.

<label sid="persInfo_label"><value>Personal Information</value><itemlocation>

<x>20</x><y>30</y>

</itemlocation></label>

Relative positioning

Relative positioning allows an item to be placed relative to the location of anotheritem. It also allows for the specification of an item’s size relative to the size andlocation of other items. The other items (called reference points or anchor items)must be defined earlier in the XFDL form description before they can be used in anitemlocation statement.

When using the relative positioning scheme, the first external item placed on theform appears in the top left corner. It cannot be placed in relation to any otheritem, since no other items exist. All subsequent items can be placed in relation toitems that appear before them in the form’s description. If no relational position foran item is specified, it will appear below the previous item, with its left edgeagainst the page’s left edge.

<itemlocation><x>x-coordinate</x><y>y-coordinate</y>

</itemlocation>

XFDL Version 7.7 143

Page 150: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

When using relative positioning, the syntax is:

Table 39. relative positioning parameters

Parameter Type Description

modifier (see below) v Determines where in relation tothe reference point the item isplaced. For example, you canspecify that the item goes″below″ the reference item. Theavailable modifiers aredescribed in more detail below.

item reference string v Identifies the reference pointitem. This item must be on thesame page, or within the sametoolbar, as the item you areplacing.

Modifiers

There are three types of modifiers:1. position modifiers – Used to position an item2. alignment modifiers – Used to align one edge of an item (relative positioning

only)3. expansion modifiers – Used to alter an item’s size (relative positioning only)

1. Position Modifiers:

above Places item a small distance above reference point item; aligns left edges.

after Within a ltr (Left-To-Right) orientation, places item a small distance left ofthe reference point item; aligns top edges.

Within a rtl (Right-To-Left) orientation, places item a small distance rightof the reference point item; aligns top edges.

before Within a ltr (Left-To-Right) orientation, places the item a small distance leftof the reference point item; aligns top edges

Within a rtl (Right-To-Left) orientation, places the item a small distanceright of the reference point item; aligns top edges

below Places item a small distance below reference point item; aligns left edges.

<itemlocation><modifier>item reference</modifier>

</itemlocation>or

<itemlocation><modifier>

<itemref>item reference</itemref><itemref>item reference</itemref>

</modifier></itemlocation>

Note: The second syntax is used when an item is positioned between two other items.

144 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 151: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

withinOptions defined within a page or item can override global settings for thatparticular page or item.

2. Alignment Modifiers:

alignb2bAligns bottom edge of item with bottom edge of reference point item.

alignb2cAligns bottom edge of item with vertical center of reference point item.

alignb2tAligns bottom edge of item with top edge of reference point item.

alignc2bAligns vertical center of item with bottom edge of reference point item.

alignc2lWithin a ltr (Left-To-Right) orientation, aligns horizontal center of itemwith left edge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns horizontal center of itemwith right edge of reference point item.

alignc2rWithin a ltr (Left-To-Right) orientation, aligns horizontal center of itemwith right edge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns horizontal center of itemwith left edge of reference point item.

alignc2tAligns vertical center of item with top edge of reference point item.

alignhoriz betweenAligns horizontal center of item between right edge of first reference pointitem and left edge of second reference point item.

alignhorizc2cAligns horizontal center of item with horizontal center of reference pointitem; center below. Note that this modifier requires two reference points.

alignl2c

Within a ltr (Left-To-Right) orientation, aligns left edge of item withhorizontal center of reference point item.

Within a rtl (Right-To-Left) orientation, aligns right edge of item withhorizontal center of reference point item.

alignl2lWithin a ltr (Left-To-Right) orientation, aligns left edge of item with leftedge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns right edge of item with rightedge of reference point item.

alignl2rWithin a ltr (Left-To-Right) orientation, aligns left edge of item with rightedge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns right edge of item with leftedge of reference point item.

XFDL Version 7.7 145

Page 152: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

alignr2cWithin a ltr (Left-To-Right) orientation, aligns right edge of item withhorizontal center of reference point item.

Within a rtl (Right-To-Left) orientation, aligns left edge of item withhorizontal center of reference point item.

alignr2lWithin a ltr( Left-To-Right) orientation, aligns right edge of item with leftedge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns left edge of item with rightedge of reference point item.

alignr2rWithin a ltr (Left-To-Right) orientation, aligns right edge of item with rightedge of reference point item.

Within a rtl (Right-To-Left) orientation, aligns left edge of item with leftedge of reference point item.

alignt2bAligns top edge of item with bottom edge of reference point item.

alignt2cAligns top edge of item with vertical center of reference point item.

alignt2tAligns top edge of item with top edge of reference point item.

alignvertbetweenAligns vertical center of item between bottom edge of first reference pointitem and top edge of second reference point item. Note that this modifierrequires two reference points.

alignvertc2cAligns vertical center of item with vertical center of reference point item.

3. Expansion Modifiers:

expandb2bHolds top edge of item constant and expands bottom edge to align withbottom edge of reference point item.

expandb2cHolds top edge of item constant and expands bottom edge to align withvertical center of reference point item.

expandb2tHolds top edge of item constant and expands bottom edge to align withtop edge of reference point item.

expandl2cWithin a ltr (Left-To-Right) orientation, holds right edge of item constantand expands left edge to align with horizontal center of reference pointitem.

Within a rtl (Right-To-Left) orientation, holds left edge of item constantand expands right edge to align with horizontal center of reference pointitem.

expandl2l

146 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 153: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Within a ltr (Left-To-Right) orientation, holds right edge of item constantand expands left edge to align with left edge of reference point item.

Within a rtl (Right-To-Left) orientation, holds left edge of item constantand expands right edge to align with right edge of reference point item.

expandl2r

Within a LTR container, holds right edge of item constant and expands leftedge to align with right edge of reference point item.

Within a RTL container, holds left edge of item constant and expands rightedge to align with left edge of reference point item.

expandr2c

Within a ltr (Left-To-Right) orientation, holds left edge of item constantand expands right edge to align with horizontal center of reference pointitem.

Within a rtl (Right-To-Left) orientation, holds right edge of item constantand expands left edge to align with horizontal center of reference pointitem.

expandr2lWithin a ltr (Left-To-Right) orientation, holds left edge of item constantand expands right edge to align with left edge of reference point item.

Within a rtl (Right-To-Left) orientation, holds right edge of item constantand expands left edge to align with right edge of reference point item.

expandr2rHolds left edge of item constant and expands right edge to align with rightedge of reference point item.

expandt2bHolds bottom edge of item constant and expands top edge to align withbottom edge of reference point item.

expandt2cHolds bottom edge of item constant and expands top edge to align withvertical center of reference point item.

expandt2tHolds bottom edge of item constant and expands top edge to align withtop edge of reference point item.

expandheightResizes the height of an item by a specified number of pixels.

expandwidthResizes the width of an item by a specified number of pixels.

Examples

This sample aligns the vertical center of an item between the bottom edge of theitem label_one and the top edge of the item label_two.

<itemlocation><alignvertbetween>

<itemref>label_one</itemref><itemref>label_two</itemref>

</alignvertbetween></itemlocation>

XFDL Version 7.7 147

Page 154: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This sample aligns the item’s left edge with the center of item the_firm andexpands the right edge to align with the right edge of the same reference item(the_firm).

<itemlocation><alignl2c>the_firm</alignl2c><expandr2r>the_firm</expandr2r>

</itemlocation>

This sample assigns an item to the toolbar main_toolbar and positions it under thecompany logo company_logo.

<itemlocation><within>main_toolbar</within><below>company_logo</below>

</itemlocation>

Offset positioning

The relative positioning scheme also allows an item to be offset from its originalposition, by a particular number of pixels. This is a quick way to create anindented layout on a form. You can offset an item in any of these four directions:right, left, up, down. The offset is expressed as an x and y value, and follows therelative positioning statement, as shown:

Table 40. off-set positioning parameters

Parameter Type Description

relative positioning (see above) v Sets the position of the itemrelative to one or more items onthe form.

x-offset integer v The number of pixels to movethe item along the x axis.

When ltr (Left-To-Right)orientation is used, a positivenumber moves the item to theright, and a negative numbermoves the item to the left.

When rtl (Right-To-Left)orientation is used, a positivenumber moves the item to theleft and a negative numbermoves the item to the right.

y-offset integer v The number of pixels to movethe item along the y axis. Apositive number moves the itemdown, a negative numbermoves the item up.

<itemlocation>relative positioning<offsetx>x-offset</offsetx><offsety>y-offset</offsety>

</itemlocation>

148 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 155: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

This sample places an item below a label called persInfo_label, and then uses offsetto move the item 15 pixels to the left and 20 pixels down:

<itemlocation><below>persInfo_label</below><offsetx>-15</offsetx><offsety>20</offsety>

</itemlocation>

In the following sample we wanted to add a line below a field with a grey borderwithout leaving any extra padding. The line is positioned below the field andexpanded right to right.

By default, the relative below placement causes the line to be positioned 5 pixelsbelow the field. The offsety is used to bring it up 2 pixels. This places it againstthe bottom of the grey border, but the line also starts 3 pixels to the left of the textin the field. To line it up with the grey border, so that there is only 1 pixel ofpadding to the left of the field, we set offsetx to 2 pixels. This moves the left edgeover 2 pixels. However, the right edge also moves over 2 pixels, so it is now 4pixels past the grey border on the right (2 pixels for the movement, and 2 pixelsfor the automatic padding to the right of the field). To fix this we adjust the lengthby setting the expandwidth option to -4 to shrink the line by the 4 pixels.

FIELD1

offsetx = 2 expandwidth = -4

[ [

<field sid="FIELD1"><itemlocation>

<x>85</x><y>86</y>

</itemlocation><scrollhoriz>wordwrap</scrollhoriz><value></value><bgcolor>200,200,200</bgcolor><border>off</border>

</field><line sid="LINE1">

<itemlocation><below>FIELD1</below><expandr2r>FIELD1</expandr2r><offsetx>2</offsetx><offsety>-7</offsety><expandwidth>-4</expandwidth>

</itemlocation></line>

Extent sizing

Extent sizing provides a different way to set the size of an item, and works inconjunction with either absolute or relative positioning. Unlike the size option,which sets the size of an item in terms of the number of internal characters, youcan use extent sizing to set the absolute size of the exterior, or bounding box, of anitem. Futhermore, using extent sizing overrides the size option.

XFDL Version 7.7 149

Page 156: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Extent sizing sets the size of an item in pixels, using separate values for the widthand the height. When an extent is specified, the item’s top left corner will staywhere it is, and the item will be resized so that it is as many pixels wide as thewidth value and as many pixels tall as the height value.

Extent sizing uses the following syntax:

Table 41. extent sizing parameters

Parameter Type Description

positioning (see above) v Sets the position of the item onthe form. This can be eitherabsolute or relative positioning.

width integer v The width of the item, in pixels.

height integer v The height of the item, inpixels.

Example

This sample shows an extent setting on a field that has been placed using absolutepositioning. The field is first placed at an x-y coordinate of 10, 10. It is then sizedto be 300 pixels wide and 30 pixels high.

<itemlocation><x>10</x><y>10</y><width>300</width><height>30</height>

</itemlocation>

Usage details1. Default item location:v in the body of the pagev under the previous item in the page definitionv aligned along the left margin of the page

2. Itemlocation overrides size. If the itemlocation affects the size of the item(using extent sizing) and the size option has also been set for the item, theitemlocation will determine the size.

3. There are two measurements for sizing items when using absolute positioning:in pixels (using extent sizing) or in characters (using the size option). If youchoose to size items using characters, you should be aware that differentplatforms and video cards use differently sized fonts. Even with so-calledcross-platform fonts, an item’s actual size (in pixels) might change from oneplatform to the next if it is sized using character height and width. As a result,absolutely positioned items sized with characters may have overlap sizingproblems if displayed on different platforms, different video cards, or in bothsmall font and large font modes. To ensure that forms appear the same on any

<itemlocation>positioning<width>width</width><height>height</height>

</itemlocation>

150 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 157: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

platform, and under any video card or font mode while using absolutepositioning, size items in pixels or inches.

4. An item’s vertical center is halfway between the top and bottom edges. Thehorizontal center is halfway between the left and right edges.

5. expandheight, the expandwidth allows you to resize items more precisely. Thisis particularly useful for re-sizing lines that are used to separate table rows andcolumns.

6. itemlocation overrides layoutflow. Delete itemlocation coordinate values tocontrol the flow of items.

7. The “orientation” on page 181 option affects the X coordinate.

XFDL Version 7.7 151

Page 158: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

itemnext

Identifies the next item on the page, excluding the global item. An item is nextwhen it appears next in the build order (in other words, it is next in the XFDLtext).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 42. itemnext parameters

Parameter Type Description

item reference string A reference to the next item onthe page, excluding the globalitem.

Available In

action, box, button, cell, check, checkgroup, combobox, data, field, help, label, line,list, popup, radio, radiogroup, signature, slider, spacer, toolbar

Example

The following example shows what two labels look like in memory, with theitemnext option inserted in each:

<label sid="LABEL2"><value>This is a label.</value><itemnext>LABEL3</itemnext>

</label><label sid="LABEL3">

<value>This is a label.</value><itemnext>LABEL4</itemnext>

</label>

You can use computes to determine the next item on the form. For example, thefollowing code shows a label that uses a compute set its value. The compute goesto the item that currently has the focus, then copies the value of the itemnextoption from that item:

<label sid="nextItemName"><value compute="PAGE1.global.focuseditem->itemnext"></value>

</label>

Usage Details1. Defaults: none

2. If the itemnext option is in the last item on the page, it points to the first itemon the page (excluding the global item).

3. When the itemnext option is used in items that appear in table rows:v Each item points to the next item in the row.v The last item in the row points to the first item in the next row.

<itemnext>item reference</itemnext>

152 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 159: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v The last item in the table it points to the first item following the table.4. When working with panes, tables, radiogroups, or checkgroups:v The item that precedes a table, pane, radiogroup, or checkgroup points to the

table, pane, radiogroup, or checkgroup.v The last item generated by a pane, table, radiogroup, or checkgroup points to

the first item following the containing item.5. The itemnext option is not saved or transmitted with form descriptions.

XFDL Version 7.7 153

Page 160: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

itemprevious

Identifies the previous item on the page, excluding the global item. An item isprevious when it immediately precedes the current item in the build order (inother words, it comes immediately before the current item in the XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 43. itemprevious parameters

Parameter Type Description

item reference string A reference to the previous itemon the page, excluding the globalitem.

Available In

action, box, button, cell, check, checkgroup, combobox, data, field, help, label, line,list, popup, radio, radiogroup, signature, slider, spacer, toolbar

Example

The following example shows what two labels look like in memory, with theitemprevious option inserted in each:

<label sid="LABEL2"><value>This is a label.</value><itemprevious>LABEL1</itemprevious>

</label><label sid="LABEL3">

<value>This is a label.</value><itemprevious>LABEL2</itemprevious>

</label>

You can use computes to determine the previous item on the form. For example,the following code shows a label that uses a compute to set its value. The computegoes to the item that currently has the focus, then copies the value of theitemprevious option from that item:

<label sid="previousItemName"><value compute="PAGE1.global.focuseditem->itemprevious"></value>

</label>

Usage Details1. Defaults: none

2. If the itemprevious option is in the first item on the page (excluding the globalitem), it points to the last item on the page.

3. When the itemprevious option is used in items that appear in table rows:v Each item points to the previous item in the row.v The first item in a row points to the last item in the previous row.

<itemprevious>item reference</itemprevious>

154 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 161: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v The first item in the table points to the table.4. The itemprevious option is not saved or transmitted with form descriptions.

XFDL Version 7.7 155

Page 162: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

justifyDetermines the placement of text within the containing item.

Syntax

Table 44. justify parameters

Parameter Type Description

alignment left Text is placed so that it is flushwith left edge of item.

right Text is placed so that it is flushwith right edge of item.

center Text is centered in item.

lead Aligns Left-To-Right text left, andRight-To-Left text right so that it isflush with side at which you startreading.

trail Aligns Left-To-Right right andRight-To-Left left so that it is flushwith side at which you startreading.

Available in

button, combobox, field, label, popup

Example

This sample aligns the text in the center of the item.<justify>center</justify>

Usage details1. Default:left

2. The built-in labels (label option) for items do not support a justify option.3. If you center or right justify a field with a scrollhoriz of never, the field will

wordwrap if you type beyond the edge of the field. However, the new line oftext will continue to be right or center justified.

<justify>alignment</justify>

156 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 163: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

keypressContains the last keystroke or keystroke combination made by the user in thefocused item, page, or form.

A keypress option is ignored if no keypress has been established at the level offocus. If the value of a keypress option is ignored at the item level, it passes up tothe page level, and if ignored at the page level, it passes up to the form level. Thisoption allows for the creation of a default button (shortcut key) on a page or aform.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 45. keypress parameters

Parameter Type Description

Key pressed ESC escape key

ENTER enter key

NUMPAD_ ENTER number pad enter key

″ ″ space bar

F[1-12] function key (can be any key fromF1 to F12)

any alphanumeric char Any upper or lower casealphanumeric key on thekeyboard. For example ’d’ or ’T’.

ALT/CTRL[a-z/A-Z] Alt or Ctrl + any upper or lowercase alpha key on the keyboard.For example ’Alt + G’ or ’Ctrl + q’Notes:

v This key combination can onlybe used in the Viewer. It is notsupported in Webform Server .

v Some Ctrl and Alt keypresscombinations overlap withexisting Viewer hot keys suchas Ctrl + a. Hot key actions areevaluated before keypressoptions.

Available In

button, field, combobox, popup, list, radio, check, page global, form global

Example

The following example shows how you can set the keypress options to the Ctrl +G keys at the page global and global levels. When the form’s user presses the Ctrl

<keypress>key pressed</keypress>

XFDL Version 7.7 157

Page 164: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

+ Shift + g keys, it activates the CancelButton’s cancel action and the text “Youpressed Ctrl + G” is then displayed in the field and a save dialog box is displayed.<button sid="CancelButton">

<type>cancel</type><value>Cancel</value><custom:myoption xfdl:compute="toggle(PAGE1.global.keypress, '', 'CTRL+g')

== '1' ?set ('CancelButton.activated','on'): ''"></custom:myoption>

<custom:my xfdl:compute="toggle(global.global.keypress, '', 'CTRL+g')== '1' ?set ('FIELD1.value','You pressed Ctrl + G'): ''"></custom:my>

</button><label sid="FIELD1_LABEL1">

<itemlocation><x>3</x><y>57</y>

</itemlocation><value>Name</value>

</label><field sid="FIELD1">

<scrollhoriz>wordwrap</scrollhoriz><value></value>

</field>

Usage Details1. Default: none

2. The keypress option enables the use of a default button or action on the form.3. You cannot place a compute in the activated option of a button. You must place

it in a custom option.4. The keypress option is not saved or transmitted with form descriptions.

158 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 165: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelSpecifies a text label for an item.

The label usually appears above the item and aligned with its left margin. Forpopup items, the label appears inside the item when no selection has been made.

Syntax

Table 46. label parameters

Parameter Type Description

label text string The text of the label.

Available in

cell, check, checkgroup, combobox, field, list, pane, popup, radio, radiogroup,slider, spacer, page global, form global

Example

This sample defines a typical label.<label>Student Registration Form</label>

Usage details1. Default:v XFDL: none

v XForms: the value of the xforms:label option.2. If an item contains both a label option and an xforms:label option, the XFDL label

option takes precedence.3. The label defined in a label option has a transparent background by default. To

display a particular color behind the label, set the labelbgcolor option.4. If used in the page global, the label option sets the title of the page as it appears

in the title bar of the window displaying the form. If used in the form global,the label option sets the default title for all pages.

5. Multiple line labels require a carriage return in the code where you want it toappear in the label. For example:

<label>This label spanstwo lines.</label>

Note that not all items allows multi-line labels.6. If a bidirectional language is used, the label text direction is consistent with the

item orientation.v In a Left-To-Right (ltr) orientation, the label text direction is Right-To-Right.v In a Right-To-Left (rtl) orientation, the label text direction is Left-To-Left.

7. If a bidirectional language is used, the label justification is also consistent withthe item orientation.v If your checkgroup or radiogroup has a Left-To-Right (lrt) orientation, then

the label appears to the right of each check or radio item.

<label>label text</label>

XFDL Version 7.7 159

Page 166: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v If your checkgroup or radiogroup has an Right-To-Left (rtl) orientation, thenthe label appears to the left of each check or radio item.

160 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 167: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelbgcolorDefines the background color for the label specified in the label option.

Syntax

Table 47. labelbgcolor

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

check, checkgroup, combobox, field, list, pane, radio, radiogroup, slider

Examples

These samples all set the background color to red.<labelbgcolor>red</labelbgcolor><labelbgcolor>255,0,0</labelbgcolor><labelbgcolor>#FF0000</labelbgcolor>

Usage details1. Default: transparent

This means that a label option will always be transparent unless a color isspecified (if no color is specified, the label background color will be the sameas the page background color or an underlying box, if there is one).

<labelbgcolor>color</labelbgcolor>

XFDL Version 7.7 161

Page 168: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelborder

Defines whether there is a border around the label specified in the label option.

Syntax

Table 48. labelborder parameters

Parameter Type Description

border on item has a border

off item does not have a border

Available In

check, checkgroup, combobox, field, list, radio, radiogroup, slider

Example

This sample sets the label to have a border:<labelborder>on</labelborder>

Usage Details1. Default: off

2. The border is always one pixel in width.

<labelborder>status</labelborder>

162 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 169: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelfontcolorDefines the font color for the label specified in the label option.

Syntax

Table 49. labelfontcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

check, checkgroup, combobox, field, list, pane, radio, radiogroup, slider

Examples

These samples both set the font color to green:<labelfontcolor>green</labelfontcolor><labelfontcolor>0,255,0</labelfontcolor><labelfontcolor>#008000</labelfontcolor>

Usage details1. Defaults first to page setting for fontcolor, then to the form setting for

fontcolor. If there is no fontcolor setting at the page or form level, the defaultis black.

<labelfontcolor>color</labelfontcolor>

XFDL Version 7.7 163

Page 170: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

labelfontinfoDefines the font name, point size, and font characteristics for the label specified inthe label option.

Syntax

Table 50. labelfontinfo properties

Parameter Type Description

font name string the name of the font

point size unsigned byte the size of the font

effect string Can be any of the following:

v plain – Use plain face font.

v bold – Use bold face font.

v underline – Use underlinedfont.

v italic – Use italic font.

Available in

check, checkgroup, combobox, field, list, pane, radio, radiogroup, slider

Example

This sample sets the font information to Palatino 12, plain (the default), underlinedin the ANSI character set.

<labelfontinfo><fontname>Palatino</fontname><size>12</size><effect>underline</effect>

</labelfontinfo>

Usage details1. Defaults first to page setting for fontinfo, then to the form setting for fontinfo.

If neither setting exists, then the defaults are:v font name: Helvetica

v point size: 8

v weight: plain

v effects: not underlined

v form: not italics

2. If any of the font info settings are invalid, then the defaults are used.

<labelfontinfo><fontname>font name</fontname><size>point size</size><effect>effect1</effect>...<effect>effectn</effect>

</labelfontinfo>

Note: effects are optional.

164 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 171: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

3. The size option calculates item size using the font’s average character width.Therefore, choice of font affects item width.

4. XFDL supports the following fonts and font sizes:v Fonts: Courier, Times, Symbol (symbol), Helvetica, and Palatino.v Sizes: 8, 9, 10, 11, 12, 14, 16, 18, 24, 36, 48.

5. Other fonts and font sizes may be used. However, especially for cross-platformInternet applications, it is best to choose from the ones cited above since theyare guaranteed to work.

XFDL Version 7.7 165

Page 172: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

lastIdentifies the last item in a repeat, group, or switch. This is the item that receivesthe focus when the user tabs backward into a group, a particular case, or a newrow in a repeat.

This option affects the tab order in the following ways:v When the user tabs backward into a table or pane, the focus goes to the last

item. In the case of a table, the focus goes to the last item in the last row.v When the user tabs backward from the beginning of a row, the focus goes to the

last item in the previous row or to the item that precedes the table or pane.v When the user tabs forward from this item, the focus goes to the next row or to

the item that follows the table or pane.

Syntax

Table 51. last parameters

Parameter Type Description

item reference string An XFDL reference to the lastitem in the last row of a table orthe last item in a pane.

Available in

pane, table

Example

The last option contains a reference to the first item in the table row. In this case, ifthe user tabs backward into the table, the focus goes to the quantity (Qty) field onthe last row. When the user tabs to the previous row, the focus goes to the quantityfield in that row.

<table sid="itemsTable"><last>Product</last><last>Qty</last><xforms:repeat nodeset="order/row">

<field sid="Qty"><previous>Product</previous><xforms:input ref="qty">

<xforms:label></xforms:label></xforms:input>

</field><popup sid="Product">

<next>Qty</next><xforms:select1 appearance="minimal" ref="product">

<xforms:label>Choose product</xforms:label><xforms:item>

<xforms:label>Widget</xforms:label><xforms:value>widget</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Gadget</xforms:label><xforms:value>gadget</xforms:value>

</xforms:item>

<last>item reference</last>

166 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 173: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</xforms:select1></popup><label sid="LineTotal">

<xforms:output ref="lineTotal"/></label>

</xforms:repeat></table>

Usage details1. Default: last item in the build order of a repeat, group, or case2. When a page contains an xforms:switch, this option is not effective unless all

cases contain an element with the same sid that is identified as last.

XFDL Version 7.7 167

Page 174: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

layoutflowControls the default item placement on the form. It allows you to set items eitherbelow or beside other items.

This is useful in check groups, radio groups and tables to control whether thecontent of the group is displayed vertically or horizontally.

Syntax

Table 52. layoutflow parameters

Parameter Type Description

flow string Valid values are block and inline.

v The value inline sets the leftand top edges to the “after”placement relative to previouslayout items. The result ishorizontal positioning of items.

v The value block sets the leftand top edges to the “below”placement relative to previouslayout items. The result isvertical positioning of items.

Available in

box, button, check, checkgroup, combobox, field, label, line, list, pane, popup,radio, radiogroup, table

Example

The following example displays two sets of check boxes. The first set of checkboxes defaults to inline. As a result the check boxes, with labels positioned abovethem, are aligned to the right of each other. The second set of check boxes are setto block. As a result, the check boxes are aligned after each other.

<check sid="CHECK1"><itemlocation></itemlocation><value>off</value><layoutflow>inline</layoutflow><group>groupname</group><label>A</label>

</check><check sid="CHECK2">

<itemlocation></itemlocation><value>off</value><layoutflow>inline</layoutflow><group>groupname</group><label>B</label>

</check><check sid="CHECK3">

<itemlocation></itemlocation><value>off</value><layoutflow>inline</layoutflow><group>groupname</group><label>C</label>

<layoutflow>flow</layoutflow>

168 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 175: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</check><check sid="CHECK5">

<itemlocation></itemlocation><value>off</value><layoutflow>block</layoutflow>

</check><label sid="LABEL1">

<itemlocation></itemlocation><value>LABEL1</value>

</label><check sid="CHECK4">

<itemlocation></itemlocation><value>off</value><layoutflow>block</layoutflow>

</check><label sid="LABEL2">

<itemlocation></itemlocation><value>LABEL2</value>

</label>

Usage details1. Default is dependent on the following conditions:v The default block flow is applied to Table, Pane, and the contents of

Checkgroups, and Radiogroups.v The default inline flow is applied to all other items.

2. itemlocation overrides layoutflow. Delete itemlocation coordinate values to controlthe flow of items.

XFDL Version 7.7 169

Page 176: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

layoutinfoRecords location information for all visible signed items.

A hash is taken of each page containing a signed item, and this hash includespositioning information for all the signed items relative to each other in thosepages.

Syntax

Table 53. layoutinfo parameters

Parameter Type Description

page sid string The scope ID of the page you arehashing.

pagehash string The hash of the page.

Available in

signature

Example

In the following example, the signature item includes hashes for the three pages onwhich items were signed:

<signature sid="signature1"><layoutinfo>

<pagehashes><pagehash>

<pageref>PAGE1</pageref><hash encoding="base64">pJAdX7+zh9+zEe</hash>

</pagehash><pagehash>

<pageref>PAGE2</pageref><hash encoding="base64">s+tHT+SElktqw4sod5</hash>

</pagehash><pagehash>

<pageref>PAGE3</pageref><hash encoding="base64">Jo13Ds+eth3EsSGE</hash>

</pagehash></pagehashes>

</layoutinfo></signature>

<layoutinfo><pagehashes>

<pagehash><pageref>page sid1</pageref><hash>pagehash1</hash>

</pagehash>...<pagehash>

<pageref>page sidn</pageref><hash>pagehashn</hash>

</pagehash></pagehashes>

</layoutinfo>

170 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 177: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. This option helps ensure the security of your forms when you have signed

items that are positioned using relative positioning, and unsigned referenceitems. Reference items are items on which the relative positioning of otheritems is based. Without layoutinfo, it is possible to move signed items on theform - without breaking the signature - by moving their unsigned referenceitems. By using layoutinfo to record the position of the signed items relative toeach other, you can detect this form of tampering.

XFDL Version 7.7 171

Page 178: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

linespacingAdjusts the spacing between lines of text.

This sets on offset value, which will add to or subtract from the default spacing.For example, a value of 1 will add one pixel to the space between each line, whilea value of -1 will remove one pixel from the space between each line.

Syntax

Table 54. linespacing parameters

Parameter Type Description

offset integer The offset measured in pixels.This can be a positive or negativeinteger, or a value of 0 for nooffset.

Available in

button, label, spacer

Example

In the following example, the linespacing for a label is set to 12, which will createa large amount of space between lines:

<label sid="LABEL1"><size>

<width>10</width><height>5</height>

</size><value></value><linespacing>12</linespacing>

</label>

Usage details1. Default: 0.2. When using a negative offset, the offset cannot be larger than the size of the

font (that is, the second line of text cannot be moved higher than the first line).For example, if the font was 12 pixels high, the offset could not be larger than-12.

3. When using a positive offset, there is no limit to the size of the offset.4. For buttons and labels, the linespacing affects the text in the value option. For

spacers, the linespacing affects the text in the label option.

<linespacing>offset</linespacing>

172 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 179: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

mimedataContains the actual data associated with a data item or a signature item. It can bebinary data or the contents of an enclosed file.

The data is encoded in base64 format, so that even forms containing binary datacan be viewed in a text editor. When the data is needed by the form, it is decodedautomatically from base64 back to its native format.

Data may also be compressed before base64 encoding, allowing an item to store alarger block of data.

About MIME data in signature items

The MIME data contains the contents of a signature. An XFDL generator mustcreate it as follows:1. Using the signature filter instructions in the associated signature button, create

a plain text version of the form or portion of the form to be signed.2. Using the instructions in the signature button’s signformat option, create a

hash of the plain text description.3. sign the hash with the signer’s private key.4. Include a binary representation of the signature (as generated by the signature

engine) in the mimedata option.

Syntax

Table 55. mimedata parameters

Parameter Type Description

format string The format in which to encode thedata. Valid formats are:

v base64 – A base 64 textualrepresentation of the data.

v base64-gzip – A base 64 textualrepresentation of the data afterit has been gzip compressed.

MIME data string The binary data or enclosed filecontents.

Available in

data, signature

Example

This sample assigns some encoded data to the mimedata option:<mimedata encoding="base64-gzip">

R0lGODdhYABPAPAAAP///wAAACwAAAAAYABPAAAC/4SPqcvtD02YArt68+Y7im7ku2KkzXnOzh9v7qNw+k+TbDoLFTvCSPzMrS2YzmTE

</mimedata>

<mimedata encoding="format">MIME data</mimedata>

XFDL Version 7.7 173

Page 180: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This sample shows a mimedata option in a digital signature:<signature sid="empsignature">

<signformat>application/vnd.xfdl</signformat><signer>Jane D Smith, [email protected]</signer><signature>Page1.empsignature</signature><signitemrefs>

<filter>omit</filter><itemref>Page1.mgrSigButton</itemref><itemref>Page1.admSigButton</itemref><itemref>Page1.empsignature</itemref><itemref>Page1.mgrsignature</itemref><itemref>Page1.admsignature</itemref>

</signitemrefs><!-- The items listed above MUST have itemlocation

options with absolute and extent as the lastsettings in order for the filter below tobe sufficient in terms of security --><signoptionrefs>

<filter>keep</filter><optionref>PAGE1.mgrSigButton.itemlocation</optionref><optionref>PAGE1.admSigButton.itemlocation</optionref><optionref>PAGE1.empsignature.itemlocation</optionref><optionref>PAGE1.mgrsignature.itemlocation</optionref><optionref>PAGE1.admsignature.itemlocation</optionref>

</signoptionrefs><signoptions>

<filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions><mimedata encoding="base64">

MIIFMgYJKoZIhvcNACooIIFIzCCBR8CAQExDzANBgkgAQUFADALB\ngkqhkiG9w0BBwGgggQZMCA36gAwSRiADjdhfHJl6hMrc5DySSP+X5j\nANfBGSOI\n9w0BAQQwDwYDVQQHEwhJbmRlcm5lqwdDEXMBUGA1UEChM\nOVmVyaVNpZ24sIEluYy4xNDAKnqweaftn1ZlcmlTaWduIENsYXNzIDEgQ0Eg\nLSJbmRdWFsIFN1YnNjcmliyZXIwHhcNOTgwMTI3MwMDAwOTgwM\M1OTU5WjCCARExETA

</mimedata></signature>

Usage details1. Default: none

2. Base64 encoding transforms the data into a format that can be processed easilyby text editors, e-mail applications, and so on. Converting data to base64format ensures the resulting string contains no characters requiring an escapesequence.

3. Base64-gzip encoding compresses the data before transforming it to base64format.

4. For signatures: because the signer’s public key is included in the MIME data, asubsequent program can verify a signature without requiring that the signer’skey be previously installed.

5. For signatures: the mimedata option in a signature item is always omitted fromthe signature represented by that item, regardless of the signature filters in use.This is done because the mimedata is not populated with the signatureinformation until after the signature has been applied. (In other words, thesignature can’t include itself because it hasn’t been generated yet.)

6. For signatures: the mimedata option in a data item used to store a signatureimage (see signatureimage option) is always omitted from the signaturerepresented by that image, regardless of the signature filters in use. This isdone because the mimedata is not populated with the signature image until

174 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 181: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

after the signature has been applied. (In other words, the signature can’tinclude its own image because it hasn’t been added to the form yet.)

7. For information about supported images formats, see “image” on page 136

XFDL Version 7.7 175

Page 182: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

mimetypeDefines the MIME type of the data stored in a data item.

Syntax

Table 56. mimetype parameters

Parameter Type Description

MIME type string the MIME type of the data item

Available in

data

Example

This sample sets the MIME type to indicate image data:<mimetype>image/gif</mimetype>

Usage details1. Default: application/vnd.xfdl

2. The following are examples of MIME types. For full information on MIMEtypes, read the MIME rfcs (1521, 1522, 1867 and 822), available on the WorldWide Web.

application/vnd.xfdlXFDL form item

image/jpegimage item

image/rastimage item

image/bmpimage item

image/gifimage item

text/plainASCII text item

3. For information about supported images formats, see “image” on page 136

<mimetype>MIME type</mimetype>

176 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 183: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

mouseoverSpecifies whether the mouse pointer is currently over an item or page.

This option is set by an external program such as a parser, and is not saved ortransmitted as part of the form. Instead, it is automatically created each time theform is read into memory, and is maintained only during display or processing.

Syntax

Table 57. mouseover parameters

Parameter Type Description

status on mouse pointer is over item orpage

off mouse pointer is not over item orpage

Available in

button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, toolbar,page global

Example

The following example shows a button that changes its color to white if it themouse pointer is over it, and to blue if the pointer is not over it.

<button sid="saveButton"><type>saveas</type><value>Save</value><bgcolor compute="mouseover == 'on' ? 'white' :

'blue'"></bgcolor></button>

Usage details1. Default: off

2. An object’s mouseover option is set to on when the mouse pointer is over theobject, and to off when the mouse pointer is not over the object.

3. A page global mouseover option is set to on when the mouse pointer is over thepage (even if it is also over an item on the page).

4. A mouseover option in a toolbar is set to on when the mouse pointer is over thetoolbar (even if it is also over an item in the toolbar).

5. The mouseover option is not included in form descriptions that are saved ortransmitted.

<mouseover>status</mouseover>

XFDL Version 7.7 177

Page 184: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

nextIdentifies the item to receive focus when a user tabs ahead from the current item.

If a user tabs ahead from the last item on the page, the tab cycles within the samepage, beginning with the first item on the page. Only modifiable or readonly itemscan receive focus.

Syntax

Table 58. next parameters

Parameter Type Description

item reference string identifies the item to receive focusnext

Available in

button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, slider,page global

Example

This sample points to the item “address_field”. When users tab ahead from thecurrent item, the item identified as “address_field” will receive focus.

<next>address_field</next>

Usage details1. Default: none

2. The first page defined in the form is always the first page displayed. Thedefault tabbing order depends on the order in which page and item definitionsoccur within the form definition. The sequence is as follows:v First item to receive focus: first modifiable item defined for the body of the

first pagev Subsequent items to receive focus: each modifiable item on the page in the

order in which they are defined3. If the last item on the page is tabbed past, the first modifiable item in the

page’s toolbar receives focus. If there is no toolbar, focus returns to the firstitem.

4. Placing next in page globals defines the first item to receive focus when thepage appears.

5. If the next option identifies page globals, focus moves to the item defined toreceive focus when the page appears. The page globals reference is global forthe current page or page_tag.global for another page.

numericshapingDetermines whether Arabic (European) numerals or national numerals are used.This option is typically used for bidirectional languages, such as Arabic andHebrew.

<next>item reference</next>

178 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 185: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Syntax

Table 59. numericshaping properties

Parameter Type Description

numeralType nominal Uses Arabic numerals exclusively.

national Uses national locale numeralsystem exclusively.

contextual Selects the numeric symbolsdepending on proceeding context.

Available in

button, check, checkgroup, combobox, field, label, list, pane, popup, radio,radiogroup, slider, table, toolbar

Example

The following example stores the Arabic data entered in FIELD1 in their nationalcounterparts.<field sid="FIELD1">

<scrollhoriz>wordwrap</scrollhoriz><value></value><direction>ltr</direction><numericshaping>national</numericshaping><scrollvert>always</scrollvert><itemlocation>

<x>636</x><width>249</width><y>188</y><height>100</height>

</itemlocation></field>

Usage details1. Default: Per parent, or contextual if not set in parent.2. Applied to plain and enriched (rtf) text.3. If the nominal setting is applied, Arabic numerals are exclusively used. As a

consequence, occurrences of traditional numbers will be replaced by theirArabic (European) counterparts.

4. If the national setting is applied, Arabic numerals will be replaced by theirnational counterparts.

5. If the contextual setting is applied, numerics are selected depending onproceeding context according to rules W2 of the Unicode Bidi Algorithm(UBA). Uses Arabic (European) numerals unless Arabic script is found. If theArabic script is found, Arabic-Indic numerals are used.

6. Images used in button or label items are not affected.7. This option does not apply to data presented by secondary functions invoked

by the item. For example, data presented by the viewer.messageBox function, filename data presented in enclosure dialogs, file dialogs, and data presented insigning ceremonies.

<numericshaping>numeralType</numericashaping>

XFDL Version 7.7 179

Page 186: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

8. Affects Label, Value, XForms:Label options, but does not affect other options.

orderingschemeDefines the order in which the text is stored in memory. This option is typicallyused for bidirectional languages, such as Arabic and Hebrew.

Syntax

Table 60. orderingscheme parameters

Parameter Type Description

storage method logical Stores user data in the order inwhich it was typed. For example,conforms to the UnicodeBidirectional Algorithm.

visual Stores user data in the order it isdisplayed on the screen. Forexample, overrides the UnicodeBidirectional Algorithm.

Available in

button, check, checkgroup, combobox, field, label, list, pane, popup, radio,radiogroup, slider, table, toolbar

Example

This example demonstrates the results of setting Left-to-right and right-to-leftorientation and orderingscheme options. Assume the uppercase letters representArabic or Hebrew letters:v logical LTR ″engBRA″

v logical RTL ″BRAeng’v visual LTR ’engARB;v visual RTL ’BRAeng’

Usage details1. Default: Per Parent, or logical if not set in Parent.2. Images used in button or label items are not affected.3. This option does not affect data presented by the result of applying functions to

the form, for example, viewer.messageBox.. Furthermore, file name datapresented in enclosure dialogs, file dialogs, and data presented in signaturesare not affected by this option.

4. Affects values stored in these options: label, RTF, value, XForms:label. Does notaffect values stored in other options.

<orderingscheme>storage method

</orderingscheme>

180 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 187: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

orientationDefines the direction of text on a form. This option is typically used forbidirectional languages, such as Arabic and Hebrew.

For example, if you set your form’s locale to bidirectional (xml:lang) , thedominant orientation of the form is right-to-left. However, email addresses andURL’s are always displayed left-to-right. Therefore, if you want users to enter theiremail address into a field, you would need to use the orientation option to changethe direction of the text from right-to-left to left-to-right.

This setting also affects the following options in the same item:v “border” on page 82v “itemlocation” on page 142v “label” on page 159v “value” on page 288v xforms:label

To affect the text only, use “direction” on page 94.

Syntax

Table 61. orientation parameters

Parameter Type Description

direction rtl

ltr

Optional. Sets the orientation asRight-To-Left.

Optional. Sets the orientation asLeft-To-Right.

Available in

button, check, checkgroup, combobox, field, global, global, globalpage, label, list,popup, radio, radiogroup, pane, slider, table, toolbar.

Example

This following example shows a form using a bidirectional language, and theorientation option to set the text orientation in the field to Left-to-Right direction.The label is using the xml:lang orientation Right-To-Left and the Email addressfield is using the orientation of Left-To-Right.<?xml version="1.0" encoding="UTF-8"?><XFDL xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom"xmlns:designer="http://www.ibm.com/xmlns/prod/workplace/forms/designer/2.6"xml:lang="ar-XX" xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"><globalpage sid="global">

...<label sid="FIELD1_LABEL1">

<itemlocation><x>160</x><y>108</y>

<orientation>direction</orientation>

XFDL Version 7.7 181

Page 188: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</itemlocation><value>Email address:</value>

</label><field sid="FIELD1">

<orientation>ltr</orientation><scrollhoriz>wordwrap</scrollhoriz>

<value></value></field>

Usage details1. Default: Based on the orientation of the immediate parent. If not set, or no

parent, Right-To-Left (rtl) for bidirectional locales, Left-To-Right (ltr) for otherlocales. If no locale specified, Left-To-Right (ltr).

2. Child items, such as cell, and help, can inherit the default value of their parent.3. The orientation option does not apply to data presented by secondary

functions invoked by the item. For example, data presented by theviewer.messageBox function, file name data presented in enclosure dialogs, filedialogs, and data presented in signing ceremonies.

182 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 189: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

paddingDefines the amount of whitespace around a pane item.

Defines the amount of white space around a pane item. This is useful whenputting a Pane around rows in a table, as it lets you minimize empty spacebetween rows. Use this option in conjunction to rowpadding.

Syntax

Table 62. paddingSpecification parameters

Parameter Type Description

number integer The number of pixels if whitespace around the Pane item.

Valid settings are 0 - 3 inclusive.Note: 3 pixels are required todraw a border around the Paneitem.

Available In

pane

Example

This is an example of pane using padding set to 0.<pane sid="PANE1">

<xforms:group><xforms:label></xforms:label>

</xforms:group><itemlocation>

<x>10</x><y>10</y>

</itemlocation><padding>0</padding>

</pane>

Usage Details1. The default value is 3.2. If the pane item has a label (XFDL or XForms generated) or a border then the

padding option is ignored and the default is used.3. 1 pixel is applied to the inside of the pane matching the backgroundColor of

the pane. 2 pixels beyond that are used as placeholders for the border when itis turned on and off. If there is no border than these 2 pixels are transparent.

4. Does not affect white space around items inside the Pane item. If you need toreduce the white space of items in a table, use the rowpadding option.

<padding>number</padding>

XFDL Version 7.7 183

Page 190: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pagefirstStores a reference to the global item on the first page of the form, excluding theglobal page. A page is first when it appears first in the build order (in otherwords, it is first in the XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 63. page first parameters

Parameter Type Description

page reference string A reference to the global option inthe first page of a form. this doesnot include the form’s globalpage.

Available in

page global

Example

This sample shows how the pagefirst option appears in the page globals of a form.<page sid="PAGE1">

<global sid="global"><pagefirst>PAGE1.global</pagefirst>

</global></page>

Usage details1. Defaults: none

2. The pagefirst option stores a reference to the global item of the first page. Forexample, PAGE1.global.

3. The pagefirst option is not saved or transmitted with the form description.

<pagefirst>page reference</pagefirst>

184 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 191: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pageidDefines a unique identifier for the page.

Syntax

Table 64. pageid parameter

Parameter Type Description

serial number string Provides a unique identifyingstring for the form. This isgenerated by an external programsuch as a form design program.

Available in

page global

Example

This sample shows how the pageid option appears in the page globals of a form.<pageid>

<serialnumber>{94EC2BA4-7D34-B5E4-0060-9947}</serialnumber></pageid>

Usage details1. Defaults: none

2. This option is intended for use with form design programs and licensingmodels.

<pageid><serialnumber>serial number</serialnumber>

</pageid>

XFDL Version 7.7 185

Page 192: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pagelastStores a reference to the global item in the last page of the form, excluding theglobal page.

A page is last when it appears last in the build order (in other words, it is last inthe XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 65. pagelast parameter

Parameter Type Description

page reference string A reference to the global option inthe last page of a form. this doesnot include the form’s globalpage.

Available in

page global

Example

This sample shows how the pagelast option appears in the page globals of a form.<page sid="PAGE1">

<global sid="global"><pagelast>PAGE4.global</pagelast>

</global></page>

Usage details1. Defaults: none

2. The pagelast option stores a reference to the global item of the last page. Forexample, PAGE4.global.

3. The pagelast option is not saved or transmitted with form descriptions.

pageloadingDetermines which pages are loaded into memory when a form is opened.Subsequent pages are loaded into memory as required. For example, when the usermoves to the next page in the form.

Using page loading can significantly decrease the amount of time it takes to open aform, particularly when dealing with large, complex forms. However, it mayslightly increase the amount of time required to switch to a new page.

<pagelast>page reference</pagelast>

186 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 193: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Syntax

Table 66. pageloading parameters

Parameter Type Description

setting enable Activates page loading, so thatonly the first page is loaded intomemory when the form is opened.Pages specified in autoload arealso loaded into memory.

Default: disable

disable Disables page loading, so that allform pages are loaded intomemory when the form is opened.

reference string Optional. A space-separated list ofpage identifiers that identifywhich pages should be loadedinto memory.

action string Optional. A space-separated list ofaction types that require all of theform pages to be loaded intomemory before performing. Thesupported action types are: submit,done, print, saveform, saveas, andsignature.

If you wish to perform any ofthese actions in the form, theyshould be contained in this list.

Available in

form global (globalpage)

Example

The following example enables page loading and specifies that PAGE1 andworkingPage should be loaded into memory when the form is opened. Thissample also requires all of the unused pages to be loaded into memory beforeactions of type submit and signature are performed.<globalpage sid="global">

<global sid="global"><pageloading>

<ondemand>enable</ondemand><autoload>PAGE1 workingPage</autoload><loadallbefore>submit signature</loadallbefore>

</pageloading>...</global>

</globalpage>

<pageloading><ondemand>setting</ondemand><autoload>reference</autoload><loadallbefore>action</loadallbefore>

</pageloading>

XFDL Version 7.7 187

Page 194: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. The global page is always attached.2. If a page is not loaded into memory, its computes, formats, and XForms item

construction (such as tables) are not available for use.3. XFDL references to content on an unloaded (or “detached”) page return static

content. Dynamic content or content changed by computes, are not returned.4. Controlled options such as pagenext and pageprevious are processed for

detached pages.5. Digital signatures and sids of all elements in both loaded (or “attached”) and

detached pages are available when the form is opened.6. Detached pages that need to be printed are automatically loaded before

printing.7. Form layout and overlap tests are only performed on attached pages.8. Form level operations, such as validity checking, only operate on attached

pages.9. When a new digital signature is created, pages with elements included in the

layoutinfo option are automatically loaded.

188 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 195: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pagenextStores a reference to the global item in the next page in the form, excluding theglobal page.

A page is next when it appears next in the build order (in other words, it is next inthe XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 67. pagenext parameters

Parameter Type Description

page reference string A reference to the global option inthe next page of a form. this doesnot include the form’s globalpage.

Available in

page global

Example

This example shows the pagenext option for PAGE2 of a form.<page sid="PAGE2">

<global sid="global.global"><pagenext>PAGE3.global</pagenext>

</global></page>

Usage details1. Defaults: none

2. The pagenext option stores a reference to the global item of the next page. Forexample, PAGE1 might contain the following reference: PAGE2.global.

3. If the pagenext option is on the last page of the form, it points to the first pageof the form (excluding the global page).

4. The pagenext option is not saved or transmitted with form descriptions.

<pagenext>page reference</pagenext>

XFDL Version 7.7 189

Page 196: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

pagepreviousStores a reference to the global item in the previous page in the form, excludingthe global page.

A page is previous when it immediately precedes the current page in the buildorder (in other words, it is immediately previous in the XFDL text).

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 68. pageprevious parameters

Parameter Type Description

page reference string A reference to the global option inthe previous page of a form. Thisdoes not include the form’s globalpage.

Available in

page global

Example

This example shows the pageprevious option for PAGE2 of a form.<page sid="PAGE2">

<global sid="global.global"><pageprevious>PAGE1.global</pageprevious>

</global></page>

Usage details1. Defaults: none

2. The pageprevious option stores a reference to the global item of the previouspage. For example, PAGE2 might contain the following reference:PAGE1.global.

3. If the pageprevious option is on the first page of the form (excluding the globalpage), it points to the last page of the form.

4. The pageprevious option is not saved or transmitted with form descriptions.

<pageprevious>page reference</pageprevious>

190 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 197: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

previousIdentifies the item to receive focus when a user tabs backwards from the currentitem by pressing Shift + Tab.

If the current item has a previous option, the item indicated in that option is nextin the reverse tab order. If the current item has no previous option, the previousitem in the build order that can receive the input focus is next in the reverse taborder.

Syntax

Table 69. previous parameters

Parameter Type Description

item reference string identifies the item to receive focusnext

Available in

button, check, checkgroup, combobox, field, list, pane, popup, radio, radiogroup,slider, table

Example

This sample points to the item date_field. When users tab back from the currentitem, the item identified as date_field will receive focus.<previous>date_field</previous>

Usage details1. The first page defined in the form is always the first page displayed. The

default tabbing order depends on the order in which page and item definitionsoccur within the form definition. The sequence is as follows:v First item to receive focus: first modifiable item defined for the body of the

first pagev Subsequent items to receive focus: each modifiable item on the page in the

reverse order in which they are defined2. When tabbing back past the first item on the page, the last modifiable item in

the page’s toolbar receives focus. If there is no toolbar, focus returns to the lastitem defined in the page.

<previous>item reference</previous>

XFDL Version 7.7 191

Page 198: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printbgcolorEnables the form to be printed with a specific background color on a color printer.

This color can be the same as or different from the background color shown on thescreen. On black and white printers, grayscaling is used.

See also: printlabelbgcolor, printfontcolor, printlabelfontcolor.

Syntax

Table 70. printbgcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

box, button, check, checkgroup, combobox, field, label, list, popup, radio,radiogroup, slider, page global, form global

Examples

These samples both set the printed background color to forest green.<printbgcolor>forest green</printbgcolor><printbgcolor>34,139,34</printbgcolor><printbgcolor>#228B22</printbgcolor>

Usage details1. Defaults behave as follows:v Form: white

v Page: the form global setting or default (white)v Item: when no printbgcolor is specified, the printbgcolor default is derived

from the item’s specified or default bgcolor (which may be further derivedfrom the page or form global bgcolor settings or defaults).

<printbgcolor>color</printbgcolor>

192 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 199: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printfontcolorEnables the item to be printed with a specific font color on a color printer.

This color can be the same as or different from the font color shown on the screen.On black and white printers, grayscaling is used.

Syntax

Table 71. printfontcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

button, check, combobox, field, label, line, list, popup, radio, slider, page global,form global

Examples

These samples both set the printed font color to forest green.<printfontcolor>forest green</printfontcolor><printfontcolor>34, 139, 34</printfontcolor><printfontcolor>#228B22</printfontcolor>

Usage details1. The default printfontcolor is derived from the fontcolor setting or default for

the item, except in the case of checks or radios, which default to black. (Thefontcolor default may be further derived from page or form settings ordefaults.)

2. For check items, the printfontcolor option describes what color the check in thecheck box will be when the form is printed. Likewise, for radio items, theprintfontcolor option describes what color the on dot will be when the form isprinted.

3. For line items, the printfontcolor option describes what color a line will bewhen the form is printed.

<printfontcolor>color</printfontcolor>

XFDL Version 7.7 193

Page 200: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printingIndicates whether the form is currently printing.

This value toggles from off to on just before printing. Any computes that rely onthis option are updated before the form prints. This allows you to make computedchanges to the form just before it is printed.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 72. printing parameters

Parameter Type Description

setting on The form is currently printing.

off The form is not printing.

Available in

form global

Example

This example shows a form that is currently printing:<globalpage sid="global">

<global sid="global"><printing>on</printing>

</global></globalpage>

Usage details1. The printing option is not saved or transmitted with the form description.

<printing>setting</printing>

194 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 201: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printlabelbgcolorEnables a item’s built-in label to be printed with a specific background color on acolor printer.

This color can be the same as or different from the background color shown on thescreen. On black and white printers, grayscaling is used.

Syntax

Table 73. printlabelbgcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

check, checkgroup, combobox, field, list, pane, radio, radiogroup, slider

Examples

These samples both set the printed label background color to forest green.<printlabelbgcolor>forest green</printlabelbgcolor><printlabelbgcolor>34,139,34</printlabelbgcolor><printlabelbgcolor>#228B22</printlabelbgcolor>

Usage details1. Default: the printlabelbgcolor default is derived from the item’s specified or

default labelbgcolor.

<printlabelbgcolor>color</printlabelbgcolor>

XFDL Version 7.7 195

Page 202: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printlabelfontcolorEnables an item’s built-in label to be printed with a specific font color on a colorprinter.

This color can be the same as or different from the font color shown on the screen.On black and white printers, grayscaling is used.

Syntax

Table 74. printlabelfontcolor parameters

Parameter Type Description

color special The color may be expressed inany of the following formats:

v Comma-separated RGB values.For example:

192,192,192

v Hexadecimal-based RGB values.For example:

#336699

v Color name. For example:

blue

Available in

check, checkgroup, combobox, field, list, pane, radio, radiogroup, slider

Examples

These samples both set the printed label font color to forest green.<printlabelfontcolor>forest green</printlabelfontcolor><printlabelfontcolor>34,139,34</printlabelfontcolor><printlabelfontcolor>#228B22</printlabelfontcolor>

Usage details1. Default: the printlabelfontcolor default is derived from the item’s specified or

default labelfontcolor.

<printlabelfontcolor>color</printlabelfontcolor>

196 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 203: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printsettingsDetermines the settings that will be used when the form is printed. The user canbe allowed to change these defaults, or the form can be set so that it will alwaysfollow the defaults.

Syntax

Table 75. printsettings parameters

Parameter Type Description

page list (see below) The list of pages that print.

dialog settings (see below) Determines whether the printdialog is shown, and whichsettings must be used whenprinting (for example, paperorientation and number of copies).

header/footer settings (see below)

border on Prints a border around formpages.

off Does not print a border aroundform pages.

signlinefieldsaslines on Prints a single line field as a line.

off Prints a single line field as arectangle.

scroll barsonfields on Prints scroll bars on fields.

off Removes scroll bars from fieldswhen printing.

radioswithoutvalues on Prints radio buttons without theselected value.

off Prints radio buttons with theselected value.

radiosaschecks on Prints radio buttons as checkboxes.

off Prints radio buttons as radiobuttons.

<printsettings><pages>page list</pages><dialog>dialog settings</dialog><header>header settings</header><footer>footer settings</footer><border>on|off</border><singlelinefieldsaslines>on|off</singlelinefieldsaslines><scroll barsonfields>on|off</scroll barsonfields><radioswithoutvalues>on|off</radioswithoutvalues><radiosaschecks>on|off</radiosaschecks><pagelayout>layout setting</pagelayout><outputformat>output file type</outputformat>

</printsettings>

Note: All settings are optional.

XFDL Version 7.7 197

Page 204: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 75. printsettings parameters (continued)

Parameter Type Description

layout setting string Controls whether the print job isscaled to fit a page, or tiled acrossmultiple pages. Valid settings are:

v fitToPage – Scales the form tofit on a single page, withoutmaintaining the aspect ratio.

v shrinkToPage – Scales the formto fit on a single page, andmaintains the aspect ratio of theform.

v tileOneDirection – Sizes thesmallest dimension (eitherwidth or length) to fit to asingle page, and tiles the otherdimension across multiplepages.

v tileTwoDirections – Does notresize the form, and tiles boththe width and the height acrossmultiple pages if necessary.

outputformat string Allow dynamic configuration ofprint output format. Possiblevalues are:

v png

v gif

v

v pdf

v pdfa

v plugin/png

v plugin/gif

If the setting is invalid or missing,the default behavior is determinedby the Webform Server translatorproperties file or the Viewer.

Available in

action, button, cell, page global, form global

page list

The page list uses the following syntax:<pages>

<filter>keep|omit</filter><pageref>page sid1</pageref>...<pageref>page sidn</pageref>

</pages>

198 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 205: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The settings for the page list work as follows:

Table 76. page list settings

Setting Description

filter Whether to omit or keep the pages listed. Using keep will print allpages listed, and exclude all other pages in the form. Using omit willprint all pages in the form except those listed.

pageref A list of page sids that indicates which pages to keep or omit.

dialog settings

The dialog settings use the following syntax:

The settings work as follows:

Table 77. dialog settings

Setting Description

active When on, the print dialog will be displayed before the form is printed,allowing the user to change the settings. When off, the dialog will notbe shown and the form will be printed immediately.

copies A positive integer that determines the number of copies that will beprinted; defaults to 1.

orientation Determines whether the form will be printed in landscape or portraitorientation.

printpage settings (see below)

Print page settings

The print page settings use the following syntax:

The settings work as follows:

Table 78. print page settings

Setting Description

active When on, the print dialog will allow the user to choose betweenprinting “All” pages or the “Current® Page”; defaults to on.

choice All sets the printpages default to “All”; current sets the printpagesdefault to “Current Page”; defaults to all.

<dialog><active>on/off</active><copies>#</copies><orientation>portrait|landscape</orientation><printpages>print page settings</printpages>

</dialog>

<printpages><active>on|off</active><choice>all|current</choice>

</printpages>

XFDL Version 7.7 199

Page 206: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Header/Footer settings

The header and footer settings use the following syntax:

The settings work as follows:

Table 79. header/footer settings

Setting Description

left text This text is left justified in the header/footer.

center text This text is centered in the header/footer.

right text This text is right justified in the header/footer.

Each header and footer can be one or more lines in height. However, they can beno larger than 1/3 of the page size.

Each section (that is, left, center, or right) can contain different text. For example,you might put a date in the left section, a title in the middle section, and adocument number in the right section.

If you place a long string of text in a header or footer, it will overlap the othersections of that header or footer. For example, suppose you put the following textin the left section of your header:

This form is for demonstration purposes only. Do not distribute.

This text would start at the left edge of the form, but would continue to overlapthe middle portion of the header. Futhermore, a longer string would also overlapthe right portion of the header.

Any hard returns placed in a string are respected. For example, you could avoidoverlapping the other sections of the header by using the same string with hardreturns, as shown:

This form is fordemonstration purposesonly. Do not distribute.

If a string is wider than the form, it is truncated appropriately. For example, astring that starts on the left edge of the form is truncated once it reaches the rightedge of the form, and vice versa. If a string starts in the middle of the form, it istruncated on both the left and right edges.

<header><left>left text</left><center>center text</center><right>right text</right>

</header><footer>

<left>left text</left><center>center text</center><right>right text</right>

</footer>

200 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 207: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

This sample prevents “page2” from being printed, sets the form to print inlandscape orientation, strips the scroll bars from all fields, and prints two copies ofthe form:

<printsettings><pages>

<filter>omit</filter><pageref>page2</pageref>

</pages><dialog>

<active>on</active><orientation>landscape</orientation><copies>2</copies>

</dialog><scroll barsonfields>off</scroll barsonfields>

</printsettings>

Usage details1. Defaults:v Page List – The page list will default to keeping all pages in the form.v Dialog Settings – The dialog will default to being on, and will print one

copy of all pages in the form in a portrait orientation. By default, the userwill be able to change all of these settings.

v border – off.v singlelinefieldsaslines, scroll barsonfields, radioswithoutvalues,

radiosaschecks, pagelayout – The equivalent setting in the form renderingsoftware.

2. Those settings that inherit their default value from the form rendering softwarewill override the form rendering software if they are set differently.

3. Print settings set on a specific page override the global printsettings. Forexample, if you set the number of copies globally, then set the orientation forpage two, page two will not inherit the copies setting. If you want to add pagespecific settings to your form, you must repeat the form’s global settings in thesettings for that page.

XFDL Version 7.7 201

Page 208: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

printvisibleDetermines whether an item is visible when the form is printed. To set whether theitem is visible in the Viewer, use the visible option.

Syntax

Table 80. printvisible parameter

Parameter Type Description

setting on The item is visible when the formis printed.

off The item is not visible when theform is printed.

Available in

box, button, check, checkgroup, combobox, field, label, line, list, popup, radio,radiogroup, slider

Examples

In this example, the nameField does not print due to the printvisible setting, butthe addressField does because it defaults to the visible setting, which defaults toon.

<field sid="nameField"><value>John Doe</value><printvisible>off</printvisible>

</field><field sid="addressField">

<value>123 Home Street</value></field>

Usage details1. Default: defaults to the visible option for the item.2. This option overrides the visible option for the purposes of printing.

<printvisible>setting</printvisible>

202 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 209: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

publicdataIdentifies specified XForms elements as “public”. Marking an element publicensures that you can map the element to a workflow task in a contentmanagement system.

Syntax

Table 81. publicdata parameters

Parameter Type Description

id string optional. The id of the XFormsmodel that contains the elementthat you want to make public. Youdo not need to include thisparameter unless you havemultiple models in your form.

reference XPath reference The XPath reference to theelement that you want to makepublic. For example:

instance('employee_info')/last_name

name string optional. The name for thereference. The name element is asingle line xsd:string; it cannotcontain multiple lines.

type schema optional. The type of element. Thetype element is used by theMashup designer to correctly wirethe data to consumers of the data.The type element is a valid W3CSchema Type. Two types aresupported:

v xsd:anySimpleType – Indicatesa leaf node.

v xsd:anyType – Indicates anon-leaf node.

<publicdata><dataref>

<model>id</model><ref>reference</ref>

<name>name</name><type>type</type>

</dataref>...<dataref>

<model>id</model><ref>reference</ref>

<name>name</name><type>type</type>

</dataref></publicdata>

XFDL Version 7.7 203

Page 210: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Available in

form global

Example

The following example makes two elements public: the “data1” element in the“Request” model and the “output2” element in the “Response” model.

<publicdata><dataref>

<model>Request</model><ref>instance('data')/data1</ref>

</dataref><dataref>

<model>Response</model><ref>instance('output')/output2</ref>

</dataref></publicdata>

Usage details1. Default: none.2. The publicdata option identifies child elements only. Elements that contain

other elements cannot be referenced.3. The publicdata option supports child elements inside of tables.4. The publicdata option may contain multiple dataref elements.5. The model element is optional.6. If you are referencing an element in the default instance, the instance() XPath

function does not need to be included in the reference.

204 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 211: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

readonlySets the item to be readonly, so that user’s can read information in the item butcannot change that information.

Syntax

Table 82. readonly parameter

Parameter Type Description

setting on the item is readonly.

off the item accepts input.

Available in

check, checkgroup, combobox, field, list, popup, radio, radiogroup, slider

Example

The following example shows a field that is set to be readonly:<field sid="readOnlyField">

<value>You cannot type into this field.</value><readonly>on</readonly>

</field>

Usage details1. Default:v XFDL: off.v XForms: defaults to the readonly property for the data element to which the

containing item is bound.2. If an item has either the readonly option or the XForms readonly property set,

then the item is readonly. For more information about the readonly property,refer to “Property Settings” on page 308.

3. The readonly setting permits users to scroll an item even though they cannotupdate the item’s contents.

<readonly>setting</readonly>

XFDL Version 7.7 205

Page 212: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

requirementsSpecifies one or more requirements that must be satisfied before the form willfunction properly.

For example, a form may require a Java™ Virtual Machine to run correctly.

You can use the requirements feature to check for the availability of a particularclass, function call, or Java Virtual Machine. If the requirement is not met, you candisplay a message and then either continue or fail.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 83. requirements parameters

Parameter Type Description

requirement settings (see below)

status on All requirements were detectedsuccessfully. This is a controlledoption that is not written out withthe form.

off One or more requirements werenot detected successfully. This isthe default value.

Available in

form global

Requirement Settings

The requirement settings use the following syntax:

<requirements><requirement>requirement settings1</requirement>

...<requirement>requirement settingsn</requirement><detected>status</detected>

</requirements>

<requirement><component>component setting</component><detected>on|off</detected><actions>

actions</actions>

</requirement>

206 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 213: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The settings work as follows:

Table 84. requirements settings

Setting Description

component Identifies the type of requirement. This can be a class, a function call, or aJava virtual machine (see below).

detected When on, the component for this requirement was successfully detected.When off, the component for this requirement was not successfullydetected. The default is off.

actions optional. Specifies the action to perform if the component is notavailable. (see below).

optional. Contains a message that is displayed when the component is notsuccessfully detected. If this option is not set, then no message isdisplayed to the user.

Class component

When you list a class as a requirement, that class must be available for therequirement to be fulfilled. The class component uses the following syntax:

The settings work as follows:

Table 85. class component setting

Setting Description

class name The name of the class. For example:

com.PureEdge.WebServices

version number optional. The minimum version of the instance that must be registered.For example, 1.0.0.

Class instance component

When you list a class instance as a requirement, that class instance must beavailable for the requirement to be fulfilled. The class instance component uses thefollowing syntax:

<component><class>

<name>class name</name><minversion>version number</minversion>

</class></component>

XFDL Version 7.7 207

Page 214: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The settings work as follows:

Table 86. class instance component settings

Setting Description

class instancename

The name of the class instance. For example:

com.PureEdge.WebServices

version number optional. The minimum version of the instance that must be registered.For example, 1.0.0.

value A string that was used to register the class. For example, the Sun JVM(com.pureedge.java.JavaInvocationEngineFactory class) is registered withthe following string: ″Sun VM 1.4″

You may include any number of strings, and all strings must match forthe requirement to be met.

Function call component

When you list a function call as a requirement, that function call must exist as anXFDL function for the requirement to be fulfilled. The function call can be madeavailable through an extension or a WSDL. The function call component uses thefollowing syntax:

The settings work as follows:

Table 87. function call component setting

Setting Description

name The name of the function call. This is the name of the function that mustbe registered and it must include the package name.

Java VM component

When you list a Java Virtual Machine as a requirement, the correct version of theJava VM must be available on the local computer. The Java VM component usesthe following syntax:

<component><class>

<name>class instance name</name><minversion>version number</minversion<criteria>

<value>value1</value>...<value>valuen</value>

</criteria></class>

</component>

<component><functioncall>

<name>name</name></functioncall>

</component>

208 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 215: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The settings work as follows:

Table 88. Java VM component setting

Setting Description

minimumversion

optional. The minimum acceptable version of the Java VM. For example,1.2.

You must list either a minimum version or a maximum version. You mayalso list both.

maximumversion

optional. The maximum acceptable version of the Java VM. For example,1.4.

You must list either a minimum version or a maximum version. You mayalso list both.

Example

The following example sets up the following requirements for a form: (1) a JavaVirtual Machine version 1.4.0 or greater must be available, and (2) the WebServices class must be available.

<requirements><requirement>

<component><javavm>

<minversion>1.4.0</minversion></javavm>

</component><actions>

<message>Your computer does not have the required JavaVirtual Machine installed. Because of this, the WebServices functions will not execute properly. Tocorrect this, you must install the Sun Java VM version1.4 or higher.</message>

</actions></requirement><requirement>

<component><class>

<name>com.PureEdge.WebServices</name><minversion>1.0.0</minversion>

</class></component><actions>

<message>The Web Services system is not available on yourcomputer. Please contact your System Administrator forassistance.</message>

</actions></requirement>

</requirements>

<component><javavm>

<minversion>minimum version</minversion><maxversion>maximum version</maxversion>

</javavm></component>

XFDL Version 7.7 209

Page 216: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. The detected option is not written out with the form description that is saved

or transmitted.2. The default for the detected option is off.

210 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 217: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

rowpaddingDefines the space between each table row.

Syntax

Table 89. rowpaddingSpecification parameter

Parameter Type Description

number integer The number of pixels to move therows closer or further apart. Anegative number shifts the rowsupward. A positive number shiftsthe rows downward. The defaultvalue is 1. Valid values areintegers (all positive numbers, 0,-1, -2). See the table below formore information.

Table 90. list of results of setting values for items with or without border set to on

Settings With border Without Border

-2 n/a 2 pixels

-1 n/a 4 pixels

0 0 pixels 6 pixels

1 2 pixels 8 pixels

2 4 pixels 10 pixels

+n +(n * 2 pixels) +(n * 2 pixels)

Note: If bgcolor is applied to items without their border displayed, 2 pixels of theabove results will be shaded.

Available in

table

Example

This is an example of a compact table.<table sid="TABLE1_TABLE">

<xforms:repeat id="TABLE1" nodeset="instance('INSTANCE')/table1/row"><pane sid="ROW_GROUP"><xforms:group ref=".">

... ITEMS ...</xforms:group></pane>

</xforms:repeat><rowpadding>-2</rowpadding>

</table>

Usage details1. The default value is 1.

<rowpadding>number</rowpadding>

XFDL Version 7.7 211

Page 218: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. When a row is made smaller by this option, the items in the row are notclipped.

212 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 219: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

rtfStores the rich text value for rich text fields.

Syntax

Table 91. rtf parameter

Parameter Type Description

rich text string The rich text string.

Available in

field

Example

This sample shows a rich text field:<field sid="richTextField">

<texttype>text/rtf</texttype><value>Hello</value><rtf>rich text version of Hello</rtf>

</field>

Usage details1. Default: if the rtf option is empty or does not exist, a default rich text string is

created as follows:v Text: set to equal the value option.v Font: set as the fontinfo and fontcolor options.v Justification: set as the justify option.

If the required options are not present, then the default settings for thoseoptions are used. Note that the background color is controlled by the bgcoloroption, not the rich text.

2. To use rich text in a field, the texttype option must be set to text/rtf.3. A plain text version of the rich text string is stored in the value option, with

the following considerations:v If the value option has a compute, that compute is lost when the text is

copied from the rtf option. (However, external changes to the value are stillmade. For example, a set.)

v Once the text is copied to the value option, the format system may impose achange based on the format option. If a change occurs, then the rtf option isreset based on the formatted value option and the fontinfo, fontcolor,justify, and bgcolor options.

v If the plain text version does not match the rich text, then the rich text takesprecedence. In this case, the value option is updated to reflect the rich text.

4. Computed changes to the fontinfo, fontcolor, bgcolor, justify, texttype, orvalue options will cause the rtf option to update if necessary.

5. Changes to the rtf option do not cause changes to the fontinfo, fontcolor,bgcolor, or justify options.

6. Dynamically changing the texttype from rtf to plain text is not supported.

<rtf>rich text</rtf>

XFDL Version 7.7 213

Page 220: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

7. When using XForms, the rtf option is bound to the data model (as opposed tothe value option).

214 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 221: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

saveformatSpecifies the format a form will be saved in. An XFDL form may be saved as XFDLcompressed or uncompressed formats.

The format works as follows:v XFDL format saves the entire form definition, including the user input.

Syntax

Table 92. saveformat parameter

Parameter Type Description

MIME type application/vnd.xfdl use XFDL format

application/vnd.xfdl;content-encoding=″base64-gzip″

use compressed XFDL format

Available in

action, button, cell, page global, form global

Examples

This example shows how to use saveformat in a save button:<button sid="save_button">

<type>saveas</type><saveformat>application/application/vnd.xfdl</saveformat>

</button>

When a user clicks this button, the form will be converted to XFDL format andsaved to the user’s drive.

XFDL format in form globals

This example shows how to use saveformat as a form global characteristic.<?xml version="1.0"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns:xforms="http://www.w3.org/2002/xforms"><globalpage sid="global">

<global sid="global"><bgcolor>ivory</bgcolor><saveformat>application/vnd.xfdl</saveformat>

</global></globalpage><page sid="page_1">

...

Any time a user saves this form, it will be saved in XFDL format.

Usage details1. Default: The default format is the format that the form was in before it was

parsed. For example, a form written in XFDL will be transmitted in XFDL,unless otherwise specified by this option.

<saveformat>MIME type</saveformat>

XFDL Version 7.7 215

Page 222: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. This option can also be included as a form global option and in the definitionsof items that trigger save actions. These are button or cell items that have atype option setting of save.

216 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 223: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

scrollhorizDefines horizontal scrolling options for a field item.

Syntax

Table 93. scrollhoriz parameter

Parameter Type Description

option never permit scrolling using the cursorbut display no horizontal scrollbar

always permit scrolling and display ahorizontal scroll bar

wordwrap wrap field contents from line toline, inhibit scrolling and displayno horizontal scroll bar

Available in

field

Example

This sample sets the horizontal scrolling option to permit scrolling and to displaythe horizontal scroll bar.

<scrollhoriz>always</scrollhoriz>

Usage details1. Default: never

2. The scroll bar displays along the field’s bottom edge.

<scrollhoriz>option</scrollhoriz>

XFDL Version 7.7 217

Page 224: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

scrollvertDefines vertical scrolling options for a field item.

Syntax

Table 94. scrollvert parameter

Parameter Type Description

option never permit scrolling using the cursorbut display no vertical scroll bar

always permit scrolling and display avertical scroll bar

fixed inhibit scrolling and display novertical scroll bars

Available in

field

Example

This sample sets the vertical scrolling option to inhibit all scrolling.<scrollvert>fixed</scrollvert>

Usage details1. Default: never

2. The scroll bar displays along the field’s right edge.

<scrollvert>option</scrollvert>

218 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 225: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signatureUsed in conjunction with the button item to establish the XFDL item name bywhich a particular signature will be identified.

Syntax

Table 95. signature parameter

Parameter Type Description

name of signature string the name of the signature

Available in

button, signature

Example

This sample identifies the signature item for a particular button as “mysig”.<signature>mysig</signature>

Usage details1. Default: none

2. The signature option must be included in each signature button that is set up.

<signature>name of signature</signature>

XFDL Version 7.7 219

Page 226: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signatureimagePoints to a data item, identifying it as the data item into which the capturedsignature image is placed. Used only with image-based digital signatures (such asCIC InkTools).

Syntax

Table 96. signatureimage parameter

Parameter Type Description

data item string the itemref for the data item thatcontains an image associated witha signature

Available in

button

Example

This sample identifies the data item “SIGIMAGE”. When the user signs a formwith a pen/pad device, the mimedata of the captured image is placed in the dataitem “SIGIMAGE”.

<signatureimage>SIGIMAGE</signatureimage>

Usage details1. Default: none

2. This option is used with signature types that utilize a digital image, such asInkTools signatures.

<signatureimage>data item</signatureimage>

220 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 227: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signdatagroupsSpecifies which datagroups are filtered for a particular signature.

Filtering a datagroup means keeping or omitting all of the data items that are inthe specified datagroup.

For example, if a signdatagroups option specifies that the ″attachments″ datagroupshould be kept, then all data items within the ″attachments″ group will be signed.

This filter applies to all data items present at the time of signing, including thoseadded as enclosures.

Syntax

Table 97. signdatagroups parameters

Parameter Type Description

datagroup filter keep include datagroups in thedatagroup reference list with thesignature; omit those not in thelist

omit omit datagroups in the datagroupreference list from the signature;include those not in the list

datagroup reference string identifies a datagroup whose dataitems will be filtered

Available in

button, signature

Example

This example specifies a signdatagroups option that keeps the datagroup called“Business_Letters”.

<signdatagoups><filter>keep</filter><datagroupref>Business_Letters</datagroupref>

</signdatagroups>

Usage details1. Default: omit nothing (keep all data items), unless the containing page is

omitted

<signdatagroups><filter>datagroup filter</filter><datagroupref>datagroup reference1</datagroupref>

...<datagroupref>datagroup referencen</datagroupref>

</signdatagroups>

Note: There may be any number of datagroup reference entries.

XFDL Version 7.7 221

Page 228: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. Since enclosed files can belong to several datagroups, and datagroups cancontain several enclosed files, care must be exercised when setting upsigndatagroups options to ensure that only the desired datagroups are filtered.

3. Other filters may take precedence over the signdatagroups option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

222 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 229: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signdetailsSpecifies which certificate attributes are shown to users when they are choosing acertificate to sign the form, and defines the filters used to select the availablecertificates when the user is signing a form.

For example, the signdetails option could specify that only those certificates with acommon name that begins with ″Bob″ are shown, and that only the owner’scommon name and email address are shown.

Syntax

Table 98. signdetails parameters

Expression Setting Description

dialogcolumns (see below) a list of certificate attributes thatshould be shown to the user whenthey are selecting a certificate tosign

filteridentity (see below) a list of certificate attributes andvalues that are used to filterwhich certificates are available tothe user for signing

dialogcolumns

The dialogcolumns element uses the following syntax:

Each certificate attribute listed is shown to the user when they view the certificatesavailable for signing. For example, if you want the user to see the owner’scommon name and email address for each certificate, you would use the followingsetting:

<dialogcolumns><property>Subject: CN</property><property>Subject: E</property>

</dialogcolumns>

<signdetails>dialogcolumnsfilteridentity

</signdetails>

Note:

v Both dialogcolumns and filteridentity are optional.

<dialogcolumns><property>attribute1</property>

...<property>attributen</property>

</dialogcolumns>

Note:

v The number of attributes is optional.

XFDL Version 7.7 223

Page 230: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

For a list of available attributes, see “Certificate Attributes” below.

filteridentity

The filteridentity element uses the following syntax:

Table 99. filter identity parameters

Parameter Type Description

attribute string The name of the attribute youwant to user to filter the availablecertificates.

value string The value to which you want tocompare the attribute. Use anasterisk (*) as a wildcard ormultiple characters, or a questionmark (?) as a wildcard for a singlecharacter.

If the value of the attribute matches the filter, then the certificate will be availableto the user. For example, to restrict the available certificates to those with acommon name beginning with ″Bob″, you would use the following filter:

<filteridentity><filter>

<tag>Subject: CN</tag><value>Bob*</value>

</filter></filteridentity>

For a list of available attributes, see ″Certificate Attributes″ below.

Available in

button, signature

Example

This example specifies a signdetails option that makes those certificates with anemail address in the IBM domain available, and shows the serial number and theowner’s common name for each certificate.

<signdetails><dialogcolumns>

<property>Serial</property>

<filteridentity><filter>

<tag>attribute1</tag><value>value1</value>

</filter>...<filter>

<tag>attributen</tag><value>valuen</value>

</filter></filteridentity>

Note: The number of attributes and filters is optional.

224 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 231: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<property>Subject: CN</property></dialogcolumns><filteridentity>

<filter><tag>Subject: E</tag><value>*@ibm.com</value>

</filter></filteridentity>

</signdetails>

Usage details1. Default: all certificates are available, and the certificate’s common name and

expiry date are shown to the user.

Certificate attributes

The following is a list of attributes that are common to X.509 certificates.

Note: The names of certificate attributes are case sensitive.

Table 100. certificate attributes

Attribute Description

Version the version of the X.509 specification that the certificate follows

Serial the certificate’s serial number

signatureAlg the algorithm used by the Certificate Authority to sign the certificate

BeginDate the date at which the certificate became valid

EndDate the certificate’s expiry date

PublicKey the certificate’s public key

FriendlyName the certificate’s friendly name

Subject: CN the certificate owner’s common name

Subject: E the certificate owner’s email address

Subject: T the certificate owner’s title

Subject: L the certificate owner’s locality

Subject: ST the certificate owner’s state of residence

Subject: O the organization to which the certificate owner belongs

Subject: OU the name of the organizational unit to which the certificate owner belongs

Subject: C the certificate owner’s country of residence

Subject: STREET the certificate owner’s street address

Subject: ALL the certificate owner’s complete distinguished name

Issuer: CN the certificate issuer’s common name

Issuer: E the certificate issuer’s email address

Issuer: T the certificate issuer’s title

Issuer: L the certificate issuer’s locality

Issuer: ST the certificate issuer’s state of residence

Issuer: O the organization to which the certificate issuer belongs

Issuer: OU the organizational unit to which the certificate issuer belongs

Issuer: C the certificate issuer’s country of residence

Issuer: STREET the certificate issuer’s street address

XFDL Version 7.7 225

Page 232: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 100. certificate attributes (continued)

Attribute Description

Issuer: ALL the certificate issuer’s complete distinguished name

226 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 233: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signerIdentifies who signed a particular form.

Syntax

Table 101. signer parameter

Parameter Type Description

Identity of user string identity of user

Available in

button, signature

Example

In this example, signer is similar to a user’s email signature, clearly identifyingwho signed the form.

<signer>John Smith, [email protected]</signer>

Usage details1. The setting of the signer option varies, depending on the signing engine used:

Table 102. signature engine parameters for the signer option

signing Engine signer Setting

Generic RSA common name, email

CryptoAPI common name, email

Netscape common name, email

Entrust signer’s login identity

CIC signer’s name as entered during signing ceremony

Clickwrap ACCEPTED

HMAC Clickwrap the value of the answer indicated by the HMACsigner tag in thesignformat option

Note that if the HMACsigner tag includes more than oneanswer, they are combined in a comma delimited list. Forexample, ″answer1, answer2″.

2. The signer option is automatically generated by the signature button when theuser signs the form. It is added to both the signature button code and thesignature code. No manual coding is required.

<signer>identity of user</signer>

XFDL Version 7.7 227

Page 234: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signformat

Records the type of encoding that a form viewing program must use to create themimedata setting in a signature. Specifically, the parameters in signformat specify:v The MIME type of the data from which the mimedata setting is created (see

below for an explanation).v The signature engine to use.v Settings specific to the engine used.

About the mimedata setting:

To create the mimedata setting, a form viewer takes the signer’s certificate and aplaintext representation of the form or portion of the form that the signatureapplies to, and encodes them according to the settings in signformat. For details,see the mimedata option.

Syntax

Table 103. signformat properties

Parameter Type Description

MIMEtype string the MIME type of the signed data.May be:

v XFDL – application/vnd.xfdl

signature engine string the type of signature. Valid typesare:

v ClickWrap

v CryptoAPI

v Entrust

v Generic RSA (includesCryptoAPI and Netscape)

v HMAC-ClickWrap

v Netscape

v signaturePad

v Silanis

Default: Generic RSA

<signformat>MIME type;engine="signature engine";verifier;cval;delete;parameterslayoutoverlaptest

</signformat>

228 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 235: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 103. signformat properties (continued)

Parameter Type Description

verifier string an optional flag that indicateswhich verifier should be usedwhen verifying certificate chainsduring digital signatureoperations. Valid verifiers are:

v Basic – Performs basiccertificate verification.

v DODJ12 – Performs strictcertificate verification thatcomplies with US Departmentof Defense requirements.

Default: Basic

cval string an optional flag that indicateswhether the current value ofcomputed options is signed. Thisis useful if you want to sign thecompute, but not the valuecalculated by the compute (forexample, if you are signing thepresentation layer of a form).

If you want to sign the currentvalues, do not use this flag. If youdo not want to sign the currentvalues, use:

cval="off"

Default: current values are signed.

delete string an optional flag that indicateswhether the signature can bedeleted by the user. By default, allsignatures can be deleted. If youwant to prevent a signature frombeing deleted, use:

delete="off"

parameters depends on engine additional parameters required bythe signature engine (see below)

XFDL Version 7.7 229

Page 236: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 103. signformat properties (continued)

Parameter Type Description

layoutoverlaptest string an optional flag that can be set toperform the layout and overlaptest. Values can be:

v required – The layout andoverlap test must be performedfor any signature type and mustbe verified. If the signature typedoes not support the layout andoverlap test an error message ispresented to the user.

v optional – The layout andoverlap test must be performedif available, and must beverified if possible.

v none – The layout and overlaptest is not performed.

The default value is optional forall signature engines exceptClickWrap. The ClickWrap defaultis none.

Available In

button, signature

About the signature Engines

The following table describes the signature engines that are available:

Table 104. available signature engines

signature Engine Description

ClickWrap The ClickWrap signature allows users to sign a form withoutrequiring a digital certificate. Instead, signers may have to answersome questions about themselves and echo some text to indicatetheir intent to agree to the document.

CryptoAPI The CryptoAPI signature uses digital certificates that are stored inyour Internet Explorer certificate store to create a digital signature.

Entrust The Entrust signature allows the end-user to sign the form usingthe Entrust brand of products.

Generic RSA The Generic RSA signature uses digital certificates from either yourInternet Explorer or your Netscape certificate store.

HMAC-ClickWrap The HMAC-ClickWrap signature is similar to the ClickWrapsignature, in that the end-user does not require a digital certificateto create a signature. Instead, the end-user provides a shared secret(such as a password) that can be verified by a server. Once thesignature is verified, the server then uses its own digital certificateto sign the form and validate the end-user’s non-digital signature.

Netscape The Netscape signature uses digital certificates that are stored inyour Netscape certificate store to create a digital signature.

230 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 237: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 104. available signature engines (continued)

signature Engine Description

signaturePad The signaturePad signature allows the end-user to sign the formusing a variety of pad-style hardware. This signature type includessupport for signature pads from Interlink and Topaz, as well aspads that support the WinTab standard.

Silanis A Silanis signature allows the end-user to sign the form using theSilanis brand of products. It is also the only signature type that cancreate non-locking signatures, in which the data that is signed isnot locked to prevent changes.

Additional Parameters for Common signature Engines

The following table details the additional parameters you must use for eachsignature type when defining the signformat option. Note that the Generic RSAsignature does not require any additional parameters.

Table 105. additional parameters for signature engines

Engine Parameter Valid Settings Description

Clickwrap,HMAC-Clickwrap

hashalg sha1 hash algorithm with 160-bitmessage digest. This is the defaultsetting.

md5 hash algorithm with 128-bitmessage digest

titleText String text to display for the main title ofthe signature dialog box

mainPrompt String text to display for the main prompt

mainText String text to display for the main text

question1Text String label for the first question

answer1Text String default answer to the first question;user can overwrite

question2Text String label for the second question

answer2Text String default answer to the secondquestion; user can overwrite

question3Text String label for the third question

answer3Text String default answer to the thirdquestion; user can overwrite

question4Text String label for the forth question

answer4Text String default answer to the forthquestion; user can overwrite

question5Text String label for the fifth question

answer5Text String default answer to the fifth question;user can overwrite

echoPrompt String text to display for the echo prompt

echoText String text the user enters. For example,the actual echo text typed by theuser

buttonPrompt String text to display above the accept andreject buttons

XFDL Version 7.7 231

Page 238: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 105. additional parameters for signature engines (continued)

Engine Parameter Valid Settings Description

acceptText String text to display on the accept button

rejectText String text to display on the reject button

HMACsigner String a comma delimited list of theanswers that store the signer’sidentity. This is written as answern.For example, answer1, answer2, andso on. Note that this parameterapplies only to HMAC-Clickwrapsignatures

HMACSecret String a comma delimited list of theanswers that store the shared secret.This is written as answern. Forexample, answer1, answer2, and soon. Note that this parameter appliesonly to HMAC-Clickwrapsignatures

readonly String a comma delimited list of theanswers that should be read-only.This is written as answern. Forexample, answer1, answer2, and soon. Note that this parameter appliesonly to HMAC-Clickwrapsignatures

CryptoAPI csp determined by formviewing program

Cryptographic Service Provider (ieMicrosoft® Base CryptographicProvider v1.0)

csptype rsa_full full RSA implementation (this is thedefault)

rsa_sig for a CSP that supplies only RSAsignature algorithms

dss for a CSP that supplies algorithmscompliant with the Digital signatureStandard

dss_dh for a CSP that supplies DSScompliant algorithms andDiffie-Hellman encryption

fortezza for a CSP that supplies Fortezzaalgorithms

Note: Instead of using one of the above settings forcsptype, the numeric value that is defined for it in thecryptographic API may be used. For example,csptype=dss and csptype=3 produce the same result.

hashalg sha1 hash algorithm with 160-bitmessage digest. This is the defaultsetting.

md5 hash algorithm with 128-bitmessage digest

Entrust hashalg sha1 hash algorithm with 160-bitmessage digest. This is the defaultsetting.

232 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 239: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 105. additional parameters for signature engines (continued)

Engine Parameter Valid Settings Description

md5 hash algorithm with 128-bitmessage digest

Netscape hashalg sha1 hash algorithm with 160-bitmessage digest. This is the defaultsetting.

md5 hash algorithm with 128-bitmessage digest

signaturePad TSP String defines the preferred signature padsoftware/hardware to use. Validsettings are:

v Interlink

v Topaz

v WinTab

If no setting is specified, the formviewing software will determinewhich hardware is available, andwill default to either Interlink orTopaz first and WinTab second.

hashalg sha1 hash algorithm with 160-bitmessage digest. This is the defaultsetting.

md5 hash algorithm with 128-bitmessage digest

titleText String text to display for the main title ofthe signature dialog box

mainPrompt String text to display for the main prompt

mainText String text to display for the main text

question1Text String label for the first question

answer1Text String default answer to the first question;user can overwrite

question2Text String label for the second question

answer2Text String default answer to the secondquestion; user can overwrite

question3Text String label for the third question

answer3Text String default answer to the thirdquestion; user can overwrite

question4Text String label for the forth question

answer4Text String default answer to the forthquestion; user can overwrite

question5Text String label for the fifth question

answer5Text String default answer to the fifth question;user can overwrite

echoPrompt String text to display for the echo prompt

echoText String text to display for the signer to echo

buttonPrompt String text to display above the accept andreject buttons

XFDL Version 7.7 233

Page 240: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 105. additional parameters for signature engines (continued)

Engine Parameter Valid Settings Description

acceptText String text to display on the accept button

rejectText String text to display on the reject button

readonly String a comma delimited list of theanswers that should be read-only.This is written as answern. Forexample, answer1, answer2, and soon.

startText String text to display on the button thatstarts the signature capture

endText String text to display on the button thatends the signature capture

penColor String the color to use when drawing thesignature on the screen. This iseither a color name or a commaseparated list of RGB values.

backgroundColor String the color to use for the backgroundof the signature graphic. This iseither a color name or a commaseparated list of RGB values.

Silanis lock on sets the signature to lock all signeddata. This prevents the user fromchanging data once it has beensigned. By default, all signaturetypes lock the data.

off prevents the signature from lockingthe data. This means users will beable to change signed data. Notethat changes to signed data will stillbreak the signature.

Example

This example shows a button configured for a CryptoAPI signature.<button sid="empSigButton">

<type>signature</type><value compute="signer"></value><signer></signer><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><signformat> application/vnd.xfdl;

csp="Microsoft Base Cryptographic Provider v1.0";csptype=rsa_full; hashalg=sha1

</signformat><signoptions>

<filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions><signitemrefs>

<filter>omit</filter><itemref>PAGE1.mgrSigButton</itemref>

234 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 241: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<itemref>PAGE1.admSigButton</itemref><itemref>PAGE1.empsignature</itemref><itemref>PAGE1.mgrsignature</itemref><itemref>PAGE1.admsignature</itemref>

</signitemrefs><!-- The items listed above MUST have itemlocationoptions with absolute and extent as the lastsettings in order for the filter below tobe sufficient in terms of security -->

<signoptionrefs><filter>keep</filter><optionref>PAGE1.mgrSigButton.itemlocation</optionref><optionref>PAGE1.admSigButton.itemlocation</optionref><optionref>PAGE1.empsignature.itemlocation</optionref><optionref>PAGE1.mgrsignature.itemlocation</optionref><optionref>PAGE1.admsignature.itemlocation</optionref>

</signoptionrefs><signature>empsignature</signature>

</button>

This example shows a button configured for a Clickwrap signature.<button sid="empSigButton">

<type>signature</type><value compute="signer"></value><signer></signer><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><signformat>application/vnd.xfdl;

engine="ClickWrap"; hashalg="md5";titleText="Document Acceptance";echoPrompt="Type the following:";echoText="I agree";question1Text="Name:";question2Text="Employee ID #:"

</signformat><signoptions>

<filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions><signitemrefs>

<filter>omit</filter><itemref>PAGE1.mgrSigButton</itemref><itemref>PAGE1.admSigButton</itemref><itemref>PAGE1.empsignature</itemref><itemref>PAGE1.mgrsignature</itemref><itemref>PAGE1.admsignature</itemref>

</signitemrefs><!-- The items listed above MUST have itemlocationoptions with absolute and extent as the lastsettings in order for the filter below tobe sufficient in terms of security --><signoptionrefs>

<filter>keep</filter><optionref>PAGE1.mgrSigButton.itemlocation</optionref><optionref>PAGE1.admSigButton.itemlocation</optionref><optionref>PAGE1.empsignature.itemlocation</optionref><optionref>PAGE1.mgrsignature.itemlocation</optionref><optionref>PAGE1.admsignature.itemlocation</optionref>

</signoptionrefs><signature>empsignature</signature>

</button>

XFDL Version 7.7 235

Page 242: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage Details1. An XFDL Viewer automatically copies the signformat option from a signature

button to its associated signature item.2. signformat is an optional setting for a button item, but is mandatory for a

signature item.

236 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 243: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signgroupsSpecifies which groups are filtered for a particular signature.

Filtering a group means keeping or omitting all the cell items that are in thespecified group.

For example, if a signgroups option specifies that the ″colorcells″ group should bekept, then all cells within the ″colorcells″ group will be signed.

Syntax

Table 106. signgroup parameters

Parameter Type Description

group filter keep include groups of cells in thegroup reference list with thesignature; omit those not in thelist

omit omit groups of cells in the groupreference list from the signature;include those not in the list

group reference string identifies a group whose cellitems will be filtered

Available in

button, signature

Example

This example shows a signgroups setting that omits the group of cells named″monthlyPayCells″.

<signgroups><filter>omit</filter><groupref>monthlyPayCells</groupref>

</signgroups>

Usage details1. Default: omit nothing (keep all cell items), unless the containing page is

omitted

2. It is possible to have several list or popup items with the same groupreference, as these are populated with cells that have the same group referenceas the item which contains them. Therefore, when setting up signgroupsoptions, caution must be exercised in making group references to list or popupitems which might be populated by the same group of cells.

<signgroups><filter>group filter</filter><groupref>group reference1</groupref>

...<groupref>group referencen</groupref>

</signgroups>

Note: There may be any number of group reference entries.

XFDL Version 7.7 237

Page 244: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

3. Other filters may take precedence over the signgroups option. Refer to “Orderof precedence of filters” on page 638 for more information on the order ofprecedence of filters.

238 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 245: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signinstance

Specifies what XForms instance data is filtered for a particular signature. Filteringinstances means keeping or omitting specific data from each data instance.

When instance data is omitted from a signature but the associated user interfaceelements are signed, the user can still enter data into those elements. Furthermore,the overlap and layout tests are not performed on those items. This leaves themfree to change certain characteristics, such as size (for expanding tables or fields),to accommodate the user input. This facilitates signing the presentation layer of aform while leaving the actual data open to change.

Syntax

Table 107. signinstance parameters

Parameter Type Description

instance filter keep include groups of cells in thegroup reference list with thesignature

omit omit groups of cells in the groupreference list from the signature;include those not in the list

model ID string The ID of the <xforms:model>that the contains the data youwant to filter. Set to empty todefault to the first model in theform.

XPath XPath An XPath reference to the rootnode of the data you want tofilter. All children of this node arefiltered in the same manner.

This reference is evaluated relativeto the root node of the firstinstance in the model.

Available in

button, signature

<signinstance><filter>instance filter</filter><dataref1>

<model>model ID</model><ref>XPath</ref>

</dataref>...<datarefn>

...</dataref>

</signinstance>

Note: There may be any number of group reference entries.

XFDL Version 7.7 239

Page 246: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

The following code shows an XForms model for a purchase order:<xforms:model>

<xforms:instance id="po" xmlns=""><po>

<order><row>

<product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order><subtotal>0</subtotal><tax>0</tax><total>0</total>

</po></xforms:instance><xforms:instance id="temps" xmlns="">

<root><productCode/><submitting>false</submitting>

</root></xforms:instance>

</xforms:model>

In this case, you might want to omit the temporary information that is stored inthe temps instance. To do this, you would use the following filter:

<signinstance><filter>omit</filter><dataref>

<model></model><ref>instance('temps')</ref>

</dataref></signinstance>

Usage details1. Default: omit nothing (keep instance data)

2. Avoid using other signature filters with signinstance except when absolutelynecessary. Because signed items still accept input so long as the associated dataelements are not signed, you do not need to worry about filtering most userinterface elements out of the signature. However, you must still omit someelements, such as additional signature buttons, signature items, data items, andthe triggeritem option.

240 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 247: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signitemrefsSpecifies individual items that are filtered for a particular signature.

Filtering an item reference means keeping or omitting specific items, rather than allitems of a particular type (see signitems).

Syntax

Table 108. signitemrefs parameters

Parameter Type Description

item filter keep include items in the itemreference list with the signature;omit those not in the list

omit omit items in the item referencelist from the signature; includethose not in the list

item reference string specifies the item to be filtered

Available in

button, signature

Example

This sample sets the signitemrefs option to omit two fields from the signature:<signitemrefs>

<filter>omit</filter><itemref>field1</itemref><itemref>page1.field2</itemref>

</signitemrefs>

Usage details1. Default: omit nothing (keep all items), unless the containing page is omitted.2. Since all items have a name and type, signitemrefs filters are always applicable.3. When not signing the entire form, it is strongly recommended that an omit

signitemrefs filter be used to exclude unwanted items, and that a keepsignoptionrefs filter should be used to cover the layout of omitted items. Seethe Usage Details for the signoptionrefs option for details.

4. If this filter is used with the keep setting, then it is easy to add or delete itemsthat would obscure or unobscure signed items without breaking a signature.The keep setting is useful as an optimization when you want to create aco-signature (i.e., a signature which signs another signature that uses omissionlogic).

<signitemrefs><filter>item filter</filter><itemref>item reference1</itemref>...<itemref>item referencen</itemref>

</signitemrefs>

Note: There may be any number of item reference entries.

XFDL Version 7.7 241

Page 248: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. Other filters may take precedence over the signitemrefs option. Refer to “Orderof precedence of filters” on page 638 for more information on the order ofprecedence of filters.

242 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 249: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signitemsSpecifies which types of items filtered for a particular signature.

Filtering an item means keeping or omitting all items of a particular type, ratherthan specific items (see signitemrefs).

Syntax

Table 109. signitem parameters

Parameter Type Description

item filter keep include types of items in the itemtype list with the signature; omitthose not in the list

omit omit types of items in the itemtype list from the signature;include those not in the list

item type string specifies the type (element tagname) of items to be filtered

Available in

button, signature

Example

This sample sets the signitems option to keep the following types of items with thesignature: boxes, buttons, and fields.

<signitems><filter>keep</filter><itemtype>box</itemtype><itemtype>button</itemtype><itemtype>field</itemtype>

</signitems>

Usage details1. Default: omit nothing (keep all items), unless the containing page is omitted.2. The only recommended use of this filter is to omit data items in support of the

usage of the signdatagroups filter.3. Element tag names can be specified with or without a namespace prefix. The

default namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter.

<signitems><filter>item filter</filter><itemtype>item type1</itemtype>...<itemtype>item typen</itemtype>

</signitems>

Note: There may be any number of item type entries.

XFDL Version 7.7 243

Page 250: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

For example, the filter component <itemtype>box</itemtype> couldequivalently be written <itemtype>xfdl:box</itemtype> if the prefix xfdl ismapped to the XFDL namespace URI.

4. Other filters may take precedence over the signitems option. Refer to “Order ofprecedence of filters” on page 638 for more information on the order ofprecedence of filters.

244 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 251: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signnamespacesSpecifies which namespaces are filtered for a particular signature.

Filtering a namespace means keeping or omitting all of the form elements andattributes that are in the specified namespace.

For example, if a signnamespaces option specifies that the http://www.ibm.com/xmlns/prod/XFDL/Custom namespace should be kept, then all elements in thatnamespace are signed.

Syntax

Table 110. signnamespaces parameters

Parameter Type Description

namespace filter keep include all form elements in thenamespace URI list with thesignature; omit those not in thelist

omit omit all form element that are inthe namespaces in the namespaceURI list from the signature;include those not in the list

namespace URI string identifies a namespace whoseelements will be filtered

Available in

button, signature

Example

This example shows a signnamespaces setting that omits the http://www.ibm.com/xmlns/prod/XFDL/Custom namespace.

<signnamespaces><filter>omit</filter><uri>http://www.ibm.com/xmlns/prod/XFDL/Custom</uri>

</signnamespaces>

Usage details1. Default: omit nothing (keep all namespaces).2. Other filters may take precedence over the signnamespaces option. Refer to

“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

<signnamespaces><filter>namespace filter</filter><uri>namespace URI1</uri>...<uri>namespace URIn</uri>

</signnamespaces>

Note: There may be any number of namespace URI entries.

XFDL Version 7.7 245

Page 252: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signoptionrefsSpecifies individual options that are filtered for a particular signature.

Filtering option references means keeping or omitting specific options, rather thanall options of a particular type (see signoptions).

Syntax

Table 111. signoptionrefs parameters

Parameter Type Description

option filter keep include options in the optionreference list with the signature;omit those not in the list

omit omit options in the optionreference list from the signature;include those not in the list

option reference string specifies the option to be filtered

Available in

button, signature

Example

This example specifies a signoptionrefs setting that keeps a particular field with thesignature.

<signoptionrefs><filter>keep</filter><optionref>page1.field1.value</optionref>

</signoptionrefs>

Note: The page name may be dropped if the option in question is on the samepage, but the item name must not be dropped.

Usage details1. Default: keep all options (omit nothing), unless the containing item is

omitted.2. Note that, unlike signoptions, the signoptionrefs filter can cause an item to be

included even if the item filters would normally omit the item. This isnecessary in order to ensure that the hashed text of a signature is in validXFDL format.

<signoptionrefs><filter>option filter</filter><optionref>option reference1</optionref>...<optionref>option referencen</optionref>

</signoptionrefs>

Note: There may be any number of option reference entries.

246 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 253: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

3. It is strongly recommended that signoptionrefs be used to keep theitemlocation of items that have been omitted, and that all omitted items havean itemlocation with absolute and extent settings as the last two settings.

4. Element tag names can be specified with or without a namespace prefix. Thedefault namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter.For exampe, the filter component <optionref>page1.field1.value</optionref>could equivalently be written <optionref>page1.field1.xfdl:value</optionref> ifthe prefix xfdl is mapped to the XFDL namespace URI.

5. Other filters may take precedence over the signoptionrefs option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

XFDL Version 7.7 247

Page 254: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signoptionsSpecifies which types of options are filtered for a particular signature.

Filtering options means keeping or omitting all options of a particular type, ratherthan specific options (see signoptionrefs).

Syntax

Table 112. signoptions parameters

Parameter Type Description

option filter keep include types of options in theoption type list with thesignature; omit those not in thelist

omit omit types of options in theoption type list from thesignature; include those not in thelist

option type string specifies the type (element tagname) of options to be filtered

Available in

button, signature

Example

This example shows a signoptions setting that omits two types of options from thesignature.

<signoptions><filter>omit</filter><optiontype>url</optiontype><optiontype>printsettings</optiontype>

</signoptions>

Usage details1. Default: keep all options (omit nothing), unless the containing item is

omitted.2. One signoptions setting must always be specified in the following way:

<signoptions><filter>omit</filter><optiontype>triggeritem</optiontype><optiontype>coordinates</optiontype>

</signoptions>

<signoptions><filter>option filter</filter><optiontype>option type1</optiontype>...<optiontype>option typen</optiontype>

</signoptions>

Note: There may be any number of option type entries.

248 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 255: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v This setting ensures that the signature will not be broken due to an alterationto the form.

v If the this option must be used as a keep filter, then consider omitting theglobal.global.triggeritem and the coordinates of image buttons using asignoptionrefs filter.

3. Element tag names can be specified with or without a namespace prefix. Thedefault namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter component.For example, the filter component <optiontype>triggeritem</optiontype> couldbe equivalently written as <optiontype>xfdl:triggeritem</optiontype> if theprefix xfdl is mapped to the XFDL namespace URI.

4. Other filters may take precedence over the signoptions option. Refer to “Orderof precedence of filters” on page 638 for more information on the order ofprecedence of filters.

XFDL Version 7.7 249

Page 256: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signpagerefsSpecifies individual pages that are filtered for a particular signature. Filteringpages means keeping or omitting a page and all of its contents.

Syntax

Table 113. signpagerefs parameters

Parameter Type Description

page filter keep include pages in the pagereference list with the signature;omit those not in the list

omit omit pages in the page referencelist from the signature; includethose not in the list

page reference string specifies the page to be filtered

Available in

button, signature

Example

This sample sets the signpagerefs option to omit two pages from the signature.<signpagerefs>

<filter>omit</filter><pageref>page1</pageref><pageref>page2</pageref>

</signpagerefs>

Usage details1. Default: keep all pages.2. Other filters may take precedence over the signpagerefs option. Refer to

“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

<signpagerefs><filter>page filter</filter><pageref>page reference1</pageref>...<pageref>page referencen</pageref>

</signpagerefs>

Note: There may be any number of page reference entries.

250 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 257: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

sizeSpecifies an item’s size. It does not include external labels, borders, or scroll bars.These are part of the bounding box size which is calculated automatically.

Examples of item size are the input area in a field item or the height and width ofthe label in label and button items.

Syntax

Table 114. size parameters

Parameter Type Description

width unsigned byte the horizontal dimension of theitem, measured in characters

height unsigned byte the vertical dimension of the item,measured in lines

Available in

box, button, check, combobox, field, label, line, list, popup, radio, slider, spacer

Example

This sample sets the item’s size to 80 characters wide by five lines high.<size>

<width>80</width><height>5</height>

</size>

Usage details1. Default: refer to “Default sizes” on page 637 for a complete list of default sizes.2. Size and Font:v The width might not always accommodate the number of characters

specified. The calculation to determine actual width is:v width * (average character width for the item’s font)v The width will only exactly match the number of characters the item can

display horizontally when the font is monospaced (like Courier).3. If either the height or the width is invalid, the default item size will be used. A

dimension of zero (0) is invalid for all items except the line item.4. The item and bounding box sizes can be changed by using itemlocation with

an expansion or extent modifier. This will override the size option.

<size><width>width</width><height>height</height>

</size>

XFDL Version 7.7 251

Page 258: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

suppresslabelSuppresses the built-in label for some items, so that the label is not shown even ifthe label option or xforms:label option is set.

This is most useful when you are using XFDL to wrap an XForms control thatincludes labels that are not necessary in the visual presentation. For example, youmight not want to display the labels of items in a table.

When the label is suppressed, the item is both displayed and printed as if no labelwere present at all. This means that both the appearance and size match anequivalent item with no label.

Syntax

Table 115. suppresslabel parameter

Parameter Type Description

status on Suppress the item’s built-in label.

off Do not suppress the item’s built-inlabel.

Available in

check, checkgroup, combobox, field, list, popup, radio, radiogroup, and slider

Example

This example shows a table with one field in each row. The suppresslabel optionhas a compute that determines whether the field is in the first row, and suppressesthe label if the field is not. This effectively creates a title row of labels on the firstrow of the table, then suppresses the labels for all subsequent rows.

<table sid="customerTable"><xforms:repeat nodeset="customer">

<field sid="nameField"><xforms:input ref="name">

<xforms:label>Name:</xforms:label></xforms:input><suppresslabel compute="xforms.getPosInSet() == '1' ?

'off' : 'on'"/></field>

</xforms:repeat></table>

Usage details1. Default: off.

<suppresslabel>status</suppresslabel>

252 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 259: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

texttypeSpecifies whether a field uses plain text or rich text.

Syntax

Table 116. texttype parameter

Parameter Type Description

type string The type of text to use. Validoptions are:

v text/plain

v text/rtf

Available in

field

Example

This sample sets a field to use rich text.<field sid="richTextField">

<texttype>text/rtf</texttype><value>Hello</value><rtf>rich text version of Hello</rtf>

</field>

Usage details1. Default: text/plain

2. If using rich text:v The rich text is stored in the rtf option.v A plain text version of the rich text is stored in the value option (refer to the

rtf option for more information).

<texttype>type</texttype>

XFDL Version 7.7 253

Page 260: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

thicknessSpecifies the thickness of a line item. The unit of measurement is pixels.

Syntax

Table 117. thickness parameter

Parameter Type Description

thickness unsigned byte the thickness of the line

Available in

line

Example

This sample defines a horizontal line 40 characters long and five pixels thick:<size>

<width>40</width><height>0</height>

</size><thickness>5</thickness>

Usage details1. Default: one pixel

2. Use size to define the dimension of a line in one direction (height or width)and thickness to define the dimension in the other direction. The dimensionthickness defines must be set to zero in size.

3. The line’s thickness may be changed by using itemlocation with an expansionmodifier for the dimension that thickness describes.

<thickness>thickness</thickness>

254 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 261: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitdatagroupsSpecifies which datagroups are filtered when the form is transmitted.

Filtering a datagroup means keeping or omitting all the data items that are in thespecified datagroup.

For example, if a transmitdatagroups option specifies that the ″attachments″datagroup should be kept, then all data items within the ″attachments″ group willbe transmitted.

This filter applies to all data items present when transmitted, including thoseadded as enclosures.

Syntax

Table 118. transitdatagroups parameters

Parameter Type Description

datagroup filter keep include datagroups in thedatagroup reference list with thetransmission; omit those not in thelist

omit omit datagroups in the datagroupreference list from thetransmission; keep those not inthe list

datagroup reference string identifies a datagroup whose dataitems will be filtered

Available in

action, button, cell

Examples

This sample specifies that only items of type data with a datagroup setting ofenclosures should be transmitted:

<transmitdatagroups><filter>keep</filter><datagroupref>enclosures</datagroupref>

</transmitdatagroups>

This sample specifies that all items of type data except those with a datagroupsetting of others should be kept in the transmission:

<transmitdatagroups><filter>datagroup filter</filter><datagroupref>datagroup reference1</datagroupref>...<datagroupref>datagroup referencen</datagroupref>

</transmitdatagroups>

Note: There may be any number of datagroup reference entries.

XFDL Version 7.7 255

Page 262: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<transmitdatagroups><filter>omit</filter><datagroupref>others</datagroupref>

</transmitdatagroups>

Usage details1. Default: omit nothing (keep all data items), unless the containing page is

omitted.2. Since enclosed files can belong to several datagroups, and datagroups can

contain several enclosed files, care must be exercised when setting uptransmitdatagroups options to ensure that only the desired datagroups arefiltered.

3. Other filters may take precedence over the transmitdatagroups option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

256 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 263: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitformatSpecifies the format a form will be saved in. An XFDL form may be saved as XFDLcompressed or uncompressed formats.

XFDL format submits the entire form definition, including user input.

Note: Form and page globals are sent only if the format is XFDL.

Syntax

Table 119. transmitformat parameter

Parameter Type Description

MIME type application/vnd.xfdl use XFDL format

application/vnd.xfdl;content-encoding=″base64-gzip″

use compressed XFDL format

Available in

action, button, cell, page global, form global

Examples

XFDL format

This example shows a button which, when clicked, will submit the form in XFDLformat.

<button sid="send_button"><type>done</type><url>mailto:[email protected]</url><transmitformat>application/vnd.xfdl</transmitformat>

</button>

When a user clicks the button, the entire form definition will be submitted, unlessother transmit options specify a partial submission.

Usage details1. Default: The default is the format that the form was in before it was parsed.

For example, a form written in XFDL will be transmitted in XFDL unlessotherwise specified by this option.

2. This option can be included as a form global option and in the definitions ofitems that trigger form submissions. These items have a type option setting ofsubmit or done.

<transmitformat>MIME type</transmitformat>

XFDL Version 7.7 257

Page 264: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitgroupsSpecifies which groups are filtered for a particular transmission.

Filtering a group means keeping or omitting all the cell items that are in thespecified group.

For example, if a transmitgroups option specifies that the “colorcell” group shouldbe kept, then all cells within the “colorcell” group will be transmitted.

Syntax

Table 120. transmitgroups parameters

Parameter Type Description

transmit flag keep include groups of cells in thegroup reference list with thetransmission; omit those not in thelist

omit omit groups of cells in the groupreference list from thetransmission; include those not inthe list

group reference string identifies a group whose cellitems will be filtered

Available in

action, button, cell

Examples

This sample specifies that only the items in the “countryCells” and“departmentCells” groups should be kept in the transmission.

<transmitgroups><filter>keep</filter><groupref>countryCells</groupref><groupref>departmentCells</groupref>

</transmitgroups>

This sample specifies that all groups of cells should be kept in the transmissionexcept for “firstNameCells” group.

<transmitgroups><filter>omit</filter><groupref>firstNameCells</groupref>

</transmitgroups>

<transmitgroups><filter>transmit flag</filter><groupref>group reference1</groupref>...<groupref>group referencen</groupref>

</transmitgroups>

Note: There may be any number of group reference entries.

258 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 265: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details1. Default: omit nothing (keep all cell items), unless the containing page is

omitted.2. It is possible to have several list or popup items with the same group

reference, as these are populated with cells that have the same group referenceas the item which contains them. Therefore, when setting up a transmitgroupsoption, caution must be exercised in making group references to list or popupitems which might be populated by the same group of cells.

3. Other filters may take precedence over the transmitgroups option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

XFDL Version 7.7 259

Page 266: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmititemrefsSpecifies individual items that are filtered for a particular transmission. Filteringitem references means keeping or omitting individual items, rather than all itemsof a particular type (see transmititems).

Syntax

Table 121. transmititemrefs parameters

Parameter Type Description

transmit flag keep include items in the itemreference list with thetransmission; omit those not in thelist

omit omit items in the item referencelist from the transmission; includethose not in the list

item reference string identifies the item to be filtered

Available in

action, button, cell

Examples

This sample specifies that only the item on page1 called “MgrSignButton” shouldbe transmitted, and that all other items should be omitted.

<transmititemrefs><filter>keep</filter><itemref>page1.MgrSignButton</itemref>

</transmititemrefs>

This sample shows how you would use transmititemrefs in conjunction withtransmititems: although all items that are buttons are omitted, the button on page1called “MgrSignButton” will be kept.

<transmititems><filter>omit</filter><itemtype>button</itemtype>

</transmititems><transmititemrefs>

<filter>keep</filter><itemref>page1.MgrSignButton</itemref>

</transmititemrefs>

Usage details1. Default: omit nothing (keep all items), unless the containing page is omitted

<transmititemrefs><filter>transmit flag</filter><itemref>item reference1</itemref>...<itemref>item referencen</itemref>

</transmititemrefs>

Note: There may be any number of item reference entries.

260 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 267: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. Other filters may take precedence over the transmititemrefs option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

XFDL Version 7.7 261

Page 268: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmititemsSpecifies types of items that are filtered for a particular transmission.

Filtering items means keeping or omitting all items of a particular type, rather thanindividual items (see transmititemrefs).

Syntax

Table 122. transmititem parameters

Parameter Type Description

transmit flag keep include types of items in the itemtype list with the transmission;omit those not in the list

omit omit types of items in the itemtype list from the transmission;include those not in the list

item type string identifies the type (element tagname) of items to be filtered

Available in

action, button, cell

Example

This sample specifies that box, help, label, spacer, and toolbar items should beomitted from the form data submitted to the form processing application.

<transmititems><filter>omit</filter><itemtype>box</itemtype><itemtype>help</itemtype><itemtype>spacer</itemtype><itemtype>toolbar</itemtype>

</transmititems>

Usage details1. Default: omit nothing (keep all items), unless the containing page is omitted.2. Element tag names can be specified with or without a namespace prefix. The

default namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter.

<transmititems><filter>transmit flag</filter><itemtype>item type1</itemtype>...<itemtype>item typen</itemtype>

</transmititems>

Note: There may be any number of item type entries.

262 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 269: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

For example, the filter component <itemtype>box</itemtype> couldequivalently be written <itemtype>xfdl:box</itemtype> if the prefix xfdl ismapped to the XFDL namespace URI.

3. Other filters may take precedence over the transmititems option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

XFDL Version 7.7 263

Page 270: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitnamespacesSpecifies which namespaces are filtered for a particular transmission. Filtering anamespace means keeping or omitting all of the form elements and attributes thatare in the specified namespace.

For example, if a transmitnamespaces option specifies that thehttp://www.ibm.com/xmlns/prod/XFDL/Custom namespace should be kept,then all elements in that namespace are transmitted.

Syntax

Table 123. transmitnamespaces parameters

Parameter Type Description

namespace filter keep include all form elements in thenamespace URI list with thetransmission; omit those not in thelist

omit omit all form element that are inthe namespaces in the namespaceURI list from the transmission;include those not in the list

namespace URI string identifies a namespace whoseelements will be filtered

Available in

action, button, cell

Example

This example shows a transmitnamespaces setting that omits thehttp://www.ibm.com/xmlns/prod/XFDL/Custom namespace.

<transmitnamespaces><filter>omit</filter><uri>http://www.ibm.com/xmlns/prod/XFDL/Custom</uri>

</transmitnamespaces>

Usage details1. Default: omit nothing (keep all namespaces).2. Other filters may take precedence over the transmitnamespaces option. Refer

to “Order of precedence of filters” on page 638 for more information on theorder of precedence of filters.

<transmitnamespaces><filter>namespace filter</filter><uri>namespace URI1</uri>...<uri>namespace URIn</uri>

</transmitnamespace>

Note: There may be any number of namespace URI entries.

264 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 271: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitoptionrefsSpecifies individual options that are filtered for a particular transmission.

Filtering option references means keeping or omitting individual options, ratherthan all options of a particular type (see transmitoptions).

Syntax

Table 124. transitoptionrefs parameters

Parameter Type Description

transmit flag keep include options in the optionreference list with thetransmission; omit those not in thelist

omit omit options in the optionreference list from thetransmission; include those not inthe list

option reference string identifies the option to be filtered

Available in

action, button, cell

Examples

This sample shows how you would use transmitoptionrefs in conjunction withtransmitoptions: although all options that are values are omitted, the value in the“NameField” on “page1” will be kept.

<transmitoptions><filter>omit</filter><optiontype>value</optiontype>

</transmitoptions><transmitoptionrefs>

<filter>keep</filter><optionref>page1.NameField.value</optionref>

</transmitoptionrefs>

This sample shows how you would use transmitoptionrefs in conjunction withtransmititemrefs: although the item called “MgrSignButton” on “page1” is omitted,its signer option is kept

<transmititemrefs><filter>omit</filter><itemref>MgrSignButton</itemref>

</transmititemrefs>

<transmitoptionrefs><filter>transmit flag</filter><optionref>option reference1</optionref>...<optionref>option referencen</optionref>

</transmitoptionrefs>

Note: There may be any number of option reference entries.

XFDL Version 7.7 265

Page 272: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<transmitoptionrefs><filter>keep</filter><optionref>page1.MgrSignButton.signature</optionref>

</transmitoptionrefs>

Usage details1. Default: keep all options (omit nothing), unless the containing item is

omitted.2. Element tag names can be specified with or without a namespace prefix. The

default namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter.For example, the filter component <optionref>page1.field1.value</optionref>could equivalently be written <optionref>page1.field1.xfdl:value</optionref> ifthe prefix xfdl is mapped to the XFDL namespace URI.

3. Other filters may take precedence over the transmitoptionrefs option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

266 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 273: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitoptionsSpecifies types of options that are filtered for a particular transmission. Filteringoptions means keeping or omitting all options of a particular type, rather thanindividual items (see transmititemrefs).

Syntax

Table 125. transmitoptions parameters

Parameter Type Description

transmit flag keep include types of options in theoption type list with thetransmission; omit those not in thelist

omit omit types of options in theoption type list from thetransmission; include those not inthe list

option type string specifies the type (element tagname) of options to be filtered

Available in

action, button, cell

Example

This sample specifies that only the active, mimedata, and value options should beincluded in the form data submitted to the form processing application.

<transmitoptions><filter>keep</filter><optiontype>active</optiontype><optiontype>mimedata</optiontype><optiontype>value</optiontype>

</transmitoptions>

Usage details1. Default: keep all options (omit nothing), unless the containing item is

omitted.2. Element tag names can be specified with or without a namespace prefix. The

default namespace URI is the XFDL namespace URI if no namespace prefix isgiven. If a namespace prefix is given, then the namespace URI to which theprefix is bound is used in determining whether or not each element matchesthe given filter component.

<transmitoptions><filter>transmit flag</filter><optiontype>option type1</optiontype>...<optiontype>option typen</optiontype>

</transmitoptions>

Note: There may be any number of option type entries.

XFDL Version 7.7 267

Page 274: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

For example, the filter component <optiontype>triggeritem</optiontype> couldbe equivalently written as <optiontype>xfdl:triggeritem</optiontype> if theprefix xfdl is mapped to the XFDL namespace URI.

3. Other filters may take precedence over the transmitoptions option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

268 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 275: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

transmitpagerefsSpecifies individual pages that are filtered for a particular signature. Filteringpages means keeping or omitting a page and all of its contents.

Syntax

Table 126. transmitpagerefs parameters

Parameter Type Description

transmit flag keep include pages in the pagereference list with thetransmission; omit those not in thelist

omit omit pages in the page referencelist from the transmission; includethose not in the list

page reference string specifies the page to be filtered

Available in

action, button, cell

Examples

This sample specifies that only page1 should be transmitted, and that all otherpages should be omitted:

<transmitpagerefs><filter>keep</filter><pageref>page1</pageref>

</transmitpagerefs>

Usage details1. Default: keep all pages

2. Other filters may take precedence over the transmitpagerefs option. Refer to“Order of precedence of filters” on page 638 for more information on the orderof precedence of filters.

<transmitpagerefs><filter>transmit flag</filter><pageref>page reference1</pageref>...<pageref>page referencen</pageref>

</transmitpagerefs>

Note: There may be any number of page reference entries.

XFDL Version 7.7 269

Page 276: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

triggeritemIdentifies the item that triggered a form submission. Items triggering formsubmissions have a type option setting of refresh, submit, or done.

When a user selects an item that triggers a form submission, the triggeritem optionis added to the form globals and assigned the item reference of the selected item.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 127. triggeritem parameters

Parameter Type Description

item reference string identifies the trigger item

Available in

form global

Example

This sample indicates that the item triggering the request is on the page called“Page_one” and has is called “submit_button”.

<triggeritem>Page_one.submit_button</triggeritem>

Usage details1. Actions of type submit or done set the triggeritem to the SID of the triggering

item. Actions of type refresh first clear the triggeritem by setting it to empty(″″), then set the triggeritem to the SID of the triggering item.

<triggeritem>item reference</triggeritem>

270 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 277: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

typeAssociates an action type with an item that can trigger a task.

Syntax

Table 128. type parameter

Parameter Type Description

action type (see below) the task to perform

Action types

The action types can be any of the following:

Table 129. action types

Action type Action type descriptionUse with the followingXFDL items

cancel Closes the form; if any changes weremade to the form since the last save orsubmit, then the user is informed thatthe form has changed and is allowed tochoose whether the cancellation willproceed. Note that the value options ofmany items, as well as the contents ofdata items, may change in response toan enclose or remove action.

action, button, cell

display Displays an enclosed file. The webbrowser will choose the appropriateviewer according to the file’s MIMEtype.

action, button cell

done Performs a submit followed by a cancel.All fields containing error checking onthe current page must be correctly filledout before it can be closed.

action, button, cell

enclose Allows the user to place one or morefiles into one or more of the datagroupsdefined for the form. The files will beencoded using base64 encoding format.

button, cell

extract Allows a user to copy the contents of anenclosed file into a file on the local disk.

button, cell

link Performs all requests specified by theurl options in the current item. See “url”on page 285 for more details.

action, button, cell

pagedone Moves to the page specified in the urloption. This closes the current page andreplaces it with the new page.

action, button, cell

print Prints the form on a local printer. action, button, cell

refresh Sets the triggeritem to ″″ and then to thefull reference (including scope ID) of theitem that triggered the refresh.

action, button, cell

<type>action type</type>

XFDL Version 7.7 271

Page 278: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 129. action types (continued)

Action type Action type descriptionUse with the followingXFDL items

remove Allows the user to remove an item froma datagroup; the underlying data itemwill only be deleted if it belongs to noother datagroups.

button, cell

replace Performs a link followed by a cancel. action, button, cell

saveform Saves the form to the current file nameand location. If no file name has beenset, prompts the user for a file nameand location, then saves the file.

action, button, cell

saveas Prompts the user for a file name andsave location, then saves the file.

action, button, cell

select With action items: the item’s activeoption switches from off, to on, to offagain. Additionally, if an xforms:actionis contained within the action item, thenthe xforms:action is triggered.

With button items containing images:stores where on the image the buttonwas clicked in the coordinates option.

With cell items: flags the cell as selectedwhen a user chooses the cell. Thismeans the item reference of the cell iscopied to the value option of the parentlist or popup.

action, button, cell

signature Creates a signature. button

submit Initiates the form processingapplications identified in the url optionsof the current item. All fields containingerror checking on the current page mustbe correctly filled out before it can beclosed.

action, button, cell

Available in

action, button, cell

Example

This sample specifies that “BUTTON1” saves the form to a local file.<button sid="BUTTON1">

<value>Save</value><type>saveas</type>

</button>

Usage details1. Default: select

2. If a button that wraps an xforms:trigger option has a type of anything otherthan select, the xforms:trigger is overridden.

272 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 279: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

ufv_settingsThe ufv_settings option modifies a variety of form features such as colors,mandatory fields and buttons that appear in the Viewer’s toolbar.

Page ufv_settings override the global settings for a particular page. Global settingscheck page ufv_settings before determining if the default value is used. Forexample, if you set the validoverlap globally, then set the errorcolor for page one,page one will not inherit the validoverlap setting.

Syntax

Table 130. ufv_setting parameters

Parameter Type Description

color RGB, hex or valid colorname

displays the specified backgroundcolor when the user entersincorrect information. Forexample, alphabetical text enteredinto an integer field.

cursor arrow controls the appearance of thecursor when the Viewer is in helpmode. The help cursor appears asthe “normal select” cursor; a plainarrow.

question controls the appearance of thecursor when the Viewer is in helpmode. The help cursor appears asthe “help select” cursor; an arrowwith a question mark beside it.

focusbackgroundcolor RGB, hex or valid colorname

controls the text area backgroundcolor of a popup menu when thepopup has focus. This option isonly available for IBM Lotus®

Forms Server – Webform Server.

focusforegroundcolor RGB, hex or valid colorname

controls the foreground color ofthe text area of the popup menuwhen it has focus. This option isonly available for IBM LotusForms Server – Webform Server.

<ufv_settings><errorcolor>color</errorcolor><focusbgcolor>focusbackgroundcolor</focusbgcolor><focusfontcolor>focusforegroundcolor</focusfontcolor><helpcursor>cursor</helpcursor><mandatorycolor>mandatoryColor</mandatorycolor><menu>menuSettings</menu><modifiable>modifiableSettings</modifiable><pagedonewithformaterrors>pagedonewithformaterrors

</pagedonewithformaterrors><printwithformaterrors>printwithformaterrors</printwithformaterrors><savewithformaterrors>savewithformaterrors</savewithformaterrors><scrollfieldsonzoom>scrollfieldsonzoom</scrollfieldsonzoom><signwithformaterrors>signwithformaterrors</signwithformaterrors><submitwithformaterrors>submitwithformaterrors</submitwithformaterrors><validoverlap>validoverlap</validoverlap>

</ufv_settings>

XFDL Version 7.7 273

Page 280: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 130. ufv_setting parameters (continued)

Parameter Type Description

mandatoryColor RGB, hex or valid colorname

sets the background color of amandatory input item.

menuSettings see Menu settings.

modifiableSettings on allows users to read/writeinformation on a form.

off allows users to only readinformation on a form.

pagedonewithformaterrors

permit allows the user to proceed toanother page, even if there arevalidation errors.

warn if type checking errors exists,alerts the user and asks if theywant to change the page anyway.

deny stops the user from changing thepage until the errors are corrected.

printwithformaterrors permit allows form designers to createforms that can be printed, even ifthere are type checking errors inthe form.

warn warns the user if type checkingerrors exist and asks the user ifthey want to continue printing theform.

deny warns the user and aborts theprint if type checking errors exists.For example, you can create aform that the user cannot printunless they have completed all themandatory fields.

savewithformaterrors permit allows users to save the form evenif there are type checking errors.

warn warns the user of type checkingerrors and asks if the user if theywant to continue saving the form.

deny alerts the user to type checkingerrors and aborts the save. Forexample, you can create a formthat the user cannot save unlessthey have completed all themandatory fields.

scrollfieldsonzoom on in some cases, the Viewer’s zoomfeature causes incorrect wrappingin fixed height Viewer fields,resulting in text disappearingbeyond the field bottom. The addsscroll bars to fixed height fieldswhere necessary to correct thisproblem.

off never adds scroll bars to fixedheight fields.

274 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 281: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 130. ufv_setting parameters (continued)

Parameter Type Description

signwithformaterrors permit allows the user to sign the formeven if there are type checkingerrors. For example, you cancreate a form that the user cansign even if they have notcompleted all the mandatoryfields.

warn warns the user of type checkingerrors and asks if the user if theywant to continue signing the form.

deny alerts the user to type checkingerrors and aborts the signature.

submitwithformaterrors permit allows users to submit the formeven if there are type checkingerrors. For example, you cancreate a form that the user cansubmit even if they have notcompleted all the mandatoryfields.

warn warns the user of type checkingerrors and asks if the user if theywant to continue submitting theform.

deny alerts the user to type checkingerrors and aborts the submission.For example, you can create aform that the user cannot submitunless they have completed all themandatory fields.

validoverlap numeric value adjusts the tolerance of theoverlap text that the Viewerperforms when signing items. Theoverlap test detects overlapsbetween signed items andunsigned items.

Available in

page globals, form global.

Menu Settings

<ufv_settings><menu>

<keyword>value</keyword></menu>

</ufv_settings>

Note: You can have more than one menu settings listed in the ufv_settings:

XFDL Version 7.7 275

Page 282: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 131. ufv_settings_Menu_settings parameters

Parameter Type Description

keyword describes an icon used in themenu and what it does.

value on the icon is available as normal.

off the icon is visible but is grayedout and cannot be used.

hidden the icon is not visible. the toolbarwill collapse appropriately toeliminate the gaps in the icons.

Table 132. a list and description of each icon, and the keyword to use with the menu setting

Icon Description Keyword

EntireToolbar

Displays all of the icons. visible

Open Opens a new form. open

Save Form Saves the form to the current file. save

Save As Saves the form, prompting the user for a file name andlocation.

save

Print Prints the current form. print

Mail E-mails the current form. mail

Preferences Opens the Preferences Dialog Box. preferences

Font Opens the Font Dialog Box which allows the user tochange font characteristics in rich text fields.

fontdialog

Paragraph Opens the Paragraph Dialog Box which allows the userto change indenting and alignment in rich text fields.

paragraphdialog

CheckSpelling

Checks the spelling in the current item. spellcheck

Check AllSpelling

Checks the spelling for the entire page. spellcheckall

Zoom Out Decreases the magnification of the form. zoom

Select ZoomFactor

Sets the magnification to a specific factor. zoom

Zoom In Increases the magnification of the form. zoom

Help Activates the form’s help messages. help

Viewer Help Opens the Viewer Help. viewerhelp

About Opens the About box for the Viewer or Webform Server. about

Refresh Form Refreshes the form, which updates all the computes. Thisfeature is only available when viewing forms in WebformServer.

refresh

ToggleAccessibilityMode

Turns the accessibility mode on and off. This feature isonly available when viewing forms in Webform Server.

accessibility

Wizard Turns the document accessibility wizard on and off. Thisfeature is only available when viewing forms in WebformServer.

wizard

276 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 283: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Exampleserrorcolor

The following examples show ways to insert error colors.

In each case, if an input item in the form receives an invalid entry, the backgroundcolor of the item will change to hot pink.

<ufv_settings><errorcolor>255,105,180</errorcolor>

</ufv_settings>

OR<ufv_settings>

<errorcolor>HotPink</errorcolor></ufv_settings>

OR<ufv_settings>

<errorcolor>#EE6AA7</errorcolor></ufv_settings>

helpcursor

The following example shows how to get the help cursor to be an arrow ratherthan an arrow with a question mark.

<ufv_settings><helpcursor>arrow</helpcursor>

</ufv_settings>

backgroundcolor/foregroundcolor

The following example shows how to set the background and foreground colorsfor dropdown menus when the menu has focus.<globalpage sid="global">

<global sid="global"><ufv_settings>

<focusbgcolor>#FF00FF</focusbgcolor><focusfontcolor>#00FFFF</focusfontcolor>

</ufv_settings></global>

</globalpage><page sid="PAGE1">

<global sid="global"><label>PAGE1</label><ufv_settings>

<focusbgcolor>#000000</focusbgcolor><focusfontcolor>#FFFFFF</focusfontcolor>

</ufv_settings></global>

...</page>

mandatorycolor

The following examples show ways to set the mandatory colors.

In each case, the mandatory input items on the form will have a background colorof misty rose. This background color will override any other background colorstated in the form description, and cannot itself be overridden by a compute.

XFDL Version 7.7 277

Page 284: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<ufv_settings><mandatorycolor>255,228,225</mandatorycolor>

</ufv_settings>

OR<ufv_settings>

<mandatorycolor>misty rose</mandatorycolor></ufv_settings>

OR<ufv_settings>

<mandatorycolor>#FF00CC</mandatorycolor></ufv_settings>

menu

Menu settings allow you to control the appearance of the toolbar. Specifically, theyallow you to either remove the toolbar, or hide or disable individual toolbar icons.Note that the Save Form and Save As buttons are both controlled by the savekeyword. This means that they must both be on or off — you cannot set themindividually.

Affecting the Entire Menu Toolbar

The following example removes the entire toolbar from the form:<ufv_settings>

<menu><visible>off</visible>

</menu></ufv_settings>

Affecting Individual Menu Icons

In a form with the following ufv_settings declaration, users will be able to selectPrint, Preferences, Check Spelling, Check All Spelling, and open the Viewer Helpform. They will not be able to save the form, open another form, send mail, oraccess the help mode. Furthermore, the help mode and about icons will not bevisible.

<ufv_settings><menu>

<save>off</save><print>on</print><open>off</open><mail>off</mail><preferences>on</preferences><spellcheck>on</spellcheck><spellcheckall>on</spellcheckall><help>hidden</help><viewerhelp>on</viewerhelp><about>hidden</about>

</menu></ufv_settings>

Note: The menu function does not prevent the form designer from adding controlsfor opening or saving forms, or from using other functions elsewhere in the form.

278 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 285: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

modifiable

The following example shows hot to set the modifiable setting to off. A form withthis setting would be read-only. This is not a secure method of preventing a formfrom being altered, since the source code can still be changed. However, this canbe used to prevent accidental changes.

<ufv_settings><modifiable>off</modifiable>

</ufv_settings>

pagedonewithformaterrors

The following example shows how to prevent the users from going to anotherpage until all errors are corrected:<globalpage sid="global">

<global sid="global"><ufv_settings>

<pagedonewithformaterrors>deny</pagedonewithformaterrors></ufv_settings></global></globalpage>

</global></globalpage>

printwithformaterrors

The following examples show how to prevent users from printing the form untilall errors have been corrected.

When this ufv_setting is place in a page global, it affects every the button in theform.

To apply printformaterrors to all of the print buttons in your form, place thesetting in the form global.

<globalpage sid="global"><global sid="global">

<ufv_settings><printwithformaterrors>deny</printwithformaterrors>

</ufv_settings></global>

</globalpage>

When this ufv_setting is placed in a page global, it only affects the buttons on thatpage.

<page sid="PAGE1"><global sid="global">

<ufv_settings><printwithformaterrors>deny</printwithformaterrors>

</ufv_settings></global>...XFDL items...

</page>

If you want printwithformaterrors to apply to only a single button, you mustimplement it in a compute that references the print button you want to affect. Thefollowing example shows a compute that toggles between permit and deny basedon the activated state of a print button. This ensures that users are denied theability to print a form that contains format errors unless they are using thespecified print button.

XFDL Version 7.7 279

Page 286: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<ufv_settings><printwithformaterrors compute="toggle( &#xA;

page1.printButton.activated,'off', 'on') == '1' ? 'permit' : &#xA;'deny'"></printwithformaterrors>

</ufv_settings>

A form with this setting will deny printing until the page1.printButton is clicked.When that button is clicked, the form will toggle to permit and will print even ifthere are type checking errors. Once printing is complete, the setting will toggleback to deny.

savewithformaterrors

The following examples show how to prevent users from saving the form until allerrors have been corrected.

To apply savewithformaterrors to all of the save buttons in your form, place thesetting in the form global.

<globalpage sid="global"><global sid="global">

<ufv_settings><savewithformaterrors>deny</savewithformaterrors>

</ufv_settings></global>

</globalpage>

To apply savewithformaterrors to all the save buttons on a single page, place it inthe page global.

<page sid="PAGE1"><global sid="global">

<ufv_settings><savewithformaterrors>deny</savewithformaterrors>

</ufv_settings></global>...XFDL items...

</page>

If you want savewithformaterrors to apply to only a single button, you mustimplement it in a compute that references the save button you want to affect. Thefollowing example shows a compute that toggles between permit and deny basedon the activated state of a save button. This ensures that users are denied theability to save a form that contains format errors unless they are using thespecified save button.

<ufv_settings><savewithformaterrors compute="toggle( &#xA;

page1.saveButton.activated,'off', 'on') == '1' ? 'permit' : &#xA;'deny'"></savewithformaterrors>

</ufv_settings>

A form with this setting will deny printing until the page1.saveButton is clicked.When that button is clicked, the form will toggle to permit and will save even ifthere are type checking errors. Once saving is complete, the setting will toggle backto deny.

scrollfieldsonzoom

The following example shows how to turn the scroll bars off.

280 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 287: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<ufv_settings><scrollfieldsonzoom>off</scrollfieldsonzoom>

</ufv_settings>

signwithformaterrors

The following examples show how to prevent users from signing a form until allerrors have been corrected.

To apply signwithformaterrors to all of the sign buttons in your form, place thesetting in the form global.

<globalpage sid="global"><global sid="global">

<ufv_settings><signwithformaterrors>deny</signwithformaterrors>

</ufv_settings></global>

</globalpage>

To apply signwithformaterrors to all the sign buttons on a single page, place it inthe page global.

<page sid="PAGE1"><global sid="global">

<ufv_settings><signwithformaterrors>deny</signwithformaterrors>

</ufv_settings></global>...XFDL items...

</page>

If you want signwithformaterrors to apply to only a single button, you mustimplement it in a compute that references the signature button you want to affect.The following example shows a compute that toggles between warn and denybased on the activated state of a signature button. This ensures that users aredenied the ability to sign a form that contains format errors unless they are usingthe specified signature button.

<ufv_settings><signwithformaterrors compute="toggle( &#xA;

page1.signButton.activated,'off', 'on') == '1' ? 'warn' : &#xA;'deny'"></signwithformaterrors>

</ufv_settings>

A form with this setting will deny signing until the page1.signButton is clicked.When that button is clicked, the form will toggle to warn and will alert users toformatting errors, but still allow them to sign the form. Once the form is signed,the setting will toggle back to deny if the ufv_settings has not been signed. Toexclude this compute from the signature button, you must omit it from thesignature. One way to do this is to omit ufv_settings from the signoptions filter inthe signature button. For example:

<signoptions><filter>omit</filter><optionrefs>ufv_settings</optionrefs>

</signoptions>

submitwithformaterrors

The following examples show how to prevent the users from submitting the formuntil all errors have been corrected.

XFDL Version 7.7 281

Page 288: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

To apply submitwithformaterrors to all of the submit buttons in your form, placethe setting in the form global.

<globalpage sid="global"><global sid="global">

<ufv_settings><submitwithformaterrors>deny</submitwithformaterrors>

</ufv_settings></global>

</globalpage>

To apply submitwithformaterrors to all the submit buttons on a single page, placeit in the page global.

<page sid="PAGE1"><global sid="global">

<ufv_settings><submitwithformaterrors>deny</submitwithformaterrors>

</ufv_settings></global>...XFDL items...

</page>

If you want submitwithformaterrors to apply to only a single button, you mustimplement it in a compute that references the submit button you want to affect.The following example shows a compute that toggles between permit and denybased on the activated state of a submit button. This ensures that users are deniedthe ability to submit a form that contains format errors unless they are using thespecified submit button.

<ufv_settings><submitwithformaterrors compute="toggle( &#xA;

page1.submitButton.activated,'off', 'on') == '1' ? 'permit' : &#xA;'deny'"></submitwithformaterrors>

</ufv_settings>

A form with this setting will deny submitting until the page1.submitButton isclicked. When that button is clicked, the form will toggle to permit and will submiteven if there are type checking errors. Once submitting is complete, the setting willtoggle back to deny.

validoverlap

The following example shows how to create a setting that allows signed items tooverlap unsigned items by 4 pixels or less.

<ufv_settings><validoverlap>4</validoverlap>

</ufv_settings>

Usage Details1. The default values for the ufv_settings are:v color – watermelon (255, 128, 128)v cursor – question

v backgroundcolor – blue (#0000FF)v foregroundcolor – white (#FFFFFF)v mandatoryColor – light yellow (255, 255, 208)v menuSettings – for the toolbar and its icons is on

v modifiableSettings – on

v pagedonewithformaterrors – warn

282 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 289: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v printwithformaterrors – warn

v savewithformaterrors – warn

v scrollfieldsonzoom – By default, scroll bars are added to fixed height fieldswhen necessary.

v signwithformaterrors – warn

v submitwithformaterrors – deny

v validoverlap – 2 pixels2. All ufv_settings can be changed by computes in the form. The following

example shows how a form can be set to read-only using a compute. In thisexample, the custom option opt_1 will set modifiable to off once the form hasbeen submitted.

<button sid="SubmitForm"><value>Submit Form</value><type>submit</type><custom:opt_1 xfdl:compute="toggle(activated,'off','on') == &#xA;

'1' ? set('global.global.ufv_settings[modifiable]', &#xA;'off'):''"></opt_1>

</button>

Note that the ufv_settings option is a form global option in the XFDLnamespace, and is referenced using the following syntax:

global.global.ufv_settings[element][setting]

For example, to reference the setting for the Open control bar button, you use:global.global.ufv_settings[menu][open]

3. submitwithformaterrors

Important: If you are using an XForms submit, submitwithformaterrors isnot evaluated.

4. validoverlap

v The overlap test looks for signed items that overlap unsigned items. Youshould always follow the best practice of signing as much of the form aspossible. This means that if your form is failing the overlap test, you shouldfirst consider whether you can sign additional items to correct this problem.

v Lines can often cause problems. In general, you should either sign all linesin the form, or sign none of the lines in the form. This will help you avoidproblems with lines that overlap each other. If you choose to sign none ofthe lines in the form, you may need to adjust the placement of some linesto prevent them from overlapping with other items, such as fields. Whilethis may seem like a lot of work, it’s preferable to signing the overlappingline. Signing the line may create more problems than it solves, as the linemay overlap with a number of other lines, which may overlap with furtherlines, and so on. Because of the work involved in determining which linesneed to be signed, it’s best to avoid this scenario if possible.

Because the unsigned items might be moved later to reveal information thatchanges the meaning of the form, the overlap test prevents the user fromsigning these forms. However, in some cases the overlap is very slight, andshould be allowed. If you still find that you cannot sign your form because ofoverlapping items, you should adjust the validoverlap setting by smallincrements (such as 1 or 2 pixels) until you can successfully sign the form oruntil you reach an overlap of 8 pixels.

Note: Never set the validoverlap to allow more than 8 pixels of overlap. Ifyou find that you still cannot sign your form with an overlap of 8 pixels, you

XFDL Version 7.7 283

Page 290: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

should redesign your form so that the items do not overlap as much. Using alarger validoverlap increases the risk that a malicious user could successfullymodify a signed form.

5. The validoverlap can be set as low as 0 pixels. The default of 2 pixelsaccounts for the size of a border, which is included in the size of each itemeven if the border is not drawn.

6. The appearance of the helpcursor relies on the Window settings. Individualusers can use those settings to change the appearance of the cursor.

7. The following settings exclude error assessment for XFDL items that have theapplywithinvisble set to off:v pagedonewithformaterrors

v signwithformaterrors

v submitwithformaterrors

v printwithformaterrors

8. The following settings do not affect predictive type checking:v printwithformaterrors

v savewithformaterrors

v submitwithformaterrors

v signwithformaterrors

When these settings are in use, type checking will continue to occur as theuser types.

9. Disabling scrollfieldsonzoom may limit the functionality of the form whenthe user zooms. This feature overrides any setting in the Viewer’s preferencesform. Use this feature only in the form global setting; it does not work in thepage global setting.

10. The focusbgcolor and focusfontcolor options are only available forIBM LotusForms Server – Webform Server.

284 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 291: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

urlProvides the url to a target, such as a file or application.

Items containing this option must have a type option setting of link, replace,submit, done, or pagedone.

The object identified must be one of the following:v File – Used with a type option of link or replace. The file identified is

downloaded, and either displayed or saved. Examples of such files are images,word processing documents, and XFDL forms.

v Application – Used with a type option of submit or done. The applicationidentified is initiated. A form processing application, such as a cgi or a servlet, isan example of such an application.

v Item – Used with a type option of pagedone. The item identified, on the pageidentified, receives focus. The item must be on another page.

v Form or Page Globals – Used with a type option setting of pagedone. The focusmoves to the first item on the page when the new form or page appears. Theform globals reference is global.global. The page globals reference is <pagesid>.global for another page

v email Address – Used with a type option of submit, done, link, or replace. Witha submit or done type, the form is attached to an email message, and thatmessage is sent to the address in the url. With a link or replace type, an emailmessage is created and sent, but the form is not attached to the message.Depending on the settings you use, the user may be able to add additionalinformation to the email.

Syntax

Table 133. URL parameters

Parameter Type Description

the URL string Identifies the target. Can be oneof:

v A URL with the format:scheme://host.domain[:port]/path/file name for files andapplications. Scheme is restrictedto http or https.

v A URL with a mailto format. See″URLs for email″ below forfurther information.

v #item reference for the next itemin the form to receive focus.

Available in

action, button, cell

<url>the URL</url>

Note: item reference can be an item, form or page global reference.

XFDL Version 7.7 285

Page 292: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

This sample identifies a file to link to or replace:<url>C:\temp\myFile.xml</url>

This sample identifies a form processing application:<url>http://www.host.domain/cgi-bin/recv_status</url>

This sample identifies a page to display:<url>#PAGE2.global</url>

This sample creates an email message that is sent automatically because it containsall of the necessary parameters. Note that the URL is enclosed in the CDATAconstruct because it contains ampersands (&).

<url><![CDATA[mailto:[email protected]?&subject=Hello&body=Hello.+How+are+you?]]></url>

This sample creates an email message that appears to the user before sending,allowing the user to change the parameters.

<url>mailto:[email protected]</url>

URLs for email

URLs that provide an email address must follow this general format:mailto:address?parameter=setting&parameter=setting...

The first parameter follows the question mark (?) symbol, while each additionalparameter is added using the ampersand (&) symbol.

For example, a URL using all parameters would look like this:mailto:setting?to=setting&cc=setting&bcc=setting&subject=setting&body=setting&filename=setting

The following table lists the available parameters and their settings:

Table 134. URLs for email

Parameter Setting Description

mailto:

to=

cc=

bcc=

string A complete email address, such as [email protected]. Toinclude additional addresses, use the appropriateparameter twice. For example, to add two cc addresses,use the cc= parameter twice as shown:

mailto:[email protected][email protected]&[email protected]

Note that the first address, immediately after the mailto:parameter, is the first recipient. Additional recipients arespecified using the to= parameter.

subject= string The subject line of the email. The text must conform tostandard URL encoding rules, such as replacing spaceswith the plus (+) symbol.

body= string The body of the email. The text must conform tostandard URL encoding rules, such as replacing spaceswith the plus (+) symbol.

286 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 293: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 134. URLs for email (continued)

Parameter Setting Description

filename= string The name you want to give to the file that is attached tothe email message. If you do not set this parameter, adefault file name will be assigned.

If you provide the mailto:, cc=, bcc=, subject=, and body= parameters, the emailwill be sent automatically and the user will not be able to modify the message.This is true even if the parameters are set to nothing. For example, the followingURL would mail the message automatically:

mailto:[email protected]?cc=&bcc=&subject=Hello&body=Hello+Tim&body=

If you leave out any of those parameters, the user will see the email messagebefore it is sent, and will be able to change the email.

Note: The ampersand is a restricted character in XML. As such, you must eitheruse an entity reference (&amp;) or enclose the mailto URL in a CDATA sectionwhen using the ampersand. See below for an example that uses CDATA.

Usage details1. Default: none

2. You can only list a single URL.3. When using a file object, you can use relative or absolute path to define the file

location.

Important: For security purposes, link and replace only allow files to beplaced in the same directory or subdirectory as the form.

4. You can create a URL that includes computed values, as shown:<url compute="PAGE1.FIELD1.value"></url>

5. You can create a URL that includes user input as part of the URL string. Ensurethat you concatenate (+.) the elements of the string. Additionally, you mustcontain the email parameters (mailto, &subject, and so on) within quotationmarks. For example:

<url compute="'mailto:' +. to_field.value +. &#xA;'&amp;subject=' +. subject_field.value +. '&amp;body=' &#xA;+. body_field.value></url>

6. If you have specified an HTML transmitformat in a form, the form sends its dataas HTML when it communicates with a server. Information transmitted inHTML is URL-encoded. Therefore, for forms transmitted in HTML, you mustreplace all non alpha-numeric characters with a character triplet consisting ofthe % character followed by two hexadecimal digits. These hexadecimal digitsare derived from the ASCII code for the original character. The hexadecimaldigits are ″0123456789ABCDEF″. For example:

Table 135. URL-encoded triplet and ASCII code replacements for HTML characters

Character ASCII Code URL-encoded triplet

<space> 32 %20

\r 13 %0D

Applications receiving form data must check the content type of the incomingdata to see whether it is url-encoded.

XFDL Version 7.7 287

Page 294: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

valueReflects the contents of an item.

Visually, this can take several forms, depending on the item to which it applies.For example, the value option in label items contains the label text; the value optionin radio items contains a status indicator; and the value option in list items containsthe scope identifer (sid) of the most recently selected cell (if it was a select cell).

An item’s contents will be stored in the form whenever a user saves the form orsubmits it for processing. This is true even for inactive items and items using thedefault value option setting (in this case, a value option containing the defaultsetting is added to the item’s definition).

Syntax

Table 136. value parameter

Parameter Type Description

setting string The item’s contents

Available in

button, cell, check, checkgroup, combobox, field, help, label, list, popup, radio,radiogroup, slider

Example

This sample identifies the text of a label item.<value>My Form Title</value>

Usage details1. Default: varies by item. Refer to the item in question for more information.2. Rich text fields use both the value and the rtf option to store the text of the

field. Refer to the rtf option for more information.3. Multiple line values need to have carriage returns inserted in the code. For

example:<value>This value spanstwo lines.</value>

4. To get the value of a cell that a user has selected from a list or popup,dereference it in the following manner:

page_tag.list_tag.value->value

For example:page1.countryPopup.value->value

When a user selects a cell from a list, the scope identifer (sid) of the cell isstored as the value of the list. Hence the dereference syntax.

5. If an item’s orientation is set to Right-To-Left (rtl), then the text displayed bythe item’s value will be displayed Right-To-Left, unless the direction option isapplied.

<value>setting</value>

288 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 295: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

visibleDefines whether or not the item is visible on the screen and can be printed.

Syntax

Table 137. vusible parameter

Parameter Type Description

status on Item can be seen on the screenand printed

off Item cannot be seen on the screenand will not print when the formis printed.

Available in

box, button, check, checkgroup, combobox, field, label, line, list, popup, radio,radiogroup, slider

Example

This sample shows how an item can be set to be visible at the user’s request.<check sid="SHOW_INSTRUCTIONS">

<value>off</value><label>Do you want to see the instructions?</label>

</check><label sid="INSTRUCTION_LABEL">

<visible compute="SHOW_INSTRUCTIONS.value=='on' ? &#xA;'on' : 'off'"></visible>

<value>Please complete all portions of this form.</value></label>

Usage details1. Default:v XFDL: on.v XForms: defaults to the relevant property for the data element to which the

containing item is bound.2. An XFDL item in an xforms:group, xforms:repeat, or xforms:case will not be visible

if:v The XFDL item containing the xforms:group, xforms:repeat, or xforms:case is not

visible.v The xforms:case is not selected.v The row containing the XFDL item (created by the xforms:repeat) is

non-relevant.These cases are true regardless of the visible option for that XFDL item, andregardless of whether the XFDL item itself contains XForms options.

<visible>status</visible>

XFDL Version 7.7 289

Page 296: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

webservicesEnables you to embed a Web Services Definition Language (WSDL) documentwithin a form. This makes the functions defined in the WSDL document availableto the form as though they were XFDL functions.

Syntax

Table 138. web services parameters

Parameter Type Description

webservice name string The name of the Web service.

wsdl n/a The WSDL document.

Available in

form global

Example<?xml version="1.0"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns:xforms="http://www.w3.org/2002/xforms"><globalpage sid="global">

<global sid="global"><webservices>

<wsdl name="name of webservice">...wsdl document...

</wsdl></webservices>

</global></globalpage>

Usage details1. To call a Web service message or function, you must use both the name of the

Web service package and the name of the message or operation. The packagename has two parts: the service name and the port type. These two parts areseparated by an underscore. The syntax of this call is:

<service_name>_<portType>.<message_name>

For example, the following reference calls the HelloWorld operation inside theService1 web service. It uses the Service1Soap port type:

Service1_Service1Soap.HelloWorld()

2. Web services must not include the underscore character ( _ ) in either service orport names, but can include it in operation names.

3. Web services must not use mandatory headers, as defined by thesoap:mustUnderstand tag.

4. Web services are restricted to the 46 primitive data types as defined by schema.Third party extension to the primitive data types are not supported.

<webservices><wsdl name="webservice name">wsdl1</wsdl>...<wsdl name="webservice name">wsdln</wsdl>

</webservices>

290 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 297: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. Web services may use basic or digest authentication. In either case,authentication must be performed before calling any functions in the webservice. This is accomplished by calling the setNetworkPassword function,which is automatically created in a package with the same name as the webservice. Note that when calling the setNetworkPassword function, you need toinclude the service name, but not the port type. For example:

Service1.setNetworkPassword()

6. Web services do not support SSL.7. The functions provided by Web services support the use of XPath references.8. When used with XForms, Web services can be called through XForms

submissions.

XFDL Version 7.7 291

Page 298: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

writeonlySets a field to be write only. This means that the user can type into the field, butcannot read what is typed. Instead, each character is replaced by a uniform symbol(such as an asterisk).

This is useful if you are creating a password field.

Syntax

Table 139. writeonly parameter

Parameter Type Description

setting on the item is write only, whichmeans that each character isreplaced with a uniform symbol(such as an asterisk) to obscurethe input.

off the item displays input normally.

Available in

field

Example

The following example shows a field that is set to be write only:<field sid="writeOnlyField">

<value>You cannot type into this field.</value><writeonly>on</writeonly>

</field>

Usage details1. Default:v XFDL: off

v XForms: the xforms:secret option, if present.2. The xforms:secret option overrides the writeonly option, and forces the field to

be write only.

<writeonly>setting</writeonly>

292 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 299: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xformsenabledIndicates whether or not the XFDL item contains XForms controls.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 140. xformsenabled parameters

Parameter Type Description

setting on The XFDL item contains XFormscontrols

off The XFDL item does not containXForms controls

Available in

button, check, checkgroup, combobox, field, label, list, pane, popup, radiogroup,slider, table

If the XFDL presentation item is contained by an xforms:group, xforms:switch, orxforms:repeat, then xformsenabled also applies to box, line, radio, spacer.

Example

The following example shows an xformsenabled option.<xformsenabled>on</xformsenabled>

Usage details1. If a presentation item is a direct child of a page then the following rules apply:v If the presentation item does not have an XForms control or the XForms

control is not explicitly bound to a data element or nodeset then thexformsenabled option is on.

v If the XForms control is explicitly bound to a single data element then thexformsenabled option is on only if the XForms binding is non-empty and therelevant model item property of the data element evaluates to true.

v If the XForms control is explicitly bound to a nodeset then the xformsenabledoption is on only if the nodeset is not empty and at least one node in thenodeset has a relevant model item property that evaluates to true.

2. The xforms:group, xforms:switch, and xforms:repeat options override therelevance of any display elements they contain. As a result, if the XFDLpresentation item is contained by an xforms:group, xforms:switch, orxforms:repeat, then the following rules apply:v A container is the pane or table that a wraps an xforms:group, xforms:switch,

or xforms:repeat.v If the xformsenabled option of the container is off, then the xformsenabled

option of the child XFDL presentation item is off.

<xformsenabled>setting</xformsenabled>

XFDL Version 7.7 293

Page 300: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v If the xformsenabled option of the container is on, then the xformsenabledoption of the child XFDL presentation item follows the same rules as a directchild of a page.

3. The xformsenabled option is only created if it is directly referenced. Forexample, it is created if it is referenced by a compute.

4. XFDL properties can use the xformsenabled option in a compute such as<display compute="xformsenabled"/>

294 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 301: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xformsreadonlyIndicates to the XFDL compute system whether or not the bound XForms instancedata is read-only.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 141. xformsreadonly parameters

Parameter Type Description

setting on The bound XForms item isread-only.

off The bound XForms item is notread-only. The setting is also off ifno binding exists or if the bindingresolves to an empty nodeset.

Available in

button, check, combobox, field, label, list, popup, table, pane, checkgroup,radiogroup, slider

Example

The following example shows an xformsreadonly option.<xformsreadonly>on</xformsreadonly>

Usage details

The setting is always off in tables and panes.

<xformsrequired>setting</xformsrequired>

XFDL Version 7.7 295

Page 302: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xformsrequiredIndicates to the XFDL compute system whether or not the bound XForms instancedata is required to have a value.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 142. xformsrequired parameters

Parameter Type Description

setting on The bound XForms item musthave a value.

off The bound XForms item is notrequired to have a value. Thesetting is also off if no bindingexists or if the binding resolves toan empty nodeset.

Available in

button, check, combobox, field, label, list, popup, table, pane, checkgroup,radiogroup, slider

Example

The following example shows an xformsrequired option.<xformsrequired>on</xformsrequired>

Usage details

The setting is always off in tables and panes.

<xformsrequired>setting</xformsrequired>

296 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 303: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xformsvalidIndicates to the XFDL compute system whether or not the bound XForms instancedata meets XForms validity requirements.

This option is not saved or transmitted as part of the form. Instead, it isautomatically created each time the form is read into memory, and is maintainedonly during display or processing.

Syntax

Table 143. xformsvalid parameters

Parameter Type Description

setting on The bound XForms item is valid.The setting is also on if nobinding exists or if the bindingresolves to an empty nodeset.

off The bound XForms item is notvalid.

Available in

button, check, combobox, field, label, list, popup, table, pane, checkgroup,radiogroup, and slider

Example

The following example shows an xformsvalid option.<xformsvalid>on</xformsvalid>

Usage details

The setting is always on in tables and panes.

<xformsvalid>setting</xformsvalid>

XFDL Version 7.7 297

Page 304: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<custom option>Allows form designers to add application specific information to the formdefinition. This is useful when submitting forms to applications requiringnon-XFDL information.

An example of non-XFDL information might be an SQL query statement. Customoptions must not be in the XFDL namespace.

Syntax

Example

This sample shows a custom option containing an SQL query.<sql:query

xmlns:sql="http://www.iso-standards.org/9075/2002/sqlxml"><!-- Content describing an SQL query -->

</sql:query>

This XML could be included in the definition of an item that triggers a formsubmission. Since the internal content can use XFDL computes to populate thequery based on form content from the user, the server-side processing would beable to perform a proper query and have the results used to populate a responseform.

Usage details1. The naming conventions for a custom option are as follows:v Custom options can have computed values by using the XFDL compute

attribute, which must be qualified with a namespace prefix associated withthe XFDL namespace URI.

v In order to make the XML content addressable by the XFDL compute system,the tag names of the custom option and any elements within it must conformto the XFDL syntax for a scope identifier.

Details on XForms optionsXForms options are required when you are creating an XFDL form that contains anXForms data model. XForms options link the XFDL items on the form to theXForms data model, so that the items and model share data.

XForms options belong to the XForms namespace. However, in most respects theseoptions are treated just like XFDL options. They are added to the syntax of theform at the same level, set particular characteristics for the containing item, andare recognized by the XFDL parser.

Despite this, XForms options do have some features that differ from XFDL options.This chapter describes these features and then details each of the XForms optionsseparately.

<option xmlns="http://www.ibm.com/xmlns/prod/XFDL/Custom"><!-- Arbitrary XML content -->

</option>

298 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 305: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XForms namespaceXForms options exist in the XForms 1.0 namespace, which is defined as:

http://www.w3.org/2002/xforms

By convention, XFDL uses the xforms prefix for this namespace, which is normallydeclared on the <XFDL> element of the form as shown:

<XFDL xmlns:xforms="http://www.w3.org/2002/xforms">

Linking input items to the XForms data modelItems are linked to the XForms data model through the XForms options theycontain.

For example, a field item might use the xforms:input option to link it to a specificelement in the data model.

For most input items, this link creates a relationship between the item’s valueoption and the data element, so that they share information. For rich text fields, thelink is between the data element and the rtf option, although the plaintext optioncan also be pushed to the data model by using an additional custom item.

Single node bindingWhen creating XForms options, most of the time you will also have to link thatoption to the XForms data model. For example, you might create a field in yourform that uses the xforms:input option. This option links the field to a particularelement or attribute in the instance data, so that the field and that element orattribute share data.

These links are created through a single node binding, which is expressed in oneof two ways:v As a ref attribute (with an optional model attribute).v As a bind attribute.

Using the ref attribute to create a single node bindingWhen you use the ref attribute to create a single node binding, you use an XPathreference to create a direct link between a display element in the form, such as afield, and a data element in the XForms model. The attribute is written as shown:

ref="XPath to data model element"

For example, you might have a field that includes the xforms:input option. Thisoption uses the ref attribute to link the contents of the field to an element in theXForms model, as shown:

<xforms:input ref="XPath to data model element">

By default, XPath expressions begin at the root element of the first instance in thedata model. For example, you might have the following data model:

<xforms:model><xforms:instance xmlns="">

<personnel><name></name><address></address><telephone></telephone>

<personnel></xforms:instance>

<xforms:model>

XFDL Version 7.7 299

Page 306: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

In this case, the XPath expression would begin at the <personnel> element, since itis the root element of the default instance in the data model. Thus, to link the<xforms:input> element to the <name> element in the model, you would use thefollowing expression:

<xforms:input ref="name">

Inheritance

Single node bindings that use the ref attribute are evaluated relative to the nearestexpressed single node binding. For example, consider the following XForms datamodel:

<xforms:model><xforms:instance xmlns="">

<root><x>

<y>5</y></x>

</root></xforms:instance>

</xforms:model>

Within the body of your form, you may have an xforms:group that contains a fieldwith an xforms:input. Both of these elements are bound to the data model, asshown:

<xforms:group ref="x"><field sid="Number">

<xforms:input ref="y"><xforms:label>Number:</xforms:label>

</xforms:input></field>

</xforms:group>

In this case, the xforms:group is evaluated relative to the root node of the datamodel, which in this case is <root>. This links the group to the <x> element. Thexforms:input, being a child of the xforms:group element, inherits its starting pointfrom the xforms:group and is evaluated relative to the <x> element. This links thexforms:input to the <y> element.

Some XForms elements have optional single node bindings. In these cases, if thebinding is not declared, then the children of that element inherit the same startingpoint as the element itself.

For example, consider the following xforms:group:<xforms:group ref="x">

<button sid="Submit"><xforms:trigger>

<xforms:label ref="submittext"/></xforms:trigger>

</button></xforms:group>

In this case, the xforms:trigger element inherits a starting point of <x> from thexforms:group. Since the xforms:trigger does not declare a single node bindingitself, the xforms:label also inherits a starting point of <x> from the xforms:group.

Absolute References

Absolute references are preceded with a slash, and begin with the root element ofthe data instance. For example, consider the following instance:

300 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 307: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:model><xforms:instance xmlns="">

<root><a>

<b>5</b></a><c>

<d>10</d></c>

</root></xforms:instance>

</xforms:model>

To create an absolute reference to the <d> element, you would write:/root/c/d

Additionally, absolute references override all inheritance rules. For example,consider the following xforms:group element:

<xforms:group ref="a"><field sid="Number1">

<xforms:input ref="b"><xforms:label>First Number:</xforms:label>

</xforms:input></field><field sid="Number2">

<xforms:input ref="/root/c/d"><xforms:label>Second Number:</xforms:label>

</xforms:input></field>

</xforms:group>

In this case, the reference for the first xforms:input is evaluated from the <a>element because it inherits this starting location from the xforms:group. However,the reference for the second xforms:input overrides that inheritance and links tothe <d> element.

Multiple Models

If you are using multiple models in your form, all references will default to thefirst model. To refer to a different model, you must use a model attribute alongwith your ref attribute. The model attribute is written as shown:

model="model ID"

The model ID is determined by the id attribute on the xforms:model tag. Forexample, consider the following data model:

<xforms:models><xforms:model>

...</xforms:model><xforms:model id="m2">

<xforms:instance xmlns=""><root>

<x>5</x></root>

</xforms:instance></xforms:model>

</xforms:models>

In this case, the first model is not assigned an ID, but the second model is. Tocreate a reference to the x element in the second model, you must use both the refand model attributes, as shown:

XFDL Version 7.7 301

Page 308: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

ref="x" model="m2"

When you switch to the non-default model in this way, the reference is evaluatedfrom the root element of the first data instance in that model. In other words,inheritance from a previous single node binding to a different model is ignored.

Using the bind attribute to create a single node bindingWhen you use the bind attribute to create a single node binding, you are creatingan indirect link between a display element in the form, such as a field, to a dataelement in the XForms model. To do this, you link the element in the form to a<bind> element in the data model using that element’s ID. This linking is thenautomatically extended to the data element that the <bind> affects.

For example, consider the following data model:<xforms:model>

<xforms:instance xmlns=""><root>

<a/><b/><c/>

</root></xforms:instance><xforms:bind id="hypotenuse" nodeset="c">

<xforms:bind calculate="power(../a * ../a + ../b * ../b, 0.5)"/></xforms:bind>

</xforms:model>

In this case, the <a> and <b> elements hold the length of the sides of a triangle.The <bind> element then calculates the hypotenuse and sets that value in the <c>element. You might link an xforms:input to this bind, as shown:

<field sid="Number"><xforms:input bind="hypotenuse">

<xforms:label>Number:</xforms:label></xforms:input>

</field>

In this case, the xforms:input is linked to the identified bind, which in turn linkthe xforms:input to the <c> element in the data instance. This means that the fieldand the <c> element would share data.

Nested Binds

When creating a single node binding, you cannot link to nested binds. You canonly link to the outermost bind in any nested structure.

Inheritance

single node bindings that are created using the bind attribute do not inheritstarting locations from other single node bindings (unlike single node bindingscreated using the ref attribute).

Nodeset bindingA nodeset binding links an element in the form to a set of data elements.

For example, xforms:repeat options always bind to a collection of rows in the datamodel, with each row representing a row in a table.

302 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 309: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Nodeset bindings operate in all ways like single node bindings, except that theyreturn a set of nodes rather than a single node. For more information about singlenode bindings, refer to “Single node binding” on page 299.

Bindings and relevanceThe relevance of display elements is determined based on their binding.

For example, if a field in the form is bound to element <x> in the data model, thenthat field inherits its relevance from element <x>. If an item becomes non-relevant,then its visible and active options default to off.

The xforms:group, xforms:switch, and xforms:repeat options override therelevance of any display elements they contain.

For example, consider the following xforms:group:<xforms:group ref="x">

<field sid="Number1"><xforms:input ref="../y">

<xforms:label>First Number:</xforms:label></xforms:input>

</field><field sid="Number2">

<xforms:input ref="../z"><xforms:label>Second Number:</xforms:label>

</xforms:input></field>

</xforms:group>

In this case, the relevance of the group as a whole is determined by the <x>element. This means that if <x> is not relevant, then neither of the fields areconsidered relevant regardless of that status of <y> or <z> (which may be relevanteven if <x> is not because they are siblings of <x>).

Furthermore, if an xforms:repeat is bound to a nodeset that contains no relevantnodes, then the visible and active options of the containing table default to off.

This overriding behavior ensures that grouped items are always displayed orhidden as a group, rather than as individual items.

Metadata sub-optionsMany of the XForms options support the inclusion of metadata sub-options. Thesesub-options are optional, and provide information that is passed to the userinterface, including alerts and help messages.

Valid sub-options include:v Alert Settingv Hint Settingv Help Setting

Alert settingSets an alert message that is displayed to the user if they enter invalid information.

This is equivalent to the message setting in the format option. If both anxforms:alert and a message are provided for an item, then the message overridesthe xforms:alert.

XFDL Version 7.7 303

Page 310: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The alert setting follows this syntax:

Table 144. alert setting parameter

Parameter Type Description

single node binding string See “Single node binding” onpage 299.

alert text string The alert message. If the singlenode binding is provided, then itoverrides this message.

Hint setting

Provides a help message that is displayed to the user if they enter help mode. Thismessage is generally a short instruction, such as telling the user what format isvalid for a specific field, and is displayed as hover help.

This is equivalent to the help option. If an item contains both an xforms:hint and ahelp option, then the help option overrides the xforms:hint.

The hint setting follows this syntax:

Table 145. hint setting parameters

Parameter Type Description

single node binding string see “Single node binding” on page299.

hint text string the hint text. If the single nodebinding is provided, then itoverrides this message.

Help setting

Provides a help message that is displayed to the user if they enter help mode. Thismessage is generally longer than an xforms:hint, and is intended to providedetailed help to the user.

Although there is no direct equivalent in XFDL, xforms:help is treated like thehelp option, and is displayed as hover help when the user enters help mode.

If an item contains both an xforms:hint and an xforms:help, then the help isappended to the hint. Futhermore, if an item contains both an xforms:help and ahelp option, then the help option overrides the xforms:help.

The help setting follows this syntax:

<xforms:alert single_node_binding>alert text</xforms:alert>

<xforms:hint single_node_binding>hint text</xforms:hint>

304 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 311: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 146. help setting parameter

Parameter Type Description

single node binding string see “Single node binding” on page299.

help text string the help text. If the single nodebinding is provided, then itoverrides this message.

<xforms:help single_node_binding>help text</xforms:help>

XFDL Version 7.7 305

Page 312: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xformsmodelsDefines one or more XForms data models in your form. Once defined, you can linkthe data in these models directly to the presentation layer of your form.

The <xformsmodels> tag can contain any number of XForms models, which inturn can contain any number of data instances. In general, you will use only oneXForms model, since multiple models do not share data or user interface bindings.

Each data instance contains an XML element. This can be any valid XML with asingle root, allowing you to re-use existing data models from other applications.Optionally, you can use the src attribute to load XForms instance data from anexternal source. In this case, the result is stored in the form once it is loaded.

Syntax

Notes:

v There can be any number of <xforms:model> elements, each containing its ownmodel.

v <xforms:bind> elements can nest to any depth.

<xformsmodels><xforms:model id="name1" schema="schema URIs"

functions="functions"><xsd:schema>schema1</xsd:schema>...<xsd:schema>scheman</xsd:schema><xforms:instance id="name1" xmlns="namespace"

src="source">instance1

</xforms:instance>...<xforms:instance id="namen" xmlns="namespace"

src="source">instancen

</xforms:instance><xforms:bind1 property_settings>

<xforms:bind1a property_settings>...

</xforms:bind>...

</xforms:bind>...<xforms:bindn property_settings/><xforms:submission1 submission_attributes/>...<xforms:submissionn submission attributes/>

</xforms:model>...<xforms:model id="namen" schema="schema URIs"

functions="functions">...

</xforms:model></xformsmodels>

306 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 313: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 147. xforms models parameters

Parameter Type Description

name string optional. An arbitrary name that you may assign toeach model and data instance. The firstmodel/instance is default, and does not require anID. All subsequent models and instances do.

All names assigned to id attributes must be globallyunique within the form.

namespace string optional. The namespace of the instance data. Allreferences to instance data must include anappropriate namespace prefix, unless you use theempty namespace (denoted by empty quotationmarks, ″″).

schema URIs string optional. A space-separated list of URIs that point toexternal XML schema files. These schemas areconstantly enforced within the XForms model.

This supports HTTP, HTTPS, and file URIs.

For example:

schema="http://myServer/.../mySchema.xfd"

File URI references depend on the location of theschema file:

v If the schema files are in the <Lotus Formsproduct>\schemas directory, use the xsf: prefix. Forexample:

schema="xsf:name.xsd xsf:address.xsd"

The Viewer’s default schemas directory is <ViewerInstall Dir>\schemas. Webform Server’s defaultschemas directory is <WebSphere ApplicationServer Install Dir>\AppServer1\java\bin\schemas.

v If the schema files are in the same directory as theform, reference them directly. For example:

schema="mySchema.xsd mySecondSchema.xsd"

This method can only be used in the Viewer. Itdoes not work in Webform Server.

Important: When referencing external schema files,you cannot combine reference methods. For example,if your space-delimited list of schemas contains areference using HTTP, you cannot include anotherusing xsf.

functions string optional. A space separated list functions used bythe model. By default, all XForms 1.0 functions aresupported. This allows you to add support for thefollowing XForms 1.1 functions:

powercurrent

XFDL Version 7.7 307

Page 314: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 147. xforms models parameters (continued)

Parameter Type Description

schema schema optional. An XML schema that is embedded in theform. These schemas are constantly enforced withinthe XForms model.

src URI optional. Use this to point to an external file thatcontains the instance data.

This supports HTTP, HTTPS, and file URIs. RelativeURIs are evaluated based on the location from whichthe form was obtained.

When the document is retrieved from the Web,relative file locations are evaluated from thefollowing folder:

Documents and Settings\<user>\Application Data\PureEdge\xforms

instance XML optional. An arbitrary XML data instance with asingle root. This can be as simple or complex as youlike, as long as it is valid XML.

If the containing <xforms:instance> tag has an srcattribute, this instance data is ignored and theloaded data is used instead.

propertysettings

special sets properties for particular elements in the XFormsmodel. See below for more information.

submissionattributes

(see below)

Property Settings

The property settings allow you to set specific properties for elements in your datamodel. They follow this syntax:

Table 148. property settings parameters

Parameter Type Description

name string optional. An arbitrary name you assign to the bind.All names assigned to id attributes must be globallyunique within the form.

nodeset XPath an XPath expression defining which node or nodes inthe data model are affected. This links the propertiesto one or more elements in a data instance.

<xforms:bind id="name" nodeset="nodeset" property1 ... propertyn/>

Note:

v xforms:bind elements never contain data.

v an xforms:bind element can itself contain xforms:bind elements. Furthermore, thenodeset for the inner bind is evaluated relative to each node of the outer bind’snodeset.

308 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 315: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 148. property settings parameters (continued)

Parameter Type Description

property expression the property to apply to the indicated nodeset.Property attributes are expressed as follows:

property_name = setting

See the following section for more information.

Available Properties

The following list describes the properties you can set for a nodeset:

calculateApplies a calculation that sets the content of a node. This calculation iswritten as an XPath expression that is evaluated relative to a node in thebind’s nodeset.

For example, if you had a purchase order form, you might use thefollowing expression to set the value of the “total” node to equal the valueof the ″subtotal″ node plus the value of the “tax” node:

calculate="../subtotal + ../tax"

Do not link a data node with a calculation to a UI element that has a valueset by a an XFDL compute. When the XForms UI binding transfers data tothe UI element, the XFDL compute is destroyed.

constraintAllows you to set a constraint for a node. For example, you could specifythat the value of the node must be greater than one, or that it must notequal the value of a different node.

This property is set by any XPath expression that results in a Booleanvalue. True means the constraint has been met, false means it has not.

For example, the following expression would ensure that the value for theupperPage node was always greater than or equal to the value of thelowerPage node:

nodeset="pagination/upperPage"constraint=". &gt;= ../lowerPage"

If a constraint is set for a data node, and a different constraint is set for alinked UI element, then the validity of the data is determined byconsidering both settings. If the data is invalid for either setting, the datawill be considered invalid overall.

If a node is relevant (see below) and has a failed constraint, then anXForms submission is not permitted.

readonlySets whether the associated node is readonly. If a UI element is linked to areadonly node, then the UI element will also be readonly. However, if theUI element has the readonly option set, it will override the setting for thedata node.

This property is set by any XPath expression that results in a Booleanvalue. True means the node is readonly, false means the node is not.

For example, the following expression would make the associated nodereadonly:

XFDL Version 7.7 309

Page 316: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

readonly="true()"

relevantDetermines whether a node is relevant. Non-relevant nodes are omittedfrom XForms submissions. Additionally, if a UI element is linked to anon-relevant node, then that UI element is not displayed to the user.However, if the UI element has either the active or visible options set, theywill override the setting for the data node.

This property is set by any XPath expression that results in a Booleanvalue. True means the node is relevant, false means the node is not.

For example, the following expression would make the node relevant ifanother node named “paymentType” had a value of “credit”:

nodeset="creditCardNumber"relevant="../paymentType = 'credit'"

requiredSets whether the node requires input. If a UI element is linked to arequired node, then the UI element inherits the setting. Furthermore, if thenode does not require input, but a linked UI element does, then input isstill required.

This property is set by any XPath expression that results in a Booleanvalue. True means the node is required, false means the node is not.

For example, the following expression would set the node to require input:required="true()"

If a relevant (see above) data node is required but empty, then an XFormssubmission in not permitted.

type Sets the data type of the node. The valid data types are defined by XMLschema.

For example, the following expression sets the node to a date type:type="xsd:date"

If the data type set for the node conflicts with the data type set for a linkedUI element, then the validity of the data is determined by considering bothsettings. If the data is invalid for either setting, the data will be consideredinvalid overall.

For example, if you set a data node to be type int and you set a linkedXFDL field to be type string, then typing in ″abc″ (a valid XFDL string)would still result in an error, since it does not match the int type.

If a relevant (see above) data node’s content does not match its type, thenan XForms submission is not permitted.

Available Data Types

XML Schema defines a group of data types that can be used with the<xforms:model> tag. This includes the following commonly used types:v xsd:booleanv xsd:datev xsd:doublev xsd:integer

310 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 317: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

For more information about the available data types, refer to the XML Schemaspecification as published by the W3C.

Submission Attributes – xforms:submission

Submissions are defined by a set of attributes on an <xforms:submission> tag. Thisallows you to control the submission, setting where it goes, how it is formatted,and so on. The <xforms:submission> tag must be placed inside the<xforms:model> tag, but outside of the data instances contained in the model.

The <xforms:submission> tag follows this format:

Table 149. submission attribute parameters

Parameter Type Description

name string An arbitrary name that you assign to thesubmission. All names assigned to id attributesmust be globally unique within the form.

single_node_binding string Sets the root node for the submission. This nodeand all of its children are submitted. The nodemust be part of the same model in which thexforms:submission appears. This binding isoptional. If the submission does not contain asingle node binding, then the default instance ofthe default data model is sent.

For more information about single node bindings,refer to “Single node binding” on page 299.

method string Determines the submission method used. Set toone of the following:

v put — serializes the data in the XForms modelas XML. No response is expected (this isgenerally used with a file URL).

v post — serializes the data in the XForms modelas XML.

v get — serializes the data in the XForms modelusing URL encoding (x-www-form-urlencoded).

media MIME type Optional. Overrides the default MIME type forthe submission. If this is not set, the submissiondefaults to application/xml.

URL URL The URL to which the data is submitted. Thismust be a complete URL, and may use any of thefollowing schemes: http, https, or file.

<xforms:submission id="name" single_node_bindingmethod="method" mediatype="media" action="URLincludenamespaceprefixes="prefixes"replace="replace" instance="instanceID"targetref="targetXPath" serialization="serializeMethod"relevant="relevance" validate="validation"xfdl:actionref="dynamicURL" xfdl:updatemodel="update"/>

XFDL Version 7.7 311

Page 318: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 149. submission attribute parameters (continued)

Parameter Type Description

prefixes string A space separated list of namespace prefixes. Thedefinitions for these namespaces are includedwith the root node when the data is submitted. Ifno prefixes are listed, all prefixes inherited by theroot node are included. To include only thedefault namespace, use #default.

replace string Determines how the return data is handled. Set toone of the following:

v all — replaces the entire form with the returneddata.

v instance — replaces the entire instance.

v text — replaces the content of the target node.

v none — ignore the returned data.

instanceID string Optional. The ID of the instance to replace. If notprovided, defaults to the instance that containedthe submission data.

targetXPath string Optional. An XPath expression that indicates thetarget node for data replacement. If the replaceparameter is instance, the entire target node isreplaced by the submission result. If the replaceparameter is text, then the content of the targetnode is replaced by the submission result. Thetargetref is ignored for all other values of thereplace parameter.

serializeMethod string Optional. Controls how and whether to serializeinstance data. If present, must be none.

relevance string Optional. Controls whether or not non-relevantinstance data is submitted. If present, must be oneof:

v true — non-relevant instance data is excludedfrom the submission

v false — non-relevant instance data is includedin the submission

The default is false if serializeMethod is none,otherwise the default is true.

validation string Optional. Controls whether or not instance data isvalidated before submission. If present, must beone of:

v true — instance data is validated

v false — instance data is not validated

The default is false if serializeMethod is none,otherwise the default is true.

312 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 319: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 149. submission attribute parameters (continued)

Parameter Type Description

dynamicURL URL Optional. The element in the model which willprovide the URL to which the data is submitted.The URL in this element must be complete, andmay use any of the following schemes: http, https,or file.

If used, the URL found in the specified element isdefault. If no URL is found, then the URLprovided by the action attribute is used.Note: Dynamic URL support is limited. Youcannot submit the file to any of the followinglocations:

v the “Program Files” directory.

v the system drive or Windows system directories.

v temporary directories.

v a folder outside of the directory subtree thatcontains the originating file.

update string Optional. Specifies when you want the XFormsmodel to be updated after a submission. Possiblevalues are true, false, and defer.

v true — This is the default. The relevant modelupdate is performed immediately following thedata replacement

v false — No changes are made to the model as aresult of the submission

v defer — Defers updates until the top-levelcalling action is completed.

Available In

form global

Example

The following example creates a small XForms data model that contains the name,age, and birth date of a person. The model includes binds that set the age to be aninteger value and set the birth date to be a date value, as well as an submissionthat submits the entire instance.

<?xml version="1.0"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.1"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.1"xmlns:xforms="http://www.w3.org/2002/xforms"><globalpage sid="global">

<global sid="global"><xformsmodels xmlns="">

<xforms:model><xforms:instance>

<testmodel><name></name><age></age><birthdate></birthdate>

</testmodel></xforms:instance><xforms:bind nodeset="age" type="xsd:integer"/><xforms:bind nodeset="birthdate" type="xsd:date"/>

XFDL Version 7.7 313

Page 320: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:submission id="submitTest" method="post"action="http://www.testserver.com/cgi-bin/testscript"includenamespaceprefixes=""/>

</xforms:model></xformsmodels>

</global></globalpage>

Usage Details1. When using an XForms model, you must link the model to the presentation

layer of the form. You do this by adding other XForms options to the form,and then using single node and nodeset bindings to create these links.

2. If you are including an XForms model in your form, you must declare theXForms namespace. In general, you should declare this on the XFDL node, asshown:

<XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.1"xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.1"xmlns:xforms="http://www.w3.org/2002/xforms">

3. When writing the XPath expression for a constraint, you must express the lessthan and greater than symbols as character references (&lt; and &gt;respectively) or they will be confused with the opening and closing symbolsfor the tag.

4. Each data model can have any number of xforms:submissions. This is usefulif you need to submit different data at given times, or if you need to submitthe same data to different servers.

5. There are two ways to trigger a submission:v Create a submission button using the xforms:submit option. For more

information, refer to “xforms:submit” on page 339.v Create a submission button using an xforms:trigger and one or more

xforms:send actions. For more information, refer to “Details on XFormsactions” on page 347.

6. The <xforms:model> portion of the xformsmodels option can trigger XFormsactions using the xforms-model-construct, xforms-model-construct-done,xforms-model-destruct, and xforms-ready events. For more information, referto “Details on XForms event handlers” on page 367.

7. The <xforms:submission> portion of the xformsmodels option can triggerXForms actions using the xforms-submit, xforms-submit-done, andxforms-submit-error events. For more information, refer to “Details onXForms event handlers” on page 367.

8. Action handlers for xforms-submit-done and xforms-submit-error aresupported only for replace=instance and replace=none type submissions.

9. For SOAP submissions, use a method of post and the following MIME type inthe mediatype attribute:

application/soap+xml; action=Some Action;[charset=x]

Where you provide the name of the action and optionally supply a characterset.If the root element of the submitted data is in the SOAP 1.1 namespace(http://schemas.xmlsoap.org/soap/envelope/) then the content-type used istext/xml rather than the given mediatype, the charset parameter is preserved,and the SOAP Action header is added with a value of Some Action.

10. If an element in the XForms data model is both empty and invalid, then anyitem on the form that is bound to that element is set to be mandatory.

314 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 321: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

11. You can create an XForms version of Smartfill by creating submissions thatsave and load instance data to a file on the user’s computer. To create a “saveuser data” submission, you must include a submission id, an action thatpoints to the xml file that will contain the data, a “put” method to place thedata in the file, a reference to the instance containing the data, and an instancereplace of none. For example:

<xforms:submission id="saveName" action="file:savedata1.xml" method="put"ref="name" replace="none"></xforms:submission>

To create a ″load user data″ submission, you must include a submission id, anaction that points to the xml file that contains the user data, a “get” method toload the data into the data model, a reference to the instance that will containthe user data, and replace the entire instance. Furthermore, to ensure that thenew data is displayed in the form, you must create an xforms:setvalue action.For example:

<xforms:submission id="loadName" action="file:savedata1.xml" instance="name"method="get" replace="instance"><xforms:setvalue ref="name" value="instance('name')"

ev:event="xforms-submit-done"/></xforms:submission>

XFDL Version 7.7 315

Page 322: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:group

This option groups the items that are contained within a pane item.

Syntax

Table 150. xforms group parameter

Parameter Type Description

single node binding string Optional. See “Single nodebinding” on page 299.

Available in

pane

Example

The following example shows a pane item with a group of fields that store theuser’s address:

<pane sid="address"><xforms:group ref="customerData/address">

<field sid="Street"><xforms:input ref="street">

<xforms:label>Street:</xforms:label></xforms:input>

</field><field sid="City">

<xforms:input ref="city"><xforms:label>City:</xforms:label>

</xforms:input></field><field sid="Country">

<xforms:input ref="country"><xforms:label>Country:</xforms:label>

</xforms:input></field>

</xforms:group></pane>

Usage details1. If the group has a single node binding, and it resolves to an empty nodeset or a

non-relevant node, then the xforms:group provides a default of false to thepane item’s visible option. However, if it resolve to a relevant node, then thedefault visibility is true.

<xforms:group single_node_binding>...items in group...

</xforms:group>

316 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 323: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:inputLinks a field, combobox or check box to an element in the data model so that theyshare data. However, the xforms:input only support a single line of data.

For example, if you added an xforms:input option to a field in your form, youcould use that option to link the field to a name element in your data model. Oncelinked, any changes made to the data in one would be reflected by the other.

This option is only available if you are using an XForms data model.

Syntax

Table 151. xforms input parameters

Parameter Type Description

single node binding string see “Single node binding” on page299.

label text string sets the text for the item’s built-inlabel, as well as the accessibilitymessage for the item. Althoughthe xforms:label tag must appear,you can use an empty string ifyou do not want to set the label.

If the item also has a label oracclabel option, they will overridethis setting.

Alert, Hint, Help Setting metadata see “Metadata sub-options” onpage 303.

Available in

check, combobox, field, custom

Example

The following code shows an XForms model that contains a name, age, and birthdate element:

<xformsmodels><xforms:model>

<xforms:instance id="test"><testmodel>

<name></name><age></age><birthdate></birthdate>

</testmodel></xforms:instance>

</xforms:model></xformsmodels>

<xforms:input single_node_binding><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:input>

XFDL Version 7.7 317

Page 324: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using that data model, the following code links a field to the name element in thedata model, so that they share data:

<field sid="nameField"><xforms:input ref="name">

<xforms:label>Name:</xforms:label></xforms:input>

</field>

Once you have a basic field, you can add a help message to it. In the followingexample, the <xforms:hint> element is used to provide some simple help for theuser:

<field sid="nameField"><xforms:input ref="name">

<xforms:label>Name:</xforms:label><xforms:hint>Enter your full name.</xforms:hint>

</xforms:input></field>

You can also add an alert, in case the user enters the wrong type of data. Forinstance, the following example creates a field that links to the age node in thedata model above and has a data type of integer. Additionally, there is an alert thatwill appear if the user tries to enter the wrong data type:

<field sid="ageField"><xforms:input ref="age">

<xforms:label>Age:</xforms:label><xforms:alert>You must enter an integer value.</xforms:alert>

<xforms:input><format>

<datatype>integer</datatype></format>

</field>

To get the user’s birth date, you can use a combobox instead of a field. In this case,we will create a combobox with no cells, and set the value option using the datefunction. This causes the combobox to display a date picker widget when opened.

<combobox sid="birthdate"><xforms:input ref="birthdate">

<xforms:label>Birthdate:</xforms:label></xforms:input><format>

<datatype>date</datatype></format><group>date</group>

</combobox>

Usage details1. This option limits a field to a single line of input. To create a field that accepts

more input, use the xforms:textarea option instead.2. When using xforms:input with a check box item, the on or off values of the

check box are translated into a Boolean true or false (xsd:boolean) when copiedto the data model.

3. When using xforms:input with a combobox item, the combobox must have anXFDL data type of date.

4. Any item with an xforms:input option can trigger XForms actions using thexforms-value-changed event. For more information, refer to “Details on XFormsevent handlers” on page 367.

318 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 325: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

5. When you add an xforms:input to a custom item, it works just as though it wasplaced in a valid XFDL item. This means that a value option is created and islinked to the data model.

6. Pressing the Enter key in a single line field will commit the value that has beentyped to the form. This means it will be copied to the XForms model.

XFDL Version 7.7 319

Page 326: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:outputLinks a button or a label to information in the XForms data model. This allowsyou to display images or text from the data model on the face of a button or label.

If you use this to link to an image in the data model, that image must be base64encoded.

Syntax

Table 152. xforms output parameter

Parameter Type Description

single node binding string Optional. See “Single nodebinding” on page 299.

XPath XPath Optional. An XPath reference thatsets the value for the output. Thisis useful for performing simplecalculations on one or more dataelements. For example, you mightadd two data elements together.

The XPath reference is evaluatedrelative to the root node of thedefault instance. If a single nodebinding is provided, this attributeis ignored.

mediatype MIME type If the XPath parameter refers toimage data, you must include thisparameter to specify the MIMEtype of the image.

Note that only image MIME typesare valid.

label text string Sets the text for the value optionof the button or label, as well asthe accessibility message for theitem. Although the xforms:labeltag must appear, you can use anempty string if you do not wantto set the label.

If the item also has an acclabeloption, it will override thissetting.

Alert, Hint, Help Setting metadata See “Metadata sub-options” onpage 303.

<xforms:output single_node_binding value="XPath" mediatype="MIME type"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:output>

320 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 327: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Available in

label

Example

The following example shows a label that uses the xforms:output option to link itto a total that is calculated in the data model. The label will then use this data asits value, and display it to the user.

<label sid="totalCost"><xforms:output ref="total"/>

</label>

Usage details1. Images in the data model must be base64 encoded before they can be linked

with the xforms:output option.2. The xforms:label is optional in an xforms:output. If provided, the value of the

xforms:output is prepended to the text from the single node binding of thexforms:output (if it has one). The concatenated value is then displayed by theXFDL label (unless the label displays an image).

3. Right justification affects only the text provided by the xforms:output. Any textprovided by an xforms:label is left justified.

4. The text provided by xforms:label does not affect the XFDL value option. Onlydata obtained by the signe node binding to the xforms:output is placed in theXFDL value. This means that the format option settings are applied to thexforms:output text, but not the xforms:label text. This allows you to create aleading label for other values, such as currency types.

5. Although xforms:output cannot be the immediate child of an XFDL button item,it can appear as a descendent through the xforms:trigger, xforms:submit, orxforms:upload options.

6. The value attribute can reference data in a non-default model if you wrap thexforms:output in an xforms:group and bind the group to the data model you wantto reference. For example, the following sample shows how to add the valuesof 2 nodes in the non-default model:

<pane sid="ModelChooser"><xforms:group model="x" ref="/data">

<label sid="Sum"<xforms:output value="a + b"/>

</label></xforms:group>

</pane>

XFDL Version 7.7 321

Page 328: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:rangeSets the range of values a user can select with a slider item.

Syntax

Table 153. XForms range parameters

Parameter Type Description

single node binding string See “Single node binding” onpage 299.

start integer or float The starting value for the range.

end integer or float The end value for the range.

step integer or float How much each increment in therange increases the total. Forexample, a step of one counts byones (1, 2, 3...) while a step of twocounts by twos (1, 3, 5...).

Available in

slider

Example

The following example shows and slider that allows the user to select any numberbetween 1 and 10:

<slider sid="rating"><xforms:range ref="rating" start="1" end="2" step="1">

<xforms:label>Rate this form on a scale of 1 to 10</xforms:label></xforms:range>

</slider>

Usage details1. Any item with an xforms:range option can trigger XForms actions using the

xforms-value-changed event. For more information, refer to “Details on XFormsevent handlers” on page 367.

<xforms:range single node binding start="start" end="end"step="step"><xforms:label>label text</xforms:label>

</xforms:range>

322 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 329: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:repeatCreates a template row of items for a table. These items are then duplicated foreach row the user adds to the table, and for each row of data that exists in theXForms data model.

Syntax

Table 154. xforms repeat parameters

Parameter Type Description

name string an arbitrary name that you assignto the table. All names assigned toid attributes must be globallyunique within the form.

nodeset binding string See “Nodeset binding” on page302.

index integer This determines which row of therepeat receives the focus initially.

Default: 1.

XFDL Items XFDL the XFDL items that shouldappear in each row of the table.This can include nested groupingitems, such as table and pane, aswell as non-XForms items, such asline.

Available in

table

Example

The following example shows a table that uses an xforms:repeat to create a row ofdata that you might find in a purchase order. This row contains: a popup that letsthe user select which item to purchase, a field that lets them enter a quantity forthe item, and a label that displays the cost of the item.

<table sid="itemsTable"><xforms:repeat nodeset="order/row">

<popup sid="Product"><xforms:select1 appearance="minimal" ref="product">

<xforms:label>Choose product</xforms:label><xforms:item>

<xforms:label>Widget</xforms:label><xforms:value>widget</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Gadget</xforms:label><xforms:value>gadget</xforms:value>

</xforms:item></xforms:select1>

<xforms:repeat id="name" nodeset_bindingstartindex="index">...XFDL items...

</xforms:repeat>

XFDL Version 7.7 323

Page 330: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</popup><field sid="Qty">

<xforms:input ref="qty"><xforms:label>Qty:</xforms:label>

</xforms:input></field><label sid="LineTotal">

<xforms:output ref="lineTotal"/></label>

</xforms:repeat></table>

Usage details1. To add or remove rows from a table, you must use the xforms:insert and

xforms:delete actions respectively. For more information about these actions, referto “Details on XForms actions” on page 347.

2. An xforms:repeat maintains an internal index that indicates which row has thefocus. When the focus is sent to the table, it automatically goes to the indexedrow. The index is one-based, so that the first row has an index of 1, the secondrow an index of 2, and so on. You can change the index by using thexforms:setindex action.

3. When using computes with a repeat, the following rules apply:v Computes written within a row may not reference elements in a different

row.v Computes written outside a row may not reference elements within a row.

4. If the nodeset binding of the xforms:repeat is empty or contains non-relevantnodes, then the xforms:repeat provides a default of false to the table’s visibleoption.

324 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 331: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:secretLinks a field to an element in the XForms data model, and makes the field writeonly.

This option is only available if you are using an XForms data model. If you are notusing an XForms model, use the writeonly option to create write only fields.

Syntax

Table 155. xforms secret parameters

Parameter Type Description

single node binding string See “Single node binding” onpage 299.

label text string Sets the text for the field’s built-inlabel, as well as the accessibilitymessage for the field. Leave thissetting empty for no label.

If the field also has either a labeloption or an acclabel option, thosesettings will override thexforms:label.

Alert, Hint, Help Setting metadata See “Metadata sub-options” onpage 303.

Available in

field

Example

The following code shows an XForms model that contains a password element:<xformsmodels>

<xforms:model><xforms:instance id="test">

<testmodel><name></name><age></age><birthdate></birthdate><password></password>

</testmodel></xforms:instance>

</xforms:model></xformsmodels>

Using that data model, the following code creates a write only field that links tothe password element:

<xforms:secret single_node_binding><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:secret>

XFDL Version 7.7 325

Page 332: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<field sid="passwordField"><xforms:secret ref="password">

<xforms:label>Password:</xforms:label></xforms:secret>

</field>

Usage details1. The xforms:secret must contain an <xforms:label> tag. Furthermore, any text in

the <xforms:label> tag will override the label option. If you do not want alabel, leave the <xforms:label> empty.

2. This setting overrides the writeonly option.3. If you link a secret field to a readonly data element, the user will not be able to

see or change the information in the field.4. Any item with an xforms:secret option can trigger XForms actions using the

xforms-value-changed event. For more information, refer to “Details onXForms event handlers” on page 367.

326 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 333: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:selectSets the choices that are displayed by a checkgroup or list when the user can selectone or more of the choices. When the form is processed, an individual check or cellitem is automatically generated to represent each choice.

Syntax

The xforms:select option has two different syntaxes, depending on whether thechoices are included in the option itself, or whether the choices are included in thedata model and linked by the option.

If you want to include the choices in the option itself, use the following syntax:

Table 156. xforms select parameters

Parameter Type Description

single nodebinding

string see “Single node binding” on page 299.

style string sets to one of the following values:

v full for a checkgroup

v compact for a list item

Default: compact.

label text string sets the text for a label that is displayed at thetop of the checkgroup. Leave this blank todisplay no label.

If the item also has a label option, it willoverride this setting.

label for choice string sets the text that is displayed for the choice.

value for choice string sets the value that is stored if the user selectsthis choice.

XFDL Options XFDL options adds specific XFDL options to the itemrepresented by the choice. For example, youmight want to add a type option to the choicesin a list, so that the cells that are generated bythose choices trigger actions.

<xforms:select single_node_binding appearance="style"><xforms:label>label text</xforms:label><xforms:item1>

<xforms:label>label for choice</xforms:label><xforms:value>value for choice</xforms:value><xforms:extension>XFDL Options</xforms:extension>

</xforms:item1>...<xforms:itemn>

...<xforms:itemn>Alert SettingHint SettingHelp Setting

</xforms:select>

Note: There can be any number of xforms:item elements.

XFDL Version 7.7 327

Page 334: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 156. xforms select parameters (continued)

Parameter Type Description

Hint, HelpSetting

metadata see “Metadata sub-options” on page 303.

If you want to include the choices in the data model, use the following syntax:

Table 157. available choices to add to the data model

Parameter Type Description

single node binding string see “Single node binding” on page299.

label text string sets the text for a label that isdisplayed at the top of thecheckgroup.

Leave this blank to display nolabel.

XPath to choices string an XPath reference to the elementsin the data model that provide thechoices. This defines the set ofitem’s that the checkgroup or listdisplays as choices. This referenceis relative to the XPath to elementreference.

For example, your data modelmay contain the followingelements that represent the choicesfor your item:

<choice show="US Dollars">USD</choice>

<choice show="CDN Dollars">CDN</choice>

<choice show="Euros">Euro</choice>

In this case, you would referencethose choices as:

choice

<xforms:select single_node_binding appearance="full"><xforms:label>label text</xforms:label><xforms:itemset nodeset="XPath to choices">

<xforms:label ref="XPath to label text"/><xforms:value ref="."></xforms:value><xforms:extension>XFDL Options</xforms:extension>

</xforms:itemset>Hint SettingHelp SettingAlert Setting

</xforms:select>

328 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 335: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 157. available choices to add to the data model (continued)

Parameter Type Description

XPath to label text string an XPath reference to the labeltext for each choice. This text isincluded in your data model asattributes on the data elementsthat contain your choices. Thisreference is relative to the XPathto choices reference.

For example, your data modelmay contain the followingelements that represent the choicesfor your checkgroup:

<choice show="US Dollars">USD</choice>

<choice show="CDN Dollars">CDN</choice>

<choice show="Euros">Euro</choice>

In this case, your would referencethe show attributes that containthe text that describes thatelement, as shown:

@show

XFDL Options XFDL options adds specific XFDL options to allitems represented by the itemset.For example, if you are creating acheckgroup, you might want toset the itemlocation for all itemsin the set, so that they are spacedhorizontally rather than vertically.

Hint, Help Setting metadata see “Metadata sub-options” onpage 303.

Available in

checkgroup, list

Example

The following code creates a checkgroup with three choices: US Dollars, CDNDollars, and Euro. The choices themselves are defined within the xforms:selectoption.

<checkgroup sid="currency"><xforms:select ref="currency" appearance="full">

<xforms:label>Select the currencies you accept:</xforms:label>

<xforms:item><xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value>

</xforms:item><xforms:item>

<xforms:label>CDN Dollars</xforms:label><xforms:value>CDN</xforms:value>

</xforms:item><xforms:item>

XFDL Version 7.7 329

Page 336: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:label>Euro</xforms:label><xforms:value>Euro</xforms:value>

</xforms:item></xforms:select>

</checkgroup>

Alternatively, you could create the choices in your data model as follows:<xforms:instance xmlns="" id="currency">

<data><currency/><choice show="US Dollars">USD</choice><choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

In this case, you would use the xforms:select option to link to those choices, asillustrated by the following checkgroup:

<checkgroup sid="currency"><xforms:select ref="currency" appearance="full">

<xforms:label>Select the currencies you accept:</xforms:label>

<xforms:itemset nodeset="instance('currency')/choice"><xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value>

</xforms:itemset></xforms:select>

</checkgroup>

Usage details1. The single node binding for the xforms:select must refer to the same model as

the single node bindings for the choices within the xforms:select.2. To create a checkgroup or list item from which the user can select only one

choice, use the xforms:select1 option.3. The choices available in a list are equivalent to cells of type select. If you want

a choice to perform a different action use the xforms:extension to set adifferent type. For example, the following xforms:item is set to type link:

<xforms:item><xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value><xforms:extension>

<type>link</type><url>http://www.ibm.myserver.com/mypage.htm</url>

</xforms:extension></xforms:item>

4. If your xforms:select contains both an xforms:itemset and one or morexforms:item elements, the xforms:itemset is used and the individualxforms:item elements are ignored.

5. The single node binding in the xforms:select option creates a link between thevalue option for the containing item and the bound element in the datamodel, so that they share data. When the user makes a selection, thexforms:value of that selection is stored in the XFDL value of the itemcontaining the xforms:select and in the data node bound to the xforms:select.

6. If the user makes multiple selections, those choices are stored as a spacedelimited list. The selected items are listed by their build order in the form.Because this list is space delimited, the choices themselves cannot containspaces.

330 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 337: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

7. To store the value of each selection in its own data element, use thexforms:select and xforms:deselect events. For more information, refer to“Details on XForms actions” on page 347.

8. The item set (determined by the xforms:item elements or the xforms:itemsetelement) may be empty if the bound nodes contain no data, or if the boundnodes are not relevant. In either case, the containing item is displayed withoutany choices. For example, a checkgroup would be displayed without anychecks in it.

9. Checkgroup and radiogroup items are arranged vertically by default (that is,each choice appears immediately below the previous choice). To arrangecheckgroup or radiogroup items in another manner, use the xforms:extensionto add an itemlocation to each item in the group. For example, you might setthe items to appear one after another horizontally with the followingitemlocation:

<itemlocation><after compute="itemprevious"/>

</itemlocation>

10. To set the choices in a list to perform particular actions, such as a save orsubmit, use the xforms:extension to add a type option to each <xforms:item>element. For example, you might create the following items in your list:

<xforms:item><xforms:label>Save</xforms:label><xforms:value>Save</xforms:value><xforms:extension>

<type>saveas</type></xforms:extension>

</xforms:item><xforms:item>

<xforms:label>Submit</xforms:label><xforms:value>Submit</xforms:value><xforms:extension>

<type>submit</type></xforms:extension>

</xforms:item>

11. The value option overrides the xforms:value of the listed choices. This isuseful when working with list items. A list displays the xforms:label of achoice until it is selected, at which point it displays the xforms:value of achoice. This means that you can set the value option to override the defaultxforms:value, which will change what is displayed when a choice is selected.For example, you might have a data model that sets a full text label for thechoices, but uses an abbreviated value. The following instance shows this,using the show attribute to set the xforms:label and the contents of eachelement to set the xforms:value:

<xforms:instance id="currency"><data>

<choice show="US Dollars">USD</choice><choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

In this case, you might want to display the full text label even after a choice isselected. You can do this by using xforms:extension to add a value to eachitem in the set. You can then set the value to compute its contents to equal thelabel, which is populated with the full text description. The following sampleshows this:

<checkgroup sid="currency"><xforms:select ref="currency" appearance="full">

<xforms:label

XFDL Version 7.7 331

Page 338: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

>Select the currencies you accept:</xforms:label><xforms:itemset nodeset="instance('currency')/choice">

<xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<value compute="label"/></xforms:extension>

</xforms:itemset></xforms:select>

</checkgroup>

12. Any item with an xforms:select option can trigger XForms actions using thexforms-value-changed, xforms-select, or xforms-deselect events. For moreinformation, refer to “Details on XForms event handlers” on page 367.

332 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 339: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:select1Sets the choices that are displayed by a checkgroup, radiogroup, list, popup, orcombobox. The xforms:select1 option limits users to selecting one of the choices.

Syntax

The xforms:select1 option has two different syntaxes, depending on whether thechoices are included in the option itself, or whether the choices are included in thedata model and linked by the option.

If you want to include the choices in the option itself, use the following syntax:

Table 158. xforms select 1 parameters

Parameter Type Description

single node binding string See “Single node binding” onpage 299.

style string Set to one of the following values:

v full – If you are setting choicesfor a radiogroup ofcheckgroup.

v compact – If you are settingchoices for a list.

v minimal – If you are settingchoices for a popup orcombobox.

Default: minimal.

type string Set one of the following values:

v open – Set to open if the item isa combobox.

v closed – Set to closed if theitem is not a combobox.

This parameter defaults to closed,and is not required if the item isnot a combobox.

Default: closed.

<xforms:select1 single_node_binding appearance="style"selection="type"><xforms:label>label text</xforms:label><xforms:item1>

<xforms:label>label for choice</xforms:label><xforms:value>value for choice</xforms:value>

</xforms:item1>...<xforms:itemn>

...<xforms:itemn>Alert SettingHint SettingHelp Setting

</xforms:select1>

Note: There can be any number of xforms:item elements.

XFDL Version 7.7 333

Page 340: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 158. xforms select 1 parameters (continued)

Parameter Type Description

label text string Sets the text for a label that isdisplayed at the top of the item.Leave this blank to display nolabel.

If the item also has a label option,it will override this setting.

label for choice string Sets the text that is displayed forthe choice.

value for choice string Sets the value that is stored if theuser selects this choice.

Alert, Hint, Help Setting metadata See “Metadata sub-options” onpage 303.

If you want to include the choices in the data model, use the following syntax:

Table 159. available choices to add to the data model

Parameter Type Description

single node binding string see “Single node binding” on page299.

type string set to one of the following values:

v full – If you are setting choicesfor a radiogroup ofcheckgroup.

v compact – If you are settingchoices for a list.

v minimal – If you are settingchoices for a popup orcombobox.

input string set one of the following values:

v open – Set to open if the item isa combobox.

v closed – Set to closed if theitem is not a combobox.

This parameter defaults to closed,and is not required if the item isnot a combobox.

<xforms:select1 single_node_binding appearance="type"selection="input"><xforms:label>label text</xforms:label><xforms:itemset nodeset="XPath to choices">

<xforms:label ref="XPath to label text"></xforms:label>

<xforms:value ref="."></xforms:value></xforms:itemset>Alert SettingHint SettingHelp Setting

</xforms:select1>

334 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 341: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 159. available choices to add to the data model (continued)

Parameter Type Description

label text string sets the text for a label that isdisplayed at the top of the item.

Leave this blank to display nolabel.

XPath to choices string an XPath reference to the elementsin the data model that provide thechoices. This defines the set ofitem s that the item displays aschoices. This reference is relativeto the XPath to element reference.

For example, your data modelmay contain the followingelements that represent the choicesfor your item:

<choice show="US Dollars">USD</choice>

<choice show="CDN Dollars">CDN</choice>

<choice show="Euros">Euro</choice>

In this case, your would referencethose choices as:

choice

XPath to label text string an XPath reference to the labeltext for each choice. This text isincluded in your data model asattributes on the data elementsthat contain your choices. Thisreference is relative to the XPathto choices reference.

For example, your data modelmay contain the followingelements that represent the choicesfor your checkgroup:

<choice show="US Dollars">USD</choice>

<choice show="CDN Dollars">CDN</choice>

<choice show="Euros">Euro</choice>

In this case, your would referencethe show attributes that containthe text that describes thatelement, as shown:

@show

Alert, Hint, Help Setting metadata see “Metadata sub-options” onpage 303.

Available in

checkgroup, combobox, list, popup, radiogroup

XFDL Version 7.7 335

Page 342: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

The following code creates a popup with three choices: US Dollars, CDN Dollars,and Euro. The choices themselves are defined by the xforms:select1 option.

<popup sid="currencyType"><xforms:select1 ref="selectedCurrency" appearance="minimal">

<xforms:label>Select the payment currency:</xforms:label><xforms:item>

<xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value>

</xforms:item><xforms:item>

<xforms:label>CDN Dollars</xforms:label><xforms:value>CDN</xforms:value>

</xforms:item><xforms:item>

<xforms:label>Euro</xforms:label><xforms:value>Euro</xforms:value>

</xforms:item></xforms:select1>

</popup>

Alternatively, you could create the choices in your data model as follows:<xforms:instance id="currency" xmlns="">

<data><choice show="US Dollars">USD</choice>

<choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

In this case, you would use the xforms:select1 option to link to those choices, asillustrated by the following checkgroup:

<popup sid="currencyType"><xforms:select1 ref="selectedCurrency" appearance="minimal">

<xforms:label>Select your preferred currency for payment:</xforms:label>

<xforms:itemset nodeset="instance('currency')/choice"><xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value>

</xforms:itemset></xforms:select1>

</popup>

Usage details1. The single node binding for the xforms:select1 must refer to the same model

as the single node bindings for the choices within the xforms:select1.2. To create a checkgroup or list item from which the user can select any

number of choices, use the xforms:select option.3. The choices available in a list are equivalent to cells of type select. If you

want a choice to perform a different action use the xforms:extension to set adifferent type. For example, the following xforms:item is set to type link:

<xforms:item><xforms:label>US Dollars</xforms:label><xforms:value>USD</xforms:value><xforms:extension>

<type>link</type><url>http://www.ibm.myserver.com/mypage.htm</url>

</xforms:extension></xforms:item>

336 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 343: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

4. If your xforms:select1 contains both an xforms:itemset and one or morexforms:item elements, the xforms:itemset is used and the individualxforms:item elements are ignored.

5. The single node binding in the xforms:select1 option creates a link betweenthe value option for the containing item and the bound element in the datamodel, so that they share data. When the user makes a selection, thexforms:value of that selection is stored in the XFDL value of the itemcontaining the xforms:select1 and in the data node bound to thexforms:select1.

6. The item set (determined by the xforms:item elements or the xforms:itemsetelement) may be empty if the bound nodes contain no data, or if the boundnodes are not relevant. In either case, the containing item is displayed withoutany choices. For example, a checkgroup would be displayed without anychecks in it.

7. Checkgroup and radiogroup items are arranged vertically by default (that is,each choice appears immediately below the previous choice). To arrangecheckgroup or radiogroup items in another manner, use the xforms:extensionto add an itemlocation to each item in the group. For example, you might setthe items to appear one after another horizontally with the followingitemlocation:

<itemlocation><after compute="itemprevious"/>

</itemlocation>

8. To set the choices in a combobox, list, or popup to perform particular actions,such as a save or submit, you can use the xforms:extension to add a typeoption to each <xforms:item> element. For example, you might create thefollowing items in:

<xforms:item><xforms:label>Save</xforms:label><xforms:value>Save</xforms:value><xforms:extension>

<type>saveas</type></xforms:extension>

</xforms:item><xforms:item>

<xforms:label>Submit</xforms:label><xforms:value>Submit</xforms:value><xforms:extension>

<type>submit</type></xforms:extension>

</xforms:item>

9. The value option overrides the xforms:value of the listed choices. This isuseful when working with list items. A list displays the xforms:label of achoice until it is selected, at which point it displays the xforms:value of achoice. This means that you can set the value option to override the defaultxforms:value, which will change what is displayed when a choice is selected.For example, you might have a data model that sets a full text label for thechoices, but uses an abbreviated value. The following instance shows this,using the show attribute to set the xforms:label and the contents of eachelement to set the xforms:value:

<xforms:instance id="currency"><data>

<choice show="US Dollars">USD</choice><choice show="CDN Dollars">CDN</choice><choice show="Euros">Euro</choice>

</data></xforms:instance>

XFDL Version 7.7 337

Page 344: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

In this case, you might want to display the full text label even after a choice isselected. You can do this by using xforms:extension to add a value to eachitem in the set. You can then set the value to compute its contents to equal thelabel, which is populated with the full text description. The following sampleshows this:

<checkgroup sid="currency"><xforms:select1 ref="currency" appearance="full">

<xforms:label>Select the currencies you accept:</xforms:label><xforms:itemset nodeset="instance('currency')/choice">

<xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<value compute="label"/></xforms:extension>

</xforms:itemset></xforms:select1>

</checkgroup>

10. Any item with an xforms:select1 option can trigger XForms actions using thexforms-value-changed, xforms-select, or xforms-deselect events. For moreinformation, refer to“Details on XForms event handlers” on page 367.

11. For an xforms:select1 which contains an xforms:itemset, users are not longer ableto use XFDL computes to refer to the cells, unless an xforms:extension is addedto the xforms:itemset.

338 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 345: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:submitSets a button or action item to perform and XForms submission. The rules for thesubmission are defined in the XForms data model. The xforms:submit links abutton to a particular set of rules, which are then carried out when the button isclicked.

For more information about XForms submissions, see “xformsmodels” on page 306.

Syntax

Table 160. xforms submit parameters

Parameter Type Description

ID string the ID of the xforms:submissionyou want to use. This is declaredin the data model.

label text string sets the text that the buttoncontaining the submit displays, aswell as the default accessibilitymessage for that button. If thebutton also has value or acclabeloptions, they will override thissetting.

Alert, Hint, Help Setting metadata see “Metadata sub-options” onpage 303.

Available in

action, button

Example

The following example shows a button that is linked to the completeSubmitsubmission rules in the XForms data model. This button also relies on thexforms:label to set the text and accessibility message for the button.

<button sid="completeSubmit"><xforms:submit submission="completeSubmit">

<xforms:label>Submit All Data</xforms:label></xforms:submit>

</button>

Usage details1. You can also trigger submissions using the xforms:send action. For more

information, refer to “xforms:send” on page 362.2. XForms submissions no longer clears the dirtyflag. If necessary, the save

prompt can be disabled by using a compute to set the dirtyflag to off.

<xforms:submit submission="ID"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:submit>

XFDL Version 7.7 339

Page 346: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:switchDivides a portion of the form into sets of items, and then controls which set isshown to the user. For example, you may have a form page with Basic andAdvanced settings, and may only want to show one type of settings to the user atany given time.

The switch option uses the xforms:switch element to group the items into sets.Each set can contain any number of XFDL items, which are written normally aschildren of the xforms:switch.

To change which set of items is displayed, you must use the xforms:toggle action.

Syntax

Table 161. xforms switch parameters

Parameter Type Description

name string an arbitrary name that you assignto the switch or case. All namesassigned to id attributes must beglobally unique within the form.

single node binding string optional. See “Single nodebinding” on page 299.

state XPath optional. An XPath expression thatis evaluated relative to the singlenode binding (if given) or thecontext node of the switch. If thisresolves to a node that containsthe ID of an <xforms:case>, thenthat case is active and shown tothe user. Otherwise, thexforms:case with a selectedattribute of true is shown.

The selected case and the statenode are synchronized (that is,changing one changes the other).

boolean Boolean true indicates the case is active(that is, the one shown to theuser); false indicates the case isnot active.

Note that only one case can beactive within a single switch.

<xforms:switch id="name" single_node_binding xfdl:state="state"><xforms:case1 id="name" selected="boolean"

...XFDL items...</xforms:case1>...<xforms:casen id="name" selected="boolean"

...XFDL items...</xforms:casen>

</xforms:switch>

Note: there can be any number of xforms:case elements, each containing its own set ofitems.

340 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 347: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 161. xforms switch parameters (continued)

Parameter Type Description

XFDL items XFDL the items that are displayed to theuser if the case is active.

Available in

pane

Example

This example shows a switch that contains two cases: one if the user is single, andanother if the user is married. The first case simply contains a label that informsthe user that no additional information is necessary. The second case contains anumber of fields that request some information about the user’s spouse. To beginwith, the items for the single case are displayed on the form, since it is selected(that is, selection = true).

<pane sid="marriageStatus"><xforms:switch>

<xforms:case id="single" selected="true"><label sid="singleLabel">

<xforms:output ref="spouse/none"/></label>

</xforms:case><xforms:case id="married" selected="false">

<field sid="spouseName"><xforms:input ref="spouse/name">

<xforms:label>Enter your spouse's name:</xforms:label></xforms:input>

</field><field sid="spouseAge">

<xforms:input ref="spouse/age"><xforms:label>Enter your spouse's age:</xforms:label>

</xforms:input></field>

</xforms:case></xforms:switch>

</pane>

In addition, the following code shows a button that uses the xforms:toggle actionto change the switch to show the married case. Note that the xforms:toggle isenclosed in an xforms:trigger, which is activated when the button is clicked andtriggers the toggle action.

<button sid="setMarried"><xforms:trigger>

<xforms:label></xforms:label><xforms:toggle case="married" ev:event="DOMActivate"

></xforms:toggle></xforms:trigger>

</button>

Usage details1. An xforms:switch can contain any number of xforms:case elements, which can

in turn contain any number of XFDL items, including panes (with groups andswitches) and tables (with repeats).

2. To change which case is selected, you must use the xforms:toggle action. Formore information, see “xforms:toggle” on page 367.

3. An xforms:switch is not allowed in an xforms:repeat element.

XFDL Version 7.7 341

Page 348: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:triggerTriggers an event in response to an XFDL action or the user clicking an XFDLbutton. The event is expressed as an XForms action, which allow you to makevarious changes to the form. For example, you could use an XForms action to setwhich case in a switch statement is true, or you could us an XForms action toinsert or delete items on the form.

Syntax

Table 162. xforms trigger parameters

Parameter Type Description

single node binding string optional. See “Single node binding” onpage 299. Adding a single node bindingto an xforms:trigger does not cause thetrigger to share data with the boundnode. It simply allows the trigger toinherit the relevant properties from thedata model.

label text string sets the text that the button containingthe trigger displays, as well as thedefault accessibility message for thatbutton. If the button also has value oracclabel options, they will override thissetting.

XForms Action (see below)

Alert, Hint, HelpSetting

metadata see “Metadata sub-options” on page303.

XForms Action

The XForms action determines what type of action is actually triggered. This couldbe a single action, such as deleting a data node, or multiple actions, such as settingthe value of multiple data nodes. For more information about using XFormsactions, refer to “Details on XForms actions” on page 347.

Available in

action, button

Example

The following example shows a button that toggles the case of a switch item. Inthis case, the toggle sets the basic case to be true. Note that this trigger does notinclude a ref attribute, since the button is always relevant.

<xforms:trigger single_node_binding><xforms:label>label text</xforms:label>XForms ActionAlert SettingHint SettingHelp Setting

</xforms:trigger>

342 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 349: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<button sid="basicPrefs"><xforms:trigger>

<xforms:label></xforms:label><xforms:toggle case="basic" ev:event="DOMActivate"

></xforms:toggle></xforms:trigger>

</button>

Usage details1. The xforms:trigger option triggers XForms actions through the DOMActivate

event. For more information about actions, refer to “Details on XForms actions”on page 347. For more information about events, refer to “Details on XFormsevent handlers” on page 367.

2. A button or action that contains the trigger to type must be of type select,which is the default if the type is omitted. Any other type will override thetrigger.

3. An xforms:trigger does not set the triggeritem option for the form. If this isrequired, you must add a compute that will set the option when the button oraction is activated.

XFDL Version 7.7 343

Page 350: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:textareaLinks a multi-line field to an element in the data model so that they share data.For example, if you added an xforms:textarea option to a field in your form, youcould use that option to link the field to an element in your data model. Oncelinked, any changes made to the data in one would be reflected by the other.

This option is only available if you are using an XForms data model.

Syntax

Table 163. xforms text area parameters

Parameter Type Description

single node binding string see “Single node binding” on page299.

label text string sets the text for the field’s built-inlabel, as well as the accessibilitymessage for the field. Leave thissetting empty for no label.

If the item also has a label oracclabel option, they will overridethis setting.

Alert, Hint, Help Setting metadata see “Metadata sub-options” onpage 303.

Available in

custom, field

Example

The following code shows an XForms model that contains a to, from, date, andnote element:

<xformsmodels><xforms:model xmlns="">

<xforms:instance id="memo"><memorandum>

<to></to><from></from><date></date><note></note>

</memorandum></xforms:instance>

</xforms:model></xformsmodels>

Using that data model, the following code links a field to the note element in thedata model, so that they share data:

<xforms:textarea single_node_binding><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:textarea>

344 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 351: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<field sid="noteField"><xforms:textarea ref="note">

<xforms:label>Note:</xforms:label></xforms:textarea><value></value>

</field>

Usage details1. This option is for multi-line fields. To create a field with only a single line of

input, use the xforms:input option instead.2. If an XFDL field has a texttype setting of text/rtf, then the UI binding connects

to the rtf option rather than the value option for that field.3. To copy the plain text from an rich text field to the XForms data model, you

must use a custom item with an xforms:textarea. Within that item, create acustom option that has a compute. This compute must copy the contents of thevalue option from the rich text field to the value option for the custom item.For example:

<field sid="commentField"><xforms:textarea ref="comment/richText">

<xforms:label>Comment:</xforms:label></xforms:textarea><texttype>text/rtf</texttype><value>contains the plain text</value>

</field><custom:holder sid="plainTextHolder">

<xforms:textarea ref="comment/plainText"><xforms:label/>

<xforms:textarea><custom:copytext compute="toggle(commentField.value) == 1 ?

set(value, commentField.value) : ''"/><value>is set to contain the plain text</value>

</custom:holder>

4. Any item with an xforms:textarea option can trigger XForms actions using thexforms-value-changed event. For more information, refer to “Details onXForms event handlers” on page 367.

5. When you add an xforms:textarea to a custom item, it works just as though itwas placed in a valid XFDL item. This means that a value option is created andis linked to the data model.

XFDL Version 7.7 345

Page 352: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:uploadSets a button to attach a file to the form. The file is loaded directly into the XFormsdata model as base64 data. If the file is an image, you can use an xforms:output todisplay the file to the user.

This is equivalent to a button of type enclose, but does not allow multipleenclosures.

Syntax

Table 164. xforms upload parameters

Parameter Type Description

single node binding string See “Single node binding” onpage 299.

MIME type MIME type Filters the file types that the usercan upload. This is a spacedelimited list of MIME types thatare allowed.

To limit uploads to those imageformats supported by XFDL, setthis to:

image/*

label text string Sets the text that the buttoncontaining the upload displays, aswell as the default accessibilitymessage for that button. If thebutton also has value or acclabeloptions, they will override thissetting.

Alert, Hint, Help Setting metadata See “Metadata sub-options” onpage 303.

Available in

button

Example

The following example show a button that uploads an employee assessment intothe data model. This upload also copies the MIME type of the file and the filename to elements in the data model.

<button sid="loadAssessment"><xforms:upload ref="assessment/text"

mediatype="text/plain">

<xforms:upload single_node_binding mediatype="MIME type"><xforms:label>label text</xforms:label><xforms:mediatype single_node_binding></xforms:mediatype><xforms:filename single_node_binding"></xforms:filename>Alert SettingHint SettingHelp Setting

</xforms:upload>

346 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 353: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:label>Enclose Assessment</xforms:label><xforms:mediatype ref="../mediatype"></xforms:mediatype><xforms:filename ref="../filename"></xforms:filename>

</xforms:upload></button>

Usage details1. An xforms:upload can only upload a single file. If you want to add multiple

files to a form, you must create multiple upload buttons (or use custom XFDLconstructs).

2. The only way to display an uploaded file is through the xforms:output option.However, this option is limited to displaying text and image files.

Details on XForms actionsXForms actions are similar to the XFDL actions you can create using the actionitem. XForms actions allow you to initiate a number of processes, includingsubmitting a form, setting a value in a form, inserting a row in a repeat table, andso on.

Unlike XFDL action items, XForms actions are triggered by events in the form. Forexample, you might create an action that occurs when the user clicks a button,when a particular value in the form has changed, or when a submission hasreturned an error.

This section provides general information about actions, and then details eachaction type in turn.

SyntaxActions are written in two ways, depending on whether you want to use a groupof action or a single action.

When using a group of actions, you place them in an <xforms:action> tag. Thisgroups the actions together, so that the actions all respond to the same triggerevent. Once triggered, each action is processed in turn. The following syntaxapplies:

Table 165. xforms actions parameters

Parameter Type Description

event string This sets the event that willtrigger the actions. For moreinformation about events, refer to“Details on XForms eventhandlers” on page 367.

<xforms:action event xfdl:if="condition" while="condition" ><action1 action_settings>...<actionn action_settings>

</xforms:action>

XFDL Version 7.7 347

Page 354: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 165. xforms actions parameters (continued)

Parameter Type Description

condition XPath Optional. An XPath expressionthat evaluates to either true orfalse. If false, the actions withinthe xforms:action tag are notprocessed. This expression isevaluated relative to the contextset by its nearest ancestor with asingle node or nodeset binding.

This allows for conditional logicwithin actions.

while string This will run a while loop thatrepeats the action the attribute ison. This works like a standardwhile loop expression. While thecondition is true, the loop willrun. Useful to delete all table rowsor copy any number of elementsfrom one parent to another.

action string The type of action you want touse.

action_setting string One or more attributes that setany values required for the action.

Optionally, you can use only a single action. In this case, no <xforms:action> tag isrequired, as the triggering event is included on the action’s tag. This is written asshown:

Table 166. xform action paramater

Parameter Type Description

action string The type of action you want touse.

event string This sets the event that willtrigger the action. For moreinformation about events, refer to“Details on XForms eventhandlers” on page 367.

condition XPath Optional. An XPath expressionthat evaluates to either true orfalse. If false, the action is notprocessed. This expression isevaluated relative to the contextset by its nearest ancestor with asingle node or nodeset binding.

This allows for conditional logicwithin actions.

<action event xfdl:if="condition" action_settings>

348 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 355: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 166. xform action paramater (continued)

Parameter Type Description

while string This will run a while loop thatrepeats the action the attribute ison. This works like a standardwhile loop expression. While thecondition is true, the loop willrun. Useful to delete all table rowsor copy any number of elementsfrom one parent to another.

action_setting string One or more attributes that setany values required for the action.

Note that all actions are in the XForms namespace, and are preceded by thexforms: prefix. Futhermore, all action settings are written as attributes.

Actions and XForms functionsActions that include an XPath reference may also use XForms functions to resolvethat reference.

For more information about XForms functions, refer to “Details on XFormsfunction calls” on page 544.

Placing actions in a formThe placement of actions depends on the triggering event.

For example, if an action is triggered by a button click, the action must be placedwithin the <xforms:trigger> element of the button item. Similarly, if an action istriggered by a change in the XForms model, it must be included as a child of<xforms:model> tag.

For example:<button>

<xforms:trigger></xforms:trigger>

<button>

For more information about the events available and where they are placed, referto “Details on XForms event handlers” on page 367.

XFDL Version 7.7 349

Page 356: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:deleteDeletes a row of elements from a table. The elements are first deleted from theXForms model, then the table’s repeat deletes the visible items that were linked tothose data elements.

Syntax

Table 167. delete parameters

Parameter Type Description

event string The XForms event that triggersthe action.

nodeset binding special Defines the set of child nodes tobe deleted. For more informationabout node bindings, see “Singlenode binding” on page 299.

at string An index number that determineswhich row to delete. Indexing isone-based, meaning the first rowis row 1, the second row is row 2,and so on.

context XPath Not required. Added only toallow symmetry of syntax withxfoms:insert.

Example

This example assumes you are working with a purchase order form that includesthe following data instance:

<xforms:instance xmlns=""><po>

<order><row>

<product>widget</product><quantity>2</quantity><unitCost>2.00</unitCost><lineTotal>4.00</lineTotal>

</row>...<row>

<product></product><quantity>0</quantity><unitCost>0</unitCost><lineTotal>0</lineTotal>

</row></order><subtotal>4.00</subtotal><tax>1.12</tax><totalCost>4.48</totalCost>

</po></xforms:instance>

<xforms:delete event nodeset_binding at="at"context="context"/>OR

<xforms:action event><xforms:delete nodeset_binding at="index" contenxt="parent"/>

</xforms:action>

350 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 357: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This data instance includes multiple <row> elements that represent the rows in atable. The last row is a “template” row. Template rows are not visible to the user. Itsimply contains the basic information for a table row, so that when the user wantsto add a row to the table, the information needed to create that row is available.All other rows are visible to the user and contain data that the user has entered.

The xforms:repeat that creates this table must also exclude the template row, asshown:

<table sid="orderTable"><xforms:repeat nodeset="order/row[position()!=last()]"

id="orderTable" startindex="1">

In this case, the nodeset includes all rows that are not in the last position in thetable (which would be the template row). This ensures that the template row isnever included in the table itself, and is never shown to the user.

To delete a row from this table, you need to create a control (such as a button) thatthe user can click to trigger an xforms:delete action. You also need to add someother actions to this control to account for special cases. The following buttonillustrates this:

<button sid="deleteRow"><xforms:trigger>

<xforms:label>Delete Row</xforms:label><xforms:action ev:event="DOMActivate">

<xforms:delete nodeset="order/row[last()>1]"at="index('orderTable')"/>

<xforms:insert nodeset="order/row[last()=1]" at="1"position="before"/>

<xforms:setfocus control="orderTable"/></xforms:action>

</xforms:trigger></button>

In this button, the first action is the xforms:delete. This delete identifies thenodeset for the row. It uses the last function to ensure that there is more than onerow left in the table (if there is more than one row, the last row will have an indexgreater than one). If there was only one row left, that would mean you weredeleting the template row. In this case, the delete will not execute because the lastrow is not greater than one. The delete then uses the index function to determinewhich row of the repeat (called orderTable) the cursor is on, then deletes that row.

The next action is an xforms:insert. This action uses the last function to detectwhether there is only one row left (in which case the last row is row 1). If there isonly one row left, then the table is effectively empty, since the last row is alwaysthe invisible template row. In this case, the insert function adds a new, blank rowto the table. This prevents the user from deleting all rows in the table, and therebymaking the table disappear.

Finally, we use the xforms:setfocus action to reset the focus to the table. This isnecessary because when the user clicks the ″Delete Row″ button, the focus shifts tothe button, so we put it back to the table.

Usage Details1. When deleting a row, the index for the xforms:repeat does not change. Once

the row is deleted, the rows following are all renumbered (their index isreduced by one). This effectively places the focus on the row that followed thedeleted row.

XFDL Version 7.7 351

Page 358: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. When processing the data model on the back end, make sure that you alsoexclude the template row. Otherwise, you will include a row of blank data inyour results.

3. If you are creating tables with template rows, you must ensure that the form’sfocus never moves to the invisible template row, because to the user this seemsas though the focus has disappeared. There are two ways to avoid this. Thefirst is to have the table automatically insert a new row if the only table row isthe template row (as shown in the example above). Alternatively, you can usexforms:setindex in combination with xforms:setfocus to deliberately place thefocus elsewhere. The following example shows how xforms:setindex uses an ifstatement to ensure that if the last row is deleted, the current index moves tothe second last row or, if a row other than the last row is deleted, the indexmoves to the last row. xforms:setfocus is then used to move the focus to therow that has the current index.

<xforms:setindex index="index('orderTable')- if(index('orderTable')= count(order/row),1,0)" repeat="orderTable"></xforms:setindex>

<xforms:setfocus control="orderTable"></xforms:setfocus>

352 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 359: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:insertAdds a row of elements to a table. This function copies a row of elements in thedata model, then inserts the copy in the desired location in the data model. Oncethe copy is inserted in the data model, the table’s repeat creates correspondingitems that are displayed to the user.

Syntax

Table 168. insert parameters

Parameter Type Description

event string The XForms event that triggers the action.

nodesetbinding

special Defines the node to copy. If multiple nodes match,the last matching node is copied. Also defineswhere to place the copy - it is placed into the datamodel as a sibling of this node. Use the nodesetbinding if you are copying a node that is alreadyin the table, and are placing the new node in thesame table.

If you want to copy a node that is not in thetable, use the origin attribute. This overrides thenodeset binding for this purpose.

If you want to place the copy in a table that hasno rows, use the context attribute. This lets youpoint to a parent node rather than a sibling node,and overrides the nodeset binding for thispurpose. The new node is create as a child of thecontext node, and is useful for tables that beginempty. In this case, once the first child is created,the nodeset binding is still used in conjunctionwith the position and at attributes to determinewhere additional rows are placed.

at string An index number that sets the target row. Thecopy is placed either before or after this row inthe table, as defined by the position attribute.Indexing is one-based, meaning the first row isrow 1, the second row is row 2, and so on.

context string Defines where to place the new node. This allowsyou to define a parent, to which the new node isadded as a child. This is useful if you need to addrows to an empty table, and overrides the nodesetbinding for this purpose. If a parent is provided,the nodeset binding is still used in conjunctionwith the position and at attributes to determinewhere additional rows are added to the table.

<xforms:insert event nodeset_binding at="at" context="context" origin="origin"position="position"/>

OR<xforms:action event>

<xforms:insert nodeset_binding" at="at" context="context" origin="origin"position="position"/>

</xforms:action>

XFDL Version 7.7 353

Page 360: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 168. insert parameters (continued)

Parameter Type Description

origin string Defines the node to copy, and overrides thenodeset binding for this purpose. This is useful ifyou want to copy a node that is not already in thetable (for example, a template node that iselsewhere in the form).

position string Defines whether the new nodes are insertedbefore or after target row. Defaults to after. Thetarget row is defined by the at attribute.

Example

This example assumes you are working with a purchase order form that includesthe following data instance:

<xforms:instance xmlns=""><po>

<order><row>

<product>widget</product><quantity>2</quantity><unitCost>2.00</unitCost><lineTotal>4.00<lineTotal>

</row>...<row>

<product></product><quantity>0</quantity><unitCost>0</unitCost><lineTotal>0</lineTotal>

</row></order><subtotal>4.00</subtotal><tax>1.12</tax><totalCost>4.48</totalCost>

</po></xforms:instance><xforms:insert ev:event="xforms-model-construct-done"

nodeset="order/row[last()=1]" at="1" position="before"/>

This data instance includes a single <row> element. This is the “template” row forthe table. As such, it is never used to store data. The purpose of this row is toprovide a template that is copied when adding new rows to the form.

Since the data model begins with only one row, and that row is invisible to theuser, we also add an xforms:insert to the data model. This insert is triggered whenthe form is first opened, once the XForms model is completely built. It uses the lastfunction to determine whether there is only one row in the table. If there is, it adda new, blank row. This ensures that the table always begins with one blank rowthat the user can see.

The xforms:repeat that creates this table must also exclude the template row, asshown:

<table sid="orderTable"><xforms:repeat nodeset="order/row[position()!=last()]"

id="orderTable" startindex="1">

354 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 361: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

In this case, the nodeset includes all rows that are not in the last position in thetable (which would be the template row). This ensures that the template row isnever included in the table itself, and is never shown to the user.

To add more rows to this table, you must create a control (such as a button) thatthe user can click to trigger another xforms:insert action. You also need to addsome other actions to this control account for special cases. The following buttonillustrates this:

<button sid="addRow"><xforms:trigger>

<xforms:label>Add Row</xforms:label><xforms:action ev:event="DOMActivate">

<xforms:insert nodeset="order/row" at="index('orderTable')"position="after"/>

<xforms:setfocus control="orderTable"/></xforms:action>

</xforms:trigger></button>

In this button, the first action is the xforms:insert. This insert uses the indexfunction to determine which row of the repeat (called orderTable) the cursor is on,then adds a new row after the row with the focus.

The next action is an xforms:setfocus, which resets the focus to the table. This isnecessary because when the user clicks the ″Add Row″ button, the focus shifts tothe button, so we put it back to the table.

Usage Details1. When adding a row, the index for the xforms:repeat is automatically updated

to point to the row that was just added.2. When processing the data model on the back end, make sure that you also

exclude the template row. Otherwise, you will include a row of blank data inyour results.

XFDL Version 7.7 355

Page 362: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:messageSets a message that is displayed to the user in a small dialog box.

Syntax

Table 169. message parameters

Parameter Type Description

event string The XForms event that triggersthe action.

level modal Optional. Determines theappearance of the message. Thedefault is modal, but if present, itmust be modal.

ref string Optional. An XPath expressionthat points to a node that containsthe message to be displayed.

message string The text of the message. If ref ispresent, the text is ignored.

Example

The following code shows an XForms model that contains the xforms:messageaction. When the model is first initiated, the xforms-ready event triggers themessage action, which opens a dialog that says, “Data Model Ready” followed bythe current time. The time is extracted from the string returned by the local-date()function.

<xforms:model><xforms:instance id="data" xmlns="">

<data><field1>25</field1><field2>0</field2><field3></field3>

</data></xforms:instance><xforms:message level="modal" ev:event="xforms-ready">Data Model ReadyTime: <xforms:output value="substring(local-date(), 12)"</xforms:message>

</xforms:model>

<xforms:message event level="modal" ref="ref">message</xforms:message>OR

<xforms:action event><xforms:message level="modal" ref="ref">message</xforms:message>

</xforms:action>

356 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 363: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:rebuildCauses the form viewing application to rebuild any internal data structures thatare used to track computational dependencies within a particular model.

In general, the XForms processor automatically runs this action when required. Assuch, this action is included mostly for completeness.

Syntax

Table 170. rebuild parameters

Parameter Type Description

event string The XForms event that triggersthe action.

model string The ID of the model to rebuild. Ifthe model attribute is omitted,then the default model is used.

Example

The following button rebuilds model X when clicked:<button sid="rebuildX">

<xforms:trigger><xforms:label>Rebuild</xforms:label><xforms:rebuild ev:event="DOMActivate" model="X"/>

</xforms:trigger></button>

Usage Details1. This feature is most likely to be used on scaled-down XForms processors, in

which the implicit rebuild-recalculate-revalidate-refresh sequence is notimplemented because of limited resources. In this case, explicit requests forthese actions may force an exchange with a server.

2. If an action sequence includes a setvalue action that affects a node which isused in an XPath predicate in the nodeset of an XForms bind, then you can callrebuild to cause the XForms bind to be re-evaluated.

<xforms:rebuild event model="model"/>OR

<xforms:action event><xforms:rebuild model="model"/>

</xforms:action>

XFDL Version 7.7 357

Page 364: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:recalculateCauses the forms viewing application to recalculate any instance data that isaffected by computations and is not up-to-date. This affects all data instances inthe designated model.

In general, the XForms processor automatically runs this action when required. Assuch, this action is included mostly for completeness.

Syntax

Table 171. recalculate parameters

Parameter Type Description

event string The XForms event that triggersthe action.

model string The ID of the model to recalculate.If the model attribute is omitted,then the default model is used.

Example

The following button recalculates model X when clicked:<button sid="recalculateX">

<xforms:trigger><xforms:label>Recalculate</xforms:label><xforms:recalculate ev:event="DOMActivate" model="X"/>

</xforms:trigger></button>

Usage Details1. This feature is most likely to be used on scaled-down XForms processors, in

which the implicit rebuild-recalculate-revalidate-refresh sequence is notimplemented because of limited resources. In this case, explicit requests forthese actions may force an exchange with a server.

2. Normally, recalculation occurs at the end of an action sequence. However, theform author may need to force an earlier recalculation if there is a setvalueaction whose XPath references depend on the recalculated results of priorsetvalue actions.

<xforms:recalculate event model="model"/>OR

<xforms:action event><xforms:recalculate model="model"/>

</xforms:action>

358 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 365: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:refreshCauses the forms viewing application to update all user interface elements linkedto a particular model, so that they match the underlying data in the XFormsmodel.

In general, the XForms processor automatically runs this action when required. Assuch, this action is included simply for completeness.

Syntax

Table 172. refresh parameters

Parameter Type Description

event string The XForms event that triggersthe action.

model string The ID of the model to refresh. Ifthe model attribute is omitted,then the default model is used.

Example

The following button refreshes the model X when clicked:<button sid="refreshX">

<xforms:trigger><xforms:label>Refresh</xforms:label><xforms:refresh ev:event="DOMActivate" model="X"/>

</xforms:trigger></button>

Usage Details1. This feature is most likely to be used on scaled-down XForms processors, in

which the implicit rebuild-recalculate-revalidate-refresh sequence is notimplemented because of limited resources. In this case, explicit requests forthese actions may force an exchange with a server.

2. If you are performing a number of consecutive submissions, refresh may beuseful for updating the form to show progress, especially after submissions thatreturn data to the form.

<xforms:refresh event model="model"/>OR

<xforms:action event><xforms:refresh model="model"/>

</xforms:action>

XFDL Version 7.7 359

Page 366: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:resetReturns a particular XForms model to the state it was in when the form wasopened. This allows the user the reset the contents of the form to their ″startingpoint″, which can increase usability of the form.

Syntax

Table 173. reset parameters

Parameter Type Description

event string The XForms event that triggersthe action.

model string The ID of the model to reset. Ifthe model attribute is omitted,then the default model is used.

Example

The following model contains data for a change of address, as well as a submissionthat sends the information for processing. Once the data is submitted, anxforms:reset action is triggered. This action resets the data in the form, allowingthe user to type in the next address change without have to close the form andopen it again. This allows for rapid entry of several changes. Note that thisrequires the submission button to be of type submit rather than done.

<xforms:model><xforms:instance xmlns="">

<root><customerInfo>

<id/><newAddress>

<street/><city/><state/><zip/>

</newAddress></customerInfo>

</root></xforms:instance><xforms:submission id="submit" method="post"

action="http://www.ibm.poserver.com/cgi-bin/updateAddress"includenamespaceprefixes=""><xforms:reset ev:event="xforms-submit-done"/>

</xforms:submission></xforms:model>

<xforms:reset event model="model"/>OR

<xforms:action event><xforms:reset model="model"/>

</xforms:action>

360 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 367: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:revalidateCauses the forms viewing application to validate all instance data in a particularmodel, ensuring that all validation checks have been performed.

In general, the XForms processor automatically runs this action when required. Assuch, this action is included simply for completeness.

Syntax

Table 174. revalidate parameters

Parameter Type Description

event string The XForms event that triggersthe action.

model string The ID of the model to re-validate.If the model attribute is omitted,then the default model is used.

Example

The following button re-validates model X when clicked:<button sid="revalidateX">

<xforms:trigger><xforms:revalidate ev:event="DOMActivate" model="X"/><xforms:label>Revalidate</xforms:label>

</xforms:trigger></button>

Usage Details1. This feature is most likely to be used on scaled-down XForms processors, in

which the implicit rebuild-recalculate-revalidate-refresh sequence is notimplemented because of limited resources. In this case, explicit requests forthese actions may force an exchange with a server.

<xforms:revalidate event model="model"/>OR

<xforms:action event><xforms:revalidate model="model"/>

</xforms:action>

XFDL Version 7.7 361

Page 368: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:sendTriggers an XForms submission. The submission must already be defined in theXForms model.

Syntax

Table 175. send parameters

Parameter Type Description

event string The XForms event that triggersthe action.

submission string The ID of the submission youwant to trigger. You can includemultiple submission attributes.

Example

The following example shows two <xforms:submission> elements. When triggered,the submission attempts to post the data for a purchase order to a cgi script forprocessing. If an error is encountered, the xforms:send action is triggered. Thisstarts a second submission, called ″error″ which submits to a different server(possibly a fall-back server).

<xforms:submission id="S" method="post" includenamespaceprefixes=""action="http://www.ibm.poserver.com/cgi-bin/po"><xforms:send ev:event="xforms-submit-error"

submission="error"/></xforms:submission><xforms:submission id="error" method="post" includenamespaceprefixes=""

action="http://www.ibm.errorserver.com/cgi-bin/error"></xforms:submission>

Usage Details1. You can also use the xforms:submit option to initiate a send action.

<xforms:send event submission="submission"/>OR

<xforms:action event><xforms:send submission="submission"/>

</xforms:action>

362 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 369: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:setfocusSets the focus to a particular presentation element in the form.

Syntax

Table 176. setfocus parameters

Parameter Type Description

event string The XForms event that triggersthe action.

id string The id of the XForms optioninside the item that you want tohave receive the focus.

Example

The following examples shows a button that is used to add new rows to a table:<button sid="addRow">

<xforms:trigger><xforms:label>Add Row</xforms:label><xforms:action ev:event="DOMActivate">

<xforms:insert nodeset="order/row" at="index('orderTable')"position="after"/>

<xforms:setfocus control="orderTable"/></xforms:action>

</xforms:trigger></button>

When the button is clicked by the user, the focus moves to the button itself.However, once the new row appears, it’s preferable to send the focus back to thetable.

To accomplish this, the xforms:setfocus is included as the last action for thebutton, and moves the focus back to the xforms:repeat that controls the table. Thefocus is then automatically placed on the row that was just added.

Usage Details1. You can use xforms:setfocus to refer to specific items in a repeat template. In

this case, the row index of the repeat determines which item gets the focus.For example, consider a case in which each row of repeat X contains a field anda popup, and the repeat begins with an index of 2. You set the focus to thepopup item. To locate this item, we first go to row 2 of the repeat, then find thepopup within that row.

2. Setting the focus to an element on a different page of the form will change thepage that is displayed.

<xforms:setfocus event control="id"/>OR

<xforms:action event><xforms:setfocus control="id"/>

</xforms:action>

XFDL Version 7.7 363

Page 370: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:setindexSets the index for the xforms:repeat element in a table. This determines which rowin the table receives the focus.

Rows use one-based indexing. This means that the first row has an index of 1, thesecond and index of 2, and so on.

Syntax

Table 177. setindex parameters

Parameter Type Description

event string the XForms event that triggers theaction.

id string the ID of the <xforms:repeat>element for which you want to setthe index.

index XPath the number to set the index to.

Example

The following button deletes a row from a table:<button sid="deleteRow">

<xforms:trigger><xforms:label>Delete Row</xforms:label><xforms:action ev:event="DOMActivate">

<xforms:delete nodeset="order/row"at="index('orderTable')"/>

<xforms:setindex index="index" repeat="orderTable"/><xforms:setfocus control="orderTable"/>

</xforms:action></xforms:trigger>

</button>

The third action performed by this button is an xforms:setindex. In this case,xforms:setindex ensures that the index is always focused on the last row of thetable and unless the row to be deleted is selected by the user.

Usage Details1. You can use xforms:setindex to set the index of a repeat that is nested in

another repeat. In this case, the row index of the outer repeat determines whichinner repeat is set.For example, consider a case in which repeat X contains repeat Y. Repeat X hasan index of 2, and repeat Y has an index of 5. You set repeat Y to an index of 3.To locate the correct repeat, we first go to row two of repeat X, then find repeatY within that row.

<xforms:setindex event repeat="ID" index="index"/>OR

<xforms:action event><xforms:setindex repeat="ID" index="index"/>

</xforms:action>

364 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 371: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:setvalueSets the value for a specified element in the data model.

Syntax

Table 178. setvalue parameters

Parameter Type Description

event string The XForms event that triggersthe action.

single node binding special See “Single node binding” onpage 299.

value XPath XPath reference Optional. If included, the result ofthe XPath reference is used to setthe value. This overrides the valuesetting.

value string Optional. If included, this string isused to set the value. If the valueXPath setting is present, itoverrides this setting.

Example

The following data instance contains two address blocks: one for the home addressand one for the mailing address:

<xforms:instance xmlns="" id="registration"><address>

<home><street/><city/><state/><zip/>

</home><mailing>

<street/><city/><state/><zip/></mailing>

</address></xforms:instance>

In this case, if the addresses are the same, it might be useful to include a button inthe form that will copy all of the data from the home address to the mailingaddress, as shown:

<button sid="copyAddress"><xforms:trigger>

<xforms:action ev:event="DOMActivate"><xforms:setvalue ref="address/mailing/street"

<xforms:setvalue event single_node_bindingvalue="value XPath">value</xforms:setvalue>

OR<xforms:action event>

<xforms:setvalue ref="XPath" model="model"value="value XPath"/>value</xforms:setvalue>

</xforms:action>

XFDL Version 7.7 365

Page 372: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

value="../../home/street"/><xforms:setvalue ref="address/mailing/city"

value="../../home/street"/><xforms:setvalue ref="address/mailing/state"

value="../../home/state"/><xforms:setvalue ref="address/mailing/zip"

value="../../home/zip"/></xforms:action>

</xforms:trigger></button>

Usage Details1. The xforms:setvalue action does not work on values that are set to be readonly

in the XForms model; however, it does work on values that are set to bereadonly through the readonly option.

366 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 373: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:toggleSelects one of the cases in an xforms:switch and makes it active. When one case isselected, all other cases in the switch are deselected.

Syntax

Table 179. toggle parameters

Parameter Type Description

event string The XForms event that triggersthe action.

case string The ID of the case to select.

Example

The following button assumes that you have an xforms:switch with two cases:single and married. When clicked, the button sets the switch to the married case:

<button sid="setMarried"><xforms:trigger>

<xforms:label>Married</xforms:label><xforms:toggle case="married" ev:event="DOMActivate"

></xforms:toggle></xforms:trigger>

</button>

Usage Details1. XFDL allows an xforms:switch option to appear inside an xforms:repeat

option. In this case, the row index of the repeat determines which switch isaffected by the xforms:toggle action.For example, consider a case in which repeat X contains a switch, and repeat Xbegins with an index of 2. You toggle the case of the switch. To locate thecorrect switch, we first locate row 2 of the repeat, then locate the switch withinthat row.

Details on XForms event handlersXForms event handlers track events in the form, such as a button click or theselection of a particular choice. When these events occur, they are registered by theXForms system. This allows you to create actions that are triggered by theseevents.

For example, you might create an action that is triggered when a particular buttonis clicked, or when a particular choice in a list is selected.

SyntaxXForms event handlers exist in the following namespace:

http://www.w3.org/2001/xml-events

<xforms:toggle event case="case"/>OR

<xforms:action event><xforms:toggle case="case"/>

</xforms:action>

XFDL Version 7.7 367

Page 374: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

By convention, XFDL uses the ev prefix for this namespace, which is normallydeclared on the <XFDL> element of the form as shown:

<XFDL xmlns:ev="http://www.w3.org/2001/xml-events">

Event handlers themselves are declared as an attribute on XForms actions, and arewritten as shown:

ev:event="event"

When creating an event handler, you can add the attribute to either the general<xforms:action> tag or, for a single action event handler, directly to any specificXForms action tag.

When using the <xforms:action> tag, the individual actions do not require eventhandlers, as shown:

In this case, the event triggers all of the actions contained in the <xforms:action>tag, which are then processed in the order listed.

When using a single action, the event is added to the action tag as shown:

In this case, the occurrence of the event triggers only the single action containingthe ev:event.

Placing events in a formThe ev:event attribute is always placed within an action tag to make it an eventhandler, but the type of event you use dictates where in the form that action maybe placed. For example, actions that rely on a button press must be placed withinthe xforms:trigger option in that button.

In general, the event handler for an event (the action containing an ev:event for agiven event) must appear as a child element of the XForms element that receivesthe event.

For more information about where specific events can be placed, refer to thedetailed description for that event.

<xforms:action ev:event="event"><action1 action_settings>...<actionn action_settings>

</xforms:action>

<action ev:event="event" action_settings>

368 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 375: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

DOMActivateDetects the activation of the presentation element that contains this event. Forexample, clicking a button registers the DOMActivate event for that button.

Syntax

Available In

action item, button item

Example

The following button assumes that you have an xforms:switch with two cases:single and married. When clicked, the DOMActivate event triggers anxforms:toggle action, which sets the switch to the married case:

<button sid="setMarried"><xforms:trigger>

<xforms:label></xforms:label><xforms:toggle case="married" ev:event="DOMActivate"/>

</xforms:trigger></button>

Usage Details1. See the xforms:insert action for an example of an event handler that performs

more than one XForms action.

ev:event="DOMActivate"

XFDL Version 7.7 369

Page 376: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-deselectOccurs when a choice in an xforms:select, xforms:select1, or xforms:switch optionthat was previously selected becomes deselected.

Syntax

Available In

<xforms:case> element, <xforms:item> element

Example

The following list allows the user to choose one or more types of peripheralhardware that they want included when purchasing a computer. The list containsthree choices (mouse, keyboard, and USB memory stick) that are represented bythree <xforms:item> tags. Each item also contains some xforms:setvalue actions.When the user selects an accessory, an xforms-select event occurs for that choice.This triggers the first setvalue action in that item, which sets an element in thedata model to ″Yes″. When the user deselects an accessory, that choice registers anxforms-deselect event and triggers the second setvalue action in that item, whichresets the element in the data model to blank.

<list sid="accessories"><xforms:select ref="po/accessories" appearance="compact">

<xforms:label>Select the accessory:</xforms:label><xforms:item>

<xforms:label>Mouse</xforms:label><xforms:value>Mouse</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/mouse" value="Yes"/><xforms:setvalue ev:event="xforms-deselect"

ref="po/accessories/mouse" value=""/></xforms:item><xforms:item>

<xforms:label>Keyboard</xforms:label><xforms:value>Keyboard</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/keyboard" value="Yes"/><xforms:setvalue ev:event="xforms-deselect"

ref="po/accessories/keyboard" value=""/></xforms:item><xforms:item>

<xforms:label>USB Memory Stick</xforms:label><xforms:value>USB</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/USB" value="Yes"/><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/USB" value=""/></xforms:item>

</xforms:select></list>

Usage Details1. The xform-deselect event only occurs in xforms:select and xforms:select1

options that use the <xforms:item> element. If the option uses the<xforms:itemset> element, use the xforms-value-changed event instead.

ev:event="xforms-deselect"

370 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 377: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2. The xforms-deselect event does not occur within a combobox item because theselection is open.

XFDL Version 7.7 371

Page 378: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-disabledOccurs when an data node changes its state from relevant to non-relevant, or whena data node that is not relevant changes value and remains non-relevant.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a label item that displays the total for a purchase order. If thetotal is less than 100, then the data node becomes non-relevant and thexforms-disabled event is triggered. In this case, the event triggers anxforms:message action that explains that the total is too low.

The following bind sets the minimum value of the po/total node in the data modelto be 100:

<xforms:bind nodeset="po/total" relevant=". &gt; 100"/>

The following code defines the label that displays the total:<label sid="Total">

<xforms:output ref="po/total"><xforms:message ev:event="xforms-disabled" level="modal"

>Values less than $100 should be paid from petty cash.</xforms:message></xforms:output>

</label>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-disabled"

372 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 379: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-enabledOccurs when a data node that non-relevant (relevant = false) becomes relevant, orwhen a node that is relevant changes value and remains relevant.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a label item that displays the total for a purchase order. If thetotal is less than 100, then the data node becomes non-relevant. If the value is thenchanged to be greater than 100, the node becomes relevant again and thexforms-enabled event is triggered. In this case, the event triggers anxforms:message action that explains that the value is now acceptable.

The following bind sets the minimum value of the po/total node in the data modelto be 100:<xforms:bind nodeset="po/total" relevant=". &lt; 100"/>

The following code defines the label that displays the total:<label sid="Total">

<xforms:output ref="po/total"><xforms:message ev:event="xforms-enabled"

level="modal">The value is acceptable.</xforms:message></xforms:output>

</label>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-enabled"

XFDL Version 7.7 373

Page 380: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-invalidOccurs when a data node changes its state from valid to invalid, or when data thatis invalid changes value and remains invalid.

Validity is determined based on whether the data matches the data type andconstraints specified in the model, as well as the schema validity. Note that thestate of ″required but empty″ is valid.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a label item that displays the total for a purchase order. If thetotal exceeds 10,000, then the data node becomes invalid and the xforms-invalidevent is triggered. In this case, the event triggers an xforms:message action thatexplains that the total is too high.

The following bind sets the maximum value of the po/total node in the datamodel to be 10,000:<xforms:bind nodeset="po/total" constraint=". &lt; 10000"/>

The following code defines the label that displays the total:<label sid="Total">

<xforms:output ref="po/total"><xforms:message ev:event="xforms-invalid"

level="modal">Total exceeds maximum allowed valued.</xforms:message></xforms:output>

</label>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-invalid"

374 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 381: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-model-constructOccurs when the forms viewing application first opens a form and begins toconstruct the XForms model.

Syntax

Available In

<xforms:model> element

Example

The following model contains simple data for a test form. When the form is firstopened, an xforms-model-construct event occurs as the forms viewer begins toconstruct the model. This triggers the xforms:message action, which opens a dialogthat says, ″Beginning model construction.″

<xforms:model><xforms:instance xmlns="">

<testmodel><a/><b/><c/>

</testmodel></xforms:instance><xforms:message level="modal" ev:event="xforms-model-construct"

>Beginning model construction.</xforms:message></xforms:model>

Usage Details1. Because the data structures for XForms instances are not created until after

action handlers for this event are run, few XForms actions other than messagewill work. This event is mainly for debugging.

ev:event="xforms-model-construct"

XFDL Version 7.7 375

Page 382: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-model-construct-doneOccurs when the forms viewing application has finished constructing the XFormsmodel. This occurs just after the form is opened, and always completes before theuser can interact with the form.

Syntax

Available In

<xforms:model> element

Example

The following model contains data for a purchase order form. The data beginswith a single template row which is set to be non-relevant by a bind. This meansthe row is not visible in the form. When the form is first opened, the forms viewerwill construct the XForms data model, creating a table with a single invisible rowin it. When it has completed building the model, an xforms-model-construct-doneevent occurs. This triggers the xforms:insert action, which duplicates the templaterow so that there is a visible row that the user can work with.

<xforms:model><xforms:instance id="po" xmlns="">

<po><order>

<row><product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order><subtotal>0</subtotal><tax>0</tax><total>0</total>

</po></xforms:instance><xforms:bind nodeset="order/row[last()]" relevant="false()"/><xforms:insert ev:event="xforms-model-construct-done"

nodeset="order/row[last()=1]" at="1" position="before"/></xforms:model>

Usage Details1. The xforms-model-construct-done event is appropriate for initializing data

because the user interface has not yet been processed (that is, repeats have notbeen expanded, and form controls have not been recognized). However,because the user interface layer is not yet available, actions that operate on theUI layer are not appropriate in event handlers for this event. For example,toggle, setfocus and setindex will not work. To initialize the user interface, usethe xforms-ready event instead.

ev:event="xforms-model-construct-done"

376 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 383: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-model-destructOccurs when the XForms model is removed from memory. This generally happenswhen the form is closed or submitted.

Syntax

Available In

<xforms:model> element

Example

The following model contains simple data for a test form. When the form is closed,the forms viewer will destroy the XForms data model and an xforms-model-destruct-done event will occur. This triggers the xforms:message action, whichopens a dialog that says, ″Model destroyed.″

<xforms:model><xforms:instance xmlns="">

<testmodel><a/><b/><c/>

</testmodel></xforms:instance><xforms:message level="modal" ev:event="xforms-model-destruct"

>Model destroyed.</xforms:message></xforms:model>

ev:event="xforms-model-destruct"

XFDL Version 7.7 377

Page 384: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-optionalOccurs when a data node that is required (required = true) changes to beingoptional, or when a data node that is optional changes value and remains optional.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a field item that accepts the first name of the user’s spouse.This field is required if they select the ″married″ radio button in the form.However, if they then select the ″single″ radio button, the field becomes optionaland the xforms-optional event is triggered. In this case, the event triggers thexforms:message action, which tells the user that the spousal information is nolonger required.

The following bind sets makes the spouse’s name required if the married radiobutton is selected:

<xforms:bind nodeset="personalInfo/spouseFirstName"required="../marital_status = 'married'"/>

The following code defines the label that displays the first name of the user’sspouse:

<field sid="spouseFirstName"><xforms:input ref="personalInfo/spouseFirstName">

<xforms:label>Spouse's First Name:</xforms:label><xforms:message ev:event="xforms-optional"

level="modal">Spousal data no longer required.</xforms:message></xforms:input>

</field>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-optional"

378 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 385: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-readonlyOccurs when a data node is read-write (readonly = false) becomes readonly, orwhen a node that is readonly changes value and remains readonly.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a field item that accepts the first name of the user’s spouse.When the user selects the ″married″ radio button, this field becomes read-write. Ifthe user then select ″single″, the field becomes readonly and the xforms-readonlyevent is triggered. In this case, the event triggers the xforms:message action, whichtells the user that the spousal information is not required.

The following bind sets makes the spouse’s name readonly if the ″single″ radiobutton is selected:<xforms:bind nodeset="personalInfo/spouseFirstName" readonly="../single = 'on'"/>

The following code defines the label that collects the spouse’s first name:<field sid="spouseFirstName">

<xforms:input ref="personalInfo/spouseFirstName"><xforms:label>Spouse's First Name:</xforms:label><xforms:message ev:event="xforms-readonly"

level="modal">Spousal information is not required.</xforms:message></xforms:input>

</field>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-readonly"

XFDL Version 7.7 379

Page 386: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-readwriteOccurs when a data node that is readonly (readonly = true) becomes read-write, orwhen a node that is read-write changes value and remains read-write.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a field item that accepts the first name of the user’s spouse.When the user selects the ″married″, the ″single″ radio button goes off and thefield becomes readwrite, triggering an xforms-readwrite event. In this case, theevent triggers the xforms:message action, which tells the user that the spousalinformation is required.

The following bind sets makes the spouse’s first name readonly if the ″single″radio button is selected:<xforms:bind nodeset="personalInfo/spouseFirstName" readonly="../single = 'on'"/>

The following code defines the label that displays the first name of the user’sspouse:<field sid="spouseFirstName">

<xforms:input ref="personalInfo/spouseFirstName"><xforms:label>Spouse's First Name:</xforms:label><xforms:message ev:event="xforms-readwrite" level="modal"

>You must provide all listed spousal information.</xforms:message></xforms:output>

</label>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-readwrite"

380 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 387: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-readyOccurs when the forms viewing application has finished the initial set up of allXForms constructs and is ready for user interaction.

Syntax

Available In

<xforms:model> element

Example

The following model contains simple data for a test form. When the form is firstopened, the forms viewer will construct the XForms data model. When is hascompleted building the model, an xforms-ready event occurs. This triggers thexforms:setfocus action, which sets the focus to the last element in the data model.

<xforms:model><xforms:instance xmlns="">

<testmodel><a/><b/><c/>

</testmodel></xforms:instance><xforms:setfocus ev:event="xforms-ready" control="c"/>

</xforms:model>

Usage Details1. You can also use this event to trigger data initialization (as you can with

xforms-model-construct-done), but xforms-ready is the primary event fortriggering actions that initialize the user interface, such as setfocus, setindex,and toggle.

ev:event="xforms-ready"

XFDL Version 7.7 381

Page 388: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-requiredOccurs when an data node that is optional (required = false) becomes required, orwhen a data node that is required changes value and remains required.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a field item that accepts the first name of the user’s spouse.When the user selects the ″married″ radio button, this field becomes required andthe xforms-required event is triggered. In this case, the event triggers thexforms:message action, which tells the user that the spousal information isrequired.

The following bind sets makes the spouse’s last name required if the married radiobutton is selected:<xforms:bind nodeset="personalInfo/spouseFirstName"

required="../marital_status = 'married'"/>

The following code defines the label that displays the total:<field sid="spouseFirstName">

<xforms:input ref="personalInfo/spouseFirstName"><xforms:label>Spouse's First Name:</xforms:label><xforms:message ev:event="xforms-required" level="modal"

>You must provide all listed spousal information.</xforms:message></xforms:input>

</field>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-required"

382 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 389: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-selectOccurs when a choice is selected from an xforms:select, xforms:select1, orxforms:switch option. This event only occurs on the item that is selected.

Syntax

Available In

<xforms:case> element, <xforms:item> element

Example

The following list allows the user to choose one or more types of peripheralhardware that they want included when purchasing a computer. The list containsthree choices (mouse, keyboard, and USB memory stick) that are represented bythree <xforms:item> tags. Each item also contains some xforms:setvalue actions.When the user selects an accessory, an xforms-select event occurs for that choice.This triggers the first setvalue action in that item, which sets an element in thedata model to ″Yes″. When the user deselects an accessory, that choice registers anxforms-deselect event and triggers the second setvalue action in that item, whichresets the element in the data model to blank.

<list sid="accessories"><xforms:select ref="po/accessories" appearance="compact">

<xforms:label>Select the accessory:</xforms:label><xforms:item>

<xforms:label>Mouse</xforms:label><xforms:value>Mouse</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/mouse" value="Yes"/><xforms:setvalue ev:event="xforms-deselect"

ref="po/accessories/mouse" value=""/></xforms:item><xforms:item>

<xforms:label>Keyboard</xforms:label><xforms:value>Keyboard</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/keyboard" value="Yes"/><xforms:setvalue ev:event="xforms-deselect"

ref="po/accessories/keyboard" value=""/></xforms:item><xforms:item>

<xforms:label>USB Memory Stick</xforms:label><xforms:value>USB</xforms:value><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/USB" value="Yes"/><xforms:setvalue ev:event="xforms-select"

ref="po/accessories/USB" value=""/></xforms:item>

</xforms:select></list>

Usage Details1. The xform-select event only occurs in xforms:select and xforms:select1 options

that use the <xforms:item> element. If the option uses the <xforms:itemset>element, use the xforms-value-changed event instead.

ev:event="xforms-select"

XFDL Version 7.7 383

Page 390: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-submitOccurs when an XForms submission begins.

Syntax

Available In

<xforms:submission> element

Example

The following example illustrates how you can remove empty rows from a tablebefore submitting a form.

First, you must set up your <xforms:submission> as shown below. When thissubmission begins, an xforms-submit event occurs. This triggers the firstxforms:setvalue action, which sets an element in the data model to ″true″ toindicate that a submission is in progress. If the submission returns an error, anxforms-submit-error event occurs. This triggers the second xforms:setvalue action,which sets the same element in the data model to ″false″ to indicate that asubmission is no longer occurring.

<xforms:submission id="S" method="post" includenamespaceprefixes=""action="http://www.ibm.poserver.com/cgi-bin/po"><xforms:setvalue ev:event="xforms-submit"

ref="instance('temps')/submitting" value="'true'"/><xforms:setvalue ev:event="xforms-submit-error"

ref="instance('temps')/submitting" value="'false'"/></xforms:submission>

Next, you must create an <xforms:bind> that affects the relevancy of the rows inthe form, as shown:

<xforms:bind nodeset="order/row[not(last())]"relevant="boolean-from-string( if( qty > 0 orinstance('temps')/submitting='false', 'true', 'false'))"/>

This bind applies the following logic to each row in the table (except for the lastrow, which is assumed to be a template row): if the quantity is greater than zero orthe form is not submitting, then the row is relevant; otherwise, the row is notrelevant. This effectively makes all empty rows non-relevant when the form isbeing submitted (keeping in mind that template rows are already marked asnon-relevant).

ev:event="xforms-submit"

384 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 391: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-submit-doneOccurs when an XForms submission has successfully completed.

Syntax

Available In

<xforms:submission> element

Example

The following model includes two submissions: the first submission sends the formto a shipping database while the second submission sends the form to a billingdatabase. The form is set up so that when the user clicks the submit button, onlythe first submission is triggered. Once that submission has successfully completed,an xforms-submit-done event occurs. This triggers the xforms:send action in thefirst submission, which in turn triggers the second submission. This preventsbilling from occurring if the order was not properly registered with shipping.

<xforms:model><xforms:instance xmlns="">

<po><order>

<row><product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order>

</po></xforms:instance><xforms:submission id="submitShipping" method="post"

action="http://www.ibm.poserver.com/cgi-bin/shipping"includenamespaceprefixes=""><xforms:send ev:event="xforms-submit-done"

submission="submitBilling"/></xforms:submission><xforms:submission id="submitBilling" method="post"

action="http://www.ibm.poserver.com/cgi-bin/billing"includenamespaceprefixes=""/>

</xforms:model>

Usage Details1. The xforms-submit-done event does not work with replace all submissions

(refer to the xforms:send action for more information).

ev:event="xforms-submit-done"

XFDL Version 7.7 385

Page 392: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-submit-errorOccurs when an XForms submission returns an error.

Syntax

Available In

<xforms:submission> element

Example

The following example illustrates how you can remove empty rows from a tablebefore submitting a form.

First, you must set up your <xforms:submission> as shown below. When thissubmission begins, an xforms-submit event occurs. This triggers the firstxforms:setvalue action, which sets an element in the data model to ″true″ toindicate that a submission is in progress. If the submission returns an error, anxforms-submit-error event occurs. This triggers the second xforms:setvalue action,which sets the same element in the data model to ″false″ to indicate that asubmission is no longer occurring.<xforms:submission id="S" method="post" includenamespaceprefixes=""

action="http://www.ibm.poserver.com/cgi-bin/po"><xforms:setvalue ev:event="xforms-submit"

ref="instance('temps')/submitting" value="'true'"/><xforms:setvalue ev:event="xforms-submit-error"

ref="instance('temps')/submitting" value="'false'"/></xforms:submission>

Next, you must create an <xforms:bind> that affects the relevancy of the rows inthe form, as shown:<xforms:bind nodeset="order/row[not(last())]"

relevant="boolean-from-string( if( qty > 0 orinstance('temps')/submitting='false', 'true', 'false'))"/>

This bind applies the following logic to each row in the table (except for the lastrow, which is assumed to be a template row): if the quantity is greater than zero orthe form is not submitting, then the row is relevant; otherwise, the row is notrelevant. This effectively makes all empty rows non-relevant when the form isbeing submitted (keeping in mind that template rows are already marked asnon-relevant).

ev:event="xforms-submit-error"

386 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 393: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-validOccurs when a data node changes its state from invalid to valid, or when a validnode changes its value and remains valid.

Validity is determined based on whether the data matches the data type andconstraints specified in the model, as well as the schema validity. Note that thestate of ″required but empty″ is valid.

This event is triggered on the XForms control bound to that node.

Syntax

Available In

xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select,xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload

Example

This example shows a label item that displays the total for a purchase order. If thetotal exceeds 10,000, then the data node becomes invalid. If the total is thenchanged so that is it less than 10,000 then it becomes valid again, and thexforms-valid event is triggered. In this case, the event triggers an xforms:messageaction that explains that the value is now acceptable.

The following bind sets the maximum value of the po/total node in the datamodel to be 10,000:<xforms:bind nodeset="po/total" constraint=". &lt; 10000"/>

The following code defines the label that displays the total:<label sid="Total">

<xforms:output ref="po/total"><xforms:message ev:event="xforms-valid"

level="modal">Total is valid.</xforms:message></xforms:output>

</label>

Usage Details1. The order in which user interface events are processed is indeterminate. This

means you cannot rely on them processing in a particular order.

ev:event="xforms-valid"

XFDL Version 7.7 387

Page 394: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms-value-changedOccurs when a value is changed in an XForms option.

Syntax

Available In

xforms:input option, xforms:output option, xforms:range option, xforms:secretoption, xforms:select option, xforms:select1 option, xforms:textarea option

Example

The following example assumes that you are working with a purchase order formthat contains two data instances. The first data instance contains information aboutthe products that can be purchases, as shown:

<xforms:instance id="products" xmlns=""><products>

<product name="Widget" code="W1" unitcost="9.99"/><product name="Gadget" code="G1" unitcost="5.49"/><product name="Trinket" code="T1" unitcost="11.25"/><product name="Gromet" code="G2" unitcost="7.77"/>

</products></xforms:instance>

The second data instance contains the data elements that the user fills out to orderthe products:

<xforms:instance id="po" xmlns=""><po>

<order><row>

<product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order>

<subtotal>0</subtotal><tax>0</tax><total>0</total>

</po>

This instance is linked to a table item in the form, which creates a table with fourcolumns: product name, unit cost, quantity, and line total. The product name ischosen from a popup item that contains the xforms:select1 shown below. Whenthe user selects something from the popup, an xforms-value-changed event occurs.In this case, this event triggers two actions: first, the second column isautomatically populated with the unit cost for that item (by getting that cost fromthe po instance); second, the focus is moved to the third column, since the secondcolumn has already been completed.

<xforms:select1 ref="product" appearance="minimal"><xforms:label>Choose product</xforms:label>

<xforms:itemset nodeset="instance('products')/product"><xforms:label ref="@name"/><xforms:value ref="@code"/><xforms:extension>

<value compute="label"/>

ev:event="xforms-value-changed"

388 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 395: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

</xforms:extension></xforms:itemset><xforms:setvalue ref="../unitCost" ev:event="xforms-value-changed"

value="instance('products')/product[@code=instance('po')/order/row[index('orderTable')]/product]/@unitcost"/>

</xforms:select1>

Usage Details1. This event only occurs on xforms:select and xforms:select1 options that include

an <xforms:itemset> element. If the option includes a list of <xforms:item>elements instead, use the xforms-select and xforms-deselect events.

Details on function callsFunction calls allow form designers to create complex computations andcalculations in their forms. This includes: string functions, math functions, utilityfunctions, time and date functions, header and footer functions, and bidirectionalfunctions.

The Extensible Forms Description Language (XFDL) is an assertion-basedlanguage. Assertion-based languages include an engine that maintains statementsin the code as true. The functions described in this section allow an XFDL form toperform procedural operations that would normally require complicatedcomputations to achieve.

Function calls run code that can be external to the XFDL form definition. Below arethe BNF rules for functions.

FunctionCall := (LibName '.')? FunctionName '(' (Compute(',' Compute)*)? ')'

LibName ::= sid

FunctionName ::= sid

The LibName allows functions to be grouped into separate namespaces, but thepredefined functions in this specification do not require a LibName. The LibNameassigned to these predefined functions is system. Viewer functions enable formdevelopers to trigger actions in the Viewer from within a form. The Viewerfunctions are compiled into a package called viewer, similar to the XFDLsystempackage. Any user-defined package must contain an underscore in its name.

Examples

Calling a predefined function in the system namespace:<custom:status xfdl:compute="toggle(field1.value, 'high', 'low')"></custom:status>

or<custom:status xfdl:compute="system.toggle(field1.value, &#xA;

'high', 'low')"></custom:status>

Calling a function in the viewer namespace:viewer.functionName(parameter_1, parameter_2 ... parameter_n)

XFDL Version 7.7 389

Page 396: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 180. viewer namespace function calls

Parameter Description

viewer The name of the package that the function belongs to.

functionName The name of the function.

parameter A string representing the value of the parameter. Functions take zero ormore parameters.

Calling a user-defined function in a custom namespace:<value compute="hr_funcs.holiday(field1.value, field2.value)"></value>

About parameters in XFDL

Parameters are variables that are passed to XFDL functions. These variablesdetermine the result of the function. Parameter types include numbers, strings,Booleans, other functions, or references to values in a form.

In general, parameters are enclosed in single quotation marks, as shown:function('param1', 'param2')

Use empty quotation marks to represent null values.

In some cases you might want to copy a value from another element in the form.For example, you might want to use the value of a user-set field as the parameterin a function. This is called setting a reference. A reference is the “address” of anitem, option, or argument in the form. For example, the reference to the value of afield called NameField on page 2 would be “page2.NameField.value”.

When setting a reference, the parameter should not be enclosed in single quotationmarks, as shown:

function('param1', reference)

When the reference is evaluated, the value of the referenced item is retrieved andsubstituted for the reference, resulting in the following:

function('param1', 'retrieved value')

The function is then computed.

Optional parameters in viewer function calls are indicated with brackets ( [ ] ). Forexample:fileOpen(startdir, [extfilter])

In the function call above, the extfilter parameter is optional.

Reference strings

In some cases, your function might require a reference to the actual address of anitem, instead of the value contained by the item. This is called a reference string. Forexample, the second parameter of the measureHeight function allows you tospecify which item should be measured by providing a reference to that item.

Usually, you would provide a reference string that is enclosed in single quotationmarks, as shown:

measureHeight('pixels', 'descriptionField')

390 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 397: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The quotation marks indicate that the function should use the reference string asthe final value. So in this case, the function will measure the height of thedescriptionField.

Position of characters in strings

The position of the first character in a string is at position zero. For example, thecapital T in the following string is at position zero.

This is a string

String functionsString functions manipulate strings. For example, a string function could countlines and words or compare strings to other strings.

countLinesCounts the number of lines that a string would occupy a given width, and returnsthe number of lines. The count assumes that the font is a monospaced font, andthat the line wraps at the ends of words, not in the middle of words.

This function is useful for dynamically sizing the items into which a string will beinserted. For example, to insert an entry from a database into a field on a form,dynamically size the height of the field so that all of the text is visible.

Note: The width must be a character-based width and not a pixel-based width.

Syntax

Table 181. countLines parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in doublequotation marks; do not enclose option references inquotation marks.

width Positive integer The width, in monospaced characters, to base themeasurement on.

Returns

The number of lines, or empty string if an error occurs.

Example

In this example, the height of the field will be set by the number that countLinesreturns. The calculation is based on a dynamically-generated value and the setwidth (50) of the field.

<field sid="commentField"><label>Comments</label><itemlocation>

<below>deptField</below></itemlocation><size>

countLines(string, width)

XFDL Version 7.7 391

Page 398: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<width>50</width><height compute="countLines(value, '50')"></height>

</size></field>

392 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 399: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

countWordsCounts the number of words in a specified string.

Syntax

Table 182. countWords parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in sinlgequotation marks; do not enclose option references inquotation marks.

Returns

The number of words in the original string, or nothing if an error occurs.

Example

In this example, countWords returns a value of 5.<field sid="Field1">

<label>Test countWords()</label><format>

<datatype>string</datatype></format><value compute="countWords('Hello my name is Simon.')"></value>

</field>

countWords(string)

XFDL Version 7.7 393

Page 400: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

padPads or truncates an ASCII string to a specified length.

Pads or truncates an ASCII string to a specified length as explained:

PaddingIf the string is shorter than the specified length in thepad function then thestring is padded with spaces. The pad_orientation parameter determineswhere the original string is oriented within the characters that make up thenew string.

TruncatingIf the string is longer than the specified length in the pad function, thenthe string is truncated to the new length and any excess characters aredeleted. The pad_orientation parameter specifies what part of the originalstring is saved.

Syntax

Table 183. pad parameters

Parameter Type Description

string Literal string oroption reference

The original string to pad or truncate. Enclose literalstrings in single quotation marks; do not encloseoption references in quotation marks.

length Literal string oroption reference

Length of the new string. Enclose literal strings insingle quotation marks; do not enclose optionreferences in quotation marks.

pad_orientation Literal string oroption reference

optional. The position of the original string in thepadded or truncated string. Enclose literal strings insingle quotation marks; do not enclose optionreferences in quotation marks.

The valid choices are left, center, or right. The defaultvalue is left if the parameter is not valid or is notsupplied.

Returns

The string padded or truncated to the specified length, or nothing if an erroroccurs.

Example<field sid="Field1">

<label>Test pad(): Center pad</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="pad('Hello','11','center')"></value>

</field><field sid="Field2">

<label>Test pad(): Right pad</label>

pad(string, length, pad_orientation)

394 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 401: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<format><datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="pad('Hello','10','right')"></value>

</field><field sid="Field3">

<label>Test pad(): Right Truncate</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="pad('Hello','2','left')"></value>

</field>

In Field1 of the example, the pad function has the pad orientation of center. Thepad function inserts three spaces on either side of the string ’Hello’ to create a newstring which is 11 characters long and looks like the following:

" Hello "

In Field2 of the example, the pad function has the pad orientation of right. Thepad function inserts five spaces at the beginning of the string ’Hello’ to create anew string which is 10 characters long and looks like the following:

" Hello"

In Field3 of the example, the pad function has the pad orientation of left andtruncates four characters from the end of the string ’Hello’ to create the new string’He’, which is two characters long.

XFDL Version 7.7 395

Page 402: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

replaceTakes a string and replaces a substring of it (marked by start and end) with a newstring. Returns the resulting string.

If start is less than zero (0), then the substring begins on the first character ofstring. If end is greater than or equal to the length of string then the substringends on the last character of string. If the new string is not long enough (that is, itdoes not reach position end), replacement ends with the last character ofnewString. If the new string is too long (that is, it extends past position end),replacement ends on position end.

An error occurs if start is greater than end, if either of start and end is not a validinteger, or if string is empty.

Syntax

Table 184. replace parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

start Integer The position of the character at the start of thesubstring. The first character in string is zero.

end Integer The position of the character at the start of thesubstring. The first character in string is zero.

newString Literal string oroption reference

The replacement string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The modified string, or empty string if an error occurs.

Example

In this example, the result of replace is ’Go east, young man!’.<field sid="replaceField">

<label>Test replace()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>Go west, young man!</value><custom:change xfdl:compute="replace(value, '3', '6', 'east')"></custom:change>

</field>

replace(string, start, end, newString)

396 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 403: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

strlenReturns the length of string.

Syntax

Table 185. strlen parameters

Parameter Type Description

string Literal string oroption reference

The string you want to determine the length of.Enclose literal strings in single quotation marks; donot enclose option references in quotation marks.

Returns

A string containing the length.

Example

In this example, the result of strlen is ″28″.<field sid="stringLengthField">

<label>The length of this label is:</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="strlen(label)"></value>

</field>

strlen(string)

XFDL Version 7.7 397

Page 404: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

strmatchDetermines if the wildcard string wild matches the non-wildcard string real andreturns the Boolean result.

Syntax

Table 186. strmatch parameters

Parameter Type Description

wild Literal string oroption reference

The wildcard string to match. Enclose literal strings insingle quotation marks, do not enclose optionreferences in quotation marks. Any of the followingwild card characters can be used:

? Represents any one (1) character.

* Represents any number of characters.

real Literal string oroption reference

The non-wildcard match string. Enclose literal stringsin single quotation marks, do not enclose optionreferences in quotation marks.

Returns

A string containing ″1″ if a match occurs and ″0″ if no match occurs.

Example

In this example, the result of strmatch is ″1″.<field sid="testStrmatch">

<label>Test strmatch()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>To be or not to be, etc.</value><custom:change xfdl:compute="strmatch('?o be* ?o be*', value)"

></custom:change></field>

strmatch(wild, real)

398 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 405: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

strpbrkReturns the position of the first character in string1 that matches any of thecharacters in string2. Note that the count is zero based.

Syntax

Table 187. strpbrk parameters

Parameter Type Description

string1 Literal string oroption reference

The string. Enclose literal strings in sinngle quotationmarks; do not enclose option references in quotationmarks.

string2 Literal string oroption reference

The substring of characters that you want to find theposition of. Enclose literal strings in single quotationmarks; do not enclose option references in quotationmarks.

Returns

A string containing the position, or ″-1″ if no matching characters are found.

Example

The result of strpbrk, displayed in ″FIELD2″ in the example below, is ″9″.<field sid="testStrpbrk">

<label>testField</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>To be or not to be, etc.</value><custom:change xfdl:compute="strpbrk(value, 'lLmMnNOpP')"></custom:change>

</field><field sid="FIELD2">

<label>result field</label><value compute="testStrpbrk.custom:change"></value>

</field>

strpbrk(string1, string2)

XFDL Version 7.7 399

Page 406: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

strrstrReturns the position of the first character of the last occurrence of the substringstring2 in the string string1. Note that the count is zero based.

Syntax

Table 188. strrstr parameters

Parameter Type Description

string1 Literal string oroption reference

The string. Enclose literal strings in single quotationmarks; do not enclose option references in quotationmarks.

string2 Literal string oroption reference

The substring of characters that you want to find theposition of. Enclose literal strings in single quotationmarks; do not enclose option references in quotationmarks.

Returns

A string containing the position, or ″-1″ if no substring is found.

Example

The result of strrstr, displayed in ″FIELD2″ in the example below, is ″16″.<field sid="testStrrstr">

<label>testField</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>To be or not to be, etc.</value><custom:change xfdl:compute="strrstr(value, 'be')"

></custom:change></field><field sid="FIELD2">

<label>result field</label><value compute="testStrrstr.custom:change"></value>

</field>

strrstr(string1, string2)

400 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 407: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

strstrReturns the position of the first character of the first occurrence of string2 instring1. Note that the count is zero based.

Syntaxstrstr(string1, string2)

Returns

A string containing the position, or ″-1″ if no occurrence is found.

Table 189. strstr parameters

Parameter Type Description

string1 Literal string oroption reference

The string. Enclose literal strings in single quotationmarks; do not enclose option references in quotationmarks.

string2 Literal string oroption reference

The substring of characters that you want to find theposition of. Enclose literal strings in single quotationmarks; do not enclose option references in quotationmarks.

Example

The result of strstr, displayed in ″FIELD2″ in the example below, is ″3″.<field sid="testStrstr">

<label>testField</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>To be or not to be, etc.</value>

<custom:change xfdl:compute="strstr(value, 'be')"></custom:change>

</field><field sid="FIELD2">

<label>result field</label><value compute="testStrstr.custom:change"></value>

</field>

XFDL Version 7.7 401

Page 408: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

substrReturns the substring of string from the position indicated in start through theposition indicated in end. If start is less than zero then the substring begins on thefirst character of string. If end is greater than or equal to the length of string thenthe substring ends on the last character of string.

An error occurs if string is greater than end, if either of string and end is not avalid integer, or if string is empty.

Syntax

Table 190. substr parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

start Integer The position of the character at the start of thesubstring. The first character in string is zero.

end Integer The position of the character at the end of thesubstring. The first character in string is zero.

Returns

The substring, or an empty string if an error occurs.

Example

The result of substr, displayed in ″FIELD2″ in the example below, is ″Watso″.<field sid="surnameField">

<label>Surname</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>Watson</value><custom:change xfdl:compute="substr(value, '0', '4')"

></custom:change></field><field sid="FIELD2">

<label>result field</label><value compute="surnameField.custom:change"></value>

</field>

substr(string, start, end)

402 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 409: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

tolowerReturns the lowercase of string.

Syntaxtolower(string)

Table 191. tolower parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The lower case string.

Example

The result of tolower, shown in ″displayField″ in the example below, is ″hello!″.<field sid="tolowerField">

<label>Test tolower()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>Hello!</value><custom:change xfdl:compute="tolower(value)"></custom:change>

</field><field sid="displayField">

<value compute="tolowerField.custom:change"></value></field>

XFDL Version 7.7 403

Page 410: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

toupperReturns the uppercase of string.

Syntax

Table 192. toupper parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The upper case string.

Example

The result of toupper, shown in ″displayField″ in the example below, is ″HELLO!″.<field sid="toupperField">

<label>Test toupper()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>Hello!</value><custom:change xfdl:compute="toupper(value)"></custom:change>

</field><field sid="displayField">

<value compute="toupperField.custom:change"></value></field>

toupper(string)

404 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 411: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

trimReturns a copy of string with all leading and trailing white space (blankcharacters, tab characters, newline characters, or carriage returns) removed.

Syntax

Table 193. trim parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The string with leading and trailing white space removed.

Example

In this example, the result of trim is ″Test trim()″.<field sid="trimField">

<label> Test trim() </label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="trim(label)"></value>

</field>

trim(string)

XFDL Version 7.7 405

Page 412: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

URLDecodeReturns a URL-decoded version of string.

Syntax

Table 194. URLDecode parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The URL-decoded string.

Example

In this example, the result of URLDecode is ″This is a line″.<field sid="URLDecodeField">

<label>Test URLDecode()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="URLDecode('This%20is%20a%20line%0D')"></value>

</field>

URLDecode(string)

406 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 413: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

URLEncodeReturns a URL-encoded version of string.

Syntax

Table 195. URLEncode parameters

Parameter Type Description

string Literal string oroption reference

The original string. Enclose literal strings in singlequotation marks; do not enclose option references inquotation marks.

Returns

The URL-encoded string.

Example

In this example, the result of URLEncode is ″This+is+a+line%0A″.<field sid="URLEncodeField">

<value compute="URLEncode('This is a line\n')"></value></field>

Math functionsMath functions perform mathematical calculations, such as cosine, rounding, orfactorial values.

absReturns the absolute value of the number represented in decimal.

An error occurs if number is not a valid number.

Syntaxabs(number)

Table 196. abs parameters

Parameter Type Description

number Decimal number Any decimal number.

Returns

A string containing the absolute of the number, or an empty string if an erroroccurs.

Example

In this example, the result of abs is “2341.23”.<field sid="absTest">

<label>Test abs()</label><format>

<datatype>string</datatype>

URLEncode(string)

XFDL Version 7.7 407

Page 414: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<constraints><mandatory>on</mandatory>

</constraints></format><value compute="abs('-2341.23')"></value>

</field>

408 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 415: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

acosReturns the arc cosine of a number stored in number.

An error occurs ifnumber is not a valid number or has absolute value greater than1.

Syntax

Table 197. acos parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the arc cosine, or empty string if an error occurs.

Example

In this example, the result of acos is ″1.047198″.<field sid="arccosineField">

<label>Test acos()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="acos('0.5')"></value>

</field>

acos(number)

XFDL Version 7.7 409

Page 416: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

annuityReturns the present valueannuity factor for an ordinary annuity, at a periodicinterest rate indicated by rate over a number of periods specified in periods.Present value is the lump sum to invest at rate to produce a set payment overperiods. An ordinary annuity provides the payment at the end of each periodspecified in periods.

This function might be used to figure out either:v P, the present value of the lump sum to invest.v R, the periodic payment amount that will be received.

For reference:v P = R * annuity_factorv R = P / annuity_factor

An error occurs if periods is not a valid integer, or if rate is 0.

Syntax

Table 198. annuity parameters

Parameter Type Description

rate Decimal number The rate of interest in decimal form compounded foreach period.

periods Integer The number of periods.

Returns

A string containing the present value annuity factor, or null if an error occurs.

Example

In this example, annuity returns ″5.786373″ and, if the desired payment enteredinto ″paymentField″ were $1, then the value of ″presentValueInv″ would be $5.78.That is, a person would have to invest $5.78 at 5% for seven payments.

<field sid="presentValueInv"><label>The present value to invest is:</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="paymentField.value * &#xA;

annuity('.05', '7')"></value></field>

annuity(rate, periods)

410 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 417: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

asinReturns the arc sine of a number stored in number.

An error occurs if number is not a valid decimal or has an absolute value greaterthan 1.

Syntax

Table 199. asin parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the arc sine, or null if an error occurs.

Example

In this example, the result of asin is ″0.523599″.<field sid="arcsinField">

<label>Test asin()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="asin('0.5')"></value>

</field>

asin(number)

XFDL Version 7.7 411

Page 418: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

atanReturns the arc tangent of a number stored in .

An error occurs if number is not a valid decimal.

Syntax

Table 200. atan parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the arc tangent, or null if an error occurs.

Example

In this example, the result of atan is ″0.463648″.<field sid="arctangentField">

<label>Test atan()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="atan('0.5')"></value>

</field>

atan(number)

412 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 419: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

ceilingReturns the ceiling of a number.

An error occurs if number is not a valid number.

Syntax

Table 201. ceiling parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the ceiling of the number, or an empty string if an error occurs.

Example

In this example, the result of ceiling is ″-19″.<field sid="ceilingTest">

<label>Test ceiling()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="ceiling('-19.6')"></value>

</field>

ceiling(number)

XFDL Version 7.7 413

Page 420: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

compoundReturns the compound interest factor at a rate indicated by rate over a number ofperiods specified in periods.

This function might be used to calculate the total amount of a loan, by multiplyingan original principle by the result of compound.

An error occurs if periods is not a valid integer.

Syntax

Table 202. compound parameters

Parameter Type Description

rate Decimal number The rate of interest in decimal form compounded foreach period.

periods Integer The number of periods.

Return

A string containing the compound interest factor, or an empty string if an erroroccurs.

Example

In this example, the result of compound is ″1.948717″. The value of the field is1.948717 x the amount in the ″principleField″.

<field sid="totalAmountField"><label>Total Amount of Loan</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="principleField.value * &#xA;

compound('.1', '7')"></value></field>

compound(rate, periods)

414 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 421: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

cosReturns the cosine of an angle stored in and expressed in radians.

An error occurs if angle does not contain a valid angle.

Syntax

Table 203. cos parameters

Parameter Type Description

angle Decimal number Any decimal number representing the angle inradians.

Returns

A string containing the cosine, or null if an error occurs.

Example

In this example, the result of cos is ″-0.416147″.<field sid="cosineField">

<label>Test cos()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="cos('2')"></value>

</field>

cos(angle)

XFDL Version 7.7 415

Page 422: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

deg2radReturns the number of radians in an angle expressed in degrees stored in .

An error occurs if angle does not contain a valid angle.

Syntax

Table 204. deg2rad parameters

Parameter Type Description

angle Decimal number Any decimal number representing the angle indegrees.

Returns

A string containing the number of radians, or null if an error occurs.

Example

In this example, the result of deg2rad is ″2.00000″.<field sid="deg2radField">

<label>Test deg2rad()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="deg2rad('114.591559')"></value>

</field>

deg2rad(angle)

416 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 423: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

expReturns the exponentiation of the number represented in number. Forexample,number.

An error occurs if number is not a valid decimal.

Syntax

Table 205. exp parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the exponentiation of the number, or null if an error occurs.

w

Example

In this example, the result of exp is ″20.855369″.<field sid="expTestField">

<label>Test exp()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="exp('3')"></value>

</field>

exp(number)

XFDL Version 7.7 417

Page 424: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

factReturns the factorial value of the integer represented in integer.

An error occurs if integer is negative.

Syntax

Table 206. fact parameters

Parameter Type Description

integer Integer Any non-negative number

Returns

A string containing the factorial of the integer, or null if an error occurs.

Example

In this example, the result of fact is ″40320″.<field sid="factTestField">

<label>Test fact()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="fact('8')"></value>

</field>

fact(number)

418 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 425: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

floorReturns the floor of the number represented in number.

An error occurs if number is not a valid number.

Syntax

Table 207. floor parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the floor of the number, or null if an error occurs.

Example

In this example, the result of floor is ″-20″.<field sid="floorTestField">

<label>Test floor()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="floor('-19.6')"></value>

</field>

floor(number)

XFDL Version 7.7 419

Page 426: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

lnReturns the natural logarithm of the number represented in number.

An error occurs if number is not a decimal number greater than zero.

Syntax

Table 208. ln parameters

Parameter Type Description

number Decimal number Any decimal number

Returns

A string containing the natural log of the number, or an empty string if an erroroccurs.

Example

In this example, the result of ln is ″0″.<field sid="lnTestField">

<label>Test ln()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="ln('1')"></value>

</field>

ln(number)

420 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 427: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

logReturns the logarithm of the number represented in number to the base indicatedby base.

An error occurs if either of number or base is not a valid number. The numbermust be equal to, or greater than 1.

Syntax

Table 209. log parameters

Parameter Type Description

number Decimal number Any decimal number

base Decimal number optional. A number representing the base for whichthe logarithm will be computed. If no base is supplied,a base of 10 is used.

Returns

A string containing the log of the number to the base, or an empty string if anerror occurs.

Example

In this example, the result of log is ″2″.<field sid="logTestField">

<label>Test log()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="log('100', '10')"></value>

</field>

log(number, [base])

XFDL Version 7.7 421

Page 428: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

modReturns the modulus of the number represented in number using the divisorindicated by divisor.

An error occurs if either of number or divisor is not a valid decimal number, orifdivisoris 0.

Syntax

Table 210. mod parameters

Parameter Type Description

number Decimal number Any decimal number.

periods Decimal number Any decimal number except zero (0) representing thedivisor for which the modulus will be computed.

Returns

A string containing the modulus, or an empty string if an error occurs.

Example

In this example, the result of mod is ″-0.200000″.<field sid="modTestField">

<label>Test mod()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="mod('-3.5', '.3')"></value>

</field>

mod(number, divisor)

422 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 429: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

piReturns the value of pi to 13 decimal places.

Syntax

Returns

A string containing the value of pi.

Example

In this example, the result of pi is ″3.14159265359″ (precision issoftware-dependent).<field sid="piTestField">

<label>Test pi()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="pi()"></value>

</field>

pi()

XFDL Version 7.7 423

Page 430: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

powerReturns the number represented in number raised to the power indicated bypower.

An error occurs if either of number or power is not a valid number.

Syntax

Table 211. power parameters

Parameter Type Description

number Decimal number Any decimal number.

power Decimal number Any decimal number representing the power by whichthe number will be raised.

Returns

A string containing the number raised to the power, or an empty string if an erroroccurs.

Example

In this example, the result of power is ″100.00000″.<field sid="powerTestField">

<label>Test power()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="power('0.1', '-2')"></value>

</field>

power(number, power)

424 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 431: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

rad2degReturns the number of degrees in an angle expressed in radians stored in angle.

An error occurs if angle does not contain a valid angle.

Syntaxrad2deg(angle)

Table 212. rad2deg parameters

Parameter Type Description

angle Decimal number Any decimal number representing the angle inradians.

Returns

A string containing the number of degrees, or an empty string if an error occurs.

Example

In this example, the result of rad2deg is ″114.591559″.<field sid="rad2degField">

<label>Test rad2deg()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="rad2deg('2')"></value>

</field>

XFDL Version 7.7 425

Page 432: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

randReturns a random integer from the range of integers indicated by lowerlimit andupperlimit, inclusive.

An error occurs if either of lowerlimit or upperlimit is not a valid integer, orupperlimit is less than lowerlimit.

Syntax

Table 213. rand parameters

Parameter Type Description

lowerlimit Integer Any integer number representing the lower limit ofthe random number’s range.

upperlimit Integer Any integer number representing the upper limit ofthe random number’s range.

Returns

A string containing the random integer, or an empty string if an error occurs.

Example

In this example, the result of rand is an integer in the range [45,90].<field sid="randTestField">

<label>Test rand()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="rand('45', '90')"></value>

</field>

rand(lowerlimit, upperlimit)

426 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 433: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

roundReturns the number represented in number rounded to the nearest decimalposition indicated by place. For example, 100, 10, 1, 0.1, and so on. All numbersare rounded to the right on an x/y graph.

An error occurs if number is not a valid decimal number or place is not a powerof 10.

Syntax

Table 214. round parameters

Parameter Type Description

number Decimal number Any decimal number.

place Decimal number Any decimal number representing the decimal placewhere number is to be rounded.

Returns

A string containing the rounded number, or an empty parameter if an error occurs.

Examples

In this example, the result of round is ″323.2400″.<field sid="roundTestField">

<label>Test round()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="round('323.235', '.01')"></value>

</field>

In this example, the result of round is ″-323.2300″.<field sid="roundTestField">

<label>Test round()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="round('-323.235', '.01')"></value>

</field>

round(number, place)

XFDL Version 7.7 427

Page 434: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

sinReturns the sine of an angle stored in angle and expressed in radians.

An error occurs if angle does not contain a valid angle.

Syntax

Table 215. sin parameters

Parameter Type Description

angle Decimal number Any decimal number representing the angle inradians.

Returns

A string containing the sine, or an empty string if an error occurs.

Example

In this example, the result of sin is ″0.909297″.<field sid="sineField">

<label>Test sin()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="sin('2')"></value>

</field>

sin(angle)

428 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 435: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

sqrtReturns the square root of the number represented in number.

An error occurs if number is a negative number.

Syntax

Table 216. sqrt parameters

Parameter Type Description

number Decimal number Any non-negative number

Returns

A string containing the square root, or an empty string if an error occurs.

Example

In this example, the result of sqrt is ″4.415880″.<field sid="sqrtTestField">

<label>Test sqrt()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="sqrt('19.5')"></value>

</field>

sqrt(number)

XFDL Version 7.7 429

Page 436: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

tanReturns the tangent of an angle expressed in radians stored in angle.

An error occurs if angledoes not contain a valid angle. For example, p/2, 3p/2, or5p/2.

Syntax

Table 217. tan parameters

Parameter Type Description

angle Decimal number Any decimal number representing the angle inradians.

Returns

A string containing the tangent, or an empty string if an error occurs.

Example

In this example, the result of tan is ″-2.185040″.<field sid="tanField">

<label>Test tan()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="tan('2')"></value>

</field>

Utility functionsUtility functions perform basic work functions, such as toggling switches, settingvalues, or counting children.

applicationNameReturns the name of the application that is processing the form. This name must beset in the application so that it is available to the function call.

Syntax

Returns

A string containing the name of the product that the form is running in. Forexample, Lotus Forms products return the following application names:v IBM Lotus Forms Viewer — Viewerv IBM Lotus Forms Server – Webform Server — Webform Server

tan(angle)

applicationName()

430 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 437: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

In this example, if the application was being displayed by the Viewer, the result ofapplicationName would be ″Viewer″.

<field sid="appNameField"><label>Test applicationName()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="applicationName()"></value>

</field>

XFDL Version 7.7 431

Page 438: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

applicationVersionReturns the version number of the application that is running the form in theformat ″VV.RR.MM″, where VV is the version number, RR is the release number,and MM is the modification number.

Syntax

Returns

A string containing the application version number.

Example

In this example, the form is open in an application of version 3.2.4, the result ofapplicationVersion would be ″03.02.04″.

<field sid="appVersionField"><label>Test applicationVersion()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="applicationVersion()"></value>

</field>

applicationVersion()

432 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 439: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

applicationVersionNumReturns the decimal form of the version of the currently running application. Thisnumber is obtained from the hexadecimal format 0xMMmmTTPP, where MM isthe Major version number, mm is the minor version number, TT is the maintenancenumber, and PP is the patch number. At this point, individual patches are notrecognized in version numbers and so will always be 0.Returns the decimal formof the version of the currently running application. This number is obtained fromthe hexadecimal format 0xVVRRMMFF00, where VV is the version number, RR isthe release number, MM is the modification number, and FF is the fix packnumber.

Syntax

Returns

A string containing the application version number.

Example

In this example, if the form is open in a product with an application at version3.2.4, the result of applicationVersionNum would be “50463744”, which is thedecimal representation of 0x03020400.

<field sid="appVersionNumField"><label>Test applicationVersionNum()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="applicationVersionNum()"></value>

</field>

applicationVersionNum()

XFDL Version 7.7 433

Page 440: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

buildVersionReturns the build version number of the application that is running the form in theformat ″VV.RR.MM.BB″, where VV is the version number, RR is the releasenumber, MM is the modification number, and BB is the build number.

Syntax

Returns

A string containing the application build version number.

Example

In this example, if a form is open in an application of version 3.2.4.2, the result ofbuildVersion would be “03.02.04.02”.

<field sid="buildVersionField"><label>Test buildVersion()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="buildVersion()"></value>

</field>

buildVersion()

434 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 441: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

buildVersionNumReturns the decimal form of the build version of the currently running application.This number is obtained from the hexadecimal format 0xMMmmTBBB, where MMis the Major version number, mm is the minor version number, T is themaintenance number, and BBB is the build number. Returns the decimal form ofthe build version of the currently running application. This number is obtainedfrom the hexadecimal format 0xVVRRMBBB, where VV is the version number, RRis the release number, M is the modification number, and BBB is the build number.

Syntax

Returns

A string containing the build version number.

Example

In this example, if running in an application at version 3.2.4.2, the result ofbuildVersionNum would be “50463746”, which is the decimal representation of0x03020402.

<field sid="buildVersionNumField"><label>Test buildVersionNum()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="buildVersionNum()"></value>

</field>

buildVersionNum()

XFDL Version 7.7 435

Page 442: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

checkValidFormatsChecks the formatted items in the form and returns the number of items whoseformat is not valid. You can also reduce the scope of the validation check bychecking specific pages or individual items. Furthermore, you can set the functionto create a list of the items that are not valid.

Syntax

Table 218. checkValidFormats parameters

Parameter Type Description

listReference Reference string Optional. A reference to an option that will contain thelist of items that are not valid.

For example, if you called the function from a labelitem, you might create the following custom option:

<label sid="numberInvalid"><custom:list/>

In this case, you would use the following reference:

custom:list

The function creates the option if it does not alreadyexist. The function then populates the option with alist of references to the items that are not valid.

For example, if two fields were not valid you wouldget a list like this:

<custom:list><custom:invalidref>Page1.Field1</custom:invalidref><custom:invalidref>Page1.Field2</custom:invalidref>

</custom:list>

If this parameter is not specified in the call, thefunction still validates all form items but does notcreate a list of references to invalid items.

optionName String optional. Sets the tag that is used to store each item inthe list of not valid items. This parameter is usefulwhen you need to set a particular namespace for thelist. For example, if you store your list in a custom:listoption, you might set the following tag:

custom:invalidref

Doing this ensures that the list is stored in the samenamespace as the containing element.

Default: xfdl:option

validationReference

Reference string optional. A reference to the section of the form thatyou want to validate. For example, ″PAGE1.FIELD1″.If ″ ″ or an empty string is used, this function checksthe current object.

checkValidFormats(listReference, optionName, validationReference,referenceType, schema)

436 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 443: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 218. checkValidFormats parameters (continued)

Parameter Type Description

referenceType String optional. Defines the type of reference used by thevalidation reference parameter. Valid settings are form,page, or item.

schema Reference string optional. Defines the format of the reference. If notspecified, the default of XFDL is applied.

Returns

Returns the number of items that failed the validity check. If all items are valid,the function returns 0.

Example

The following sample form shows how you can use thecheckValidFormats functionto specify custom behaviors when a form with values that are not valid issubmitted. Note that the format of FIELD2 is checked even if it is not currentlydisplayed.

<?xml version="1.0"?><XFDL xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.7"

xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.7"xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom"><globalpage sid="global">

<global sid="global"></global></globalpage><page sid="PAGE1">

<global sid="global"></global><field sid="FIELD1">

<format><datatype>date</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format></field><field sid="FIELD2">

<value>4.00</value><format>

<datatype>dollar</datatype><constraints>

<mandatory>on</mandatory><applyifinvisible>on</applyifinvisible>

</constraints></format>

</field><button sid="BUTTON1">

<value>Submit</value><type>done</type><url>http://localhost/cgi-bin/test.pl</url><custom:checkIfValid xfdl:compute=

"toggle(BUTTON1.activated, 'off', 'on') == '1' ? &#xA;(checkValidFormats('custom:brokenOptions', &#xA;'custom:invalidref') != '0' ? &#xA;set('BUTTON1.activated', 'off') + &#xA;viewer.messageBox('Unable to send because at ' &#xA;+. 'least ' +. custom:brokenOptions[0] +. &#xA;'item is invalid.') : '') : ''"></custom:checkIfValid>

</button></page>

</XFDL>

XFDL Version 7.7 437

Page 444: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The format option for FIELD1 specifies that this item must contain a date andcannot be blank. If a user submits the form without correctly completing this field,the checkValidFormats function prevents the submission. Instead, the functioncreates a new option called brokenOptions:

<custom:brokenOptions><custom:invalidref>PAGE1.FIELD1</custom:invalidref>

</custom:brokenOptions>

The remaining code uses the information in brokenOptions to display acontext-sensitive message to the user.

Usage detailsv Use checkvalidformat in a compute on individual pages. As a result, the

function is run only when the user leaves that page. Performance is thenimproved.

v If page loading is enabled, validation checks can only be performed on pagesthat have been loaded into memory. If a validation check is made when theloadallbefore parameter is used, then all pages in the form are checked.

v Custom items are always excluded from validation checks.v Use the format constraint, applyifinvisible, to include invisible or inactive items

in the validation check.v The checkvalidformat function reports validation failures on specified pages

defined in the form global settings. The pageloading option is used to specifywhich pages are loaded in the IBM Lotus Forms Viewer and IBM Lotus FormsServer – Webform Server. These specified pages are stored into memory toimprove the loading performance of large complete forms. The specified pagesare checked for validation. If page loading is not enabled, all items are checked.

v Items with display, visible, and active options set to off are excluded from thevalidation checks.

v Custom items are always excluded from validation checks.

438 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 445: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

countChildrenCounts the number of children that belong to a form element.

Note that this count includes all global elements, such as global pages and globalitems, if they are child nodes. Additionally, the count includes elements that arenot written out with form but are included when the form is in memory, such asactivated, pageprevious, pagenext, itemprevious, and itemnext.

Syntax

Table 219. countChildren parameters

Parameter Type Description

reference Referencestring

A reference to the element containing the childelements.

referenceType String Optional. Identifies the type of reference used in thereference parameter. Valid settings are: form,page,item , option, and array. An array is anythingbelow the option level in the form.

scheme String Optional. The scheme used to write the reference.Defaults value is XFDL. This parameter requires thereferenceType parameter.

Returns

An integer representing the number of child elements or an empty string if anerror occurs.

Example

In this example, the countChildren function calculates the number of items on thepage. Note that the compute subtracts one from this total to account for the globalitem.

<field sid="totalItems"><value compute="countChildren('Page1', 'page') - 1"></value>

</field>

countChildren(reference, referenceType, scheme)

XFDL Version 7.7 439

Page 446: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

countDatagroupItemsReturns the number of items in a particular datagroup.

Syntax

Table 220. countDatagroupItems parameters

Parameter Type Description

datagroup String The name of the datagroup. This can include a pagereference, such as ″Page1.myGroup″. If it does not, thefunction searches for the group on the page thatcontains the function.

Returns

The number of items in the datagroup or an empty string if an error occurs.

Example

In this example, the field displays the number of items in a datagroup called″Data1″.

<field sid="totalCount"><label>The Green group contains this many items:</label><value compute="countDatagroupItems('Data1')"></value>

</field>

countDatagroupItems(datagroup)

440 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 447: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

countGroupedItemsCounts the number of items in a group. countGroupedItems can also count thenumber of items in a group that have a particular characteristic, such as a specificoption or setting.

countGroupedItems returns any of the following:v The total number of items in a group.v The total number of items in a group that have a particular option. For example,

the number of items with a bgcolor setting in a group.v The total number of items in a group that have a particular option setting. For

example, the number of items with a bgcolor set to blue in a group.

Syntax

Table 221. countGroupedItems parameters

Parameter Type Description

group String The name of the group that you want to get an itemfrom. This name can include a page reference, such as″Page1.myGroup″.

option String Optional. If supplied, the function will only countitems that contain this option.

literal String Optional. If supplied, the function will only countitems that have the specified option set to this value.Must be used with theoption parameter.

groupContext String Optional. The starting point to use to locate the groupif the group name is not fully qualified. For example,if the group was on the first page, you would use″Page1″.

groupContextType String Optional. The level of the group context parameter,such as page, item or option. Currently, only page isvalid.

referenceType String Optional. Sets the scope of the reference that isreturned. The reference begins at the level below this.For example, to get a reference that begins at the pagelevel, set this parameter to page Valid settings areform and page. The default reference type is form.

scheme String Optional. The referencing scheme used. The defaultscheme is XFDL.

Returns

The number of items that match the search criteria or an empty string if an erroroccurs.

Example

In this example, the field displays the number of items in a group called ″Green″.

countGroupedItems(group, option, literal, groupContext, groupContextType,referenceType, scheme)

XFDL Version 7.7 441

Page 448: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<field sid="totalCount"><label>The Green group contains this many items:</label><value compute="countGroupedItems('Page1.Green')"></value>

</field>

442 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 449: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

decimalReturns the decimal representation of the number represented by number with thebase indicated by base.

An error occurs if number is not a valid number, if base is not a valid positiveinteger base, or number cannot be resolved under the specified base.

Syntax

Table 222. tan parameters

Parameter Type Description

number Number Any number.

base Positiveinteger

An integer that is the base of the provided number.

Returns

A string containing the decimal representation of the number, or an empty string ifan error occurs.

Example

In this example, the result of decimal is ″-74″.<field sid="decimalTestField">

<label>Test decimal()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="decimal('-4A', '16')"></value>

</field>

decimal(number, base)

XFDL Version 7.7 443

Page 450: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

destroyDestroys (or deletes) specified elements from a form, including box, button, check,combobox, field, labels, line, list, pages, popup, radio, and spacer.

You can use the destroy function to remove fields that are no longer relevant,based on information entered elsewhere on the form. In effect, this functionpermits you to dynamically customize the form for the user, which reduces thepossibility of users entering inaccurate or unnecessary information. When acompute within the destroy function causes a change to the form, the form checksfor other computes referenced by the destroy function and evaluates themimmediately.

For example, a form could include a check box indicating whether a person’smailing address is the same as the billing address. When the user selects this checkbox, the destroy function could be called to dynamically delete all items pertainingto the mailing address.

Syntax

Table 223. destroy parameters

Parameter Type Description

reference Referencestring

A reference to the element you want to destroy.

type String The type of element being destroyed. Valid types arepage, item, or option.

For a list of nodes that can be deleted using destroy, see “Destroy Function QuickReference” on page 636.

Returns

Nothing if the operation was successful, or an error message if the reference cannotbe destroyed.

Example

This example creates a button that, when clicked by the user, deletes ″FIELD1″from ″PAGE2″ of the form.

<button sid="deleteField_BUTTON"><value>Delete</value><custom:destroy xfdl:compute=

"toggle(activated, 'off', 'on') == '1' ? &#xA;destroy('PAGE2.FIELD1', 'item') : ''"></custom:destroy>

</button>

Usage Detailsv In general, a node is only considered to be in use when it is currently displayed

by an application, such as the IBM Lotus Forms Viewer. However, a page that isnot on display can contain nodes that are being referenced by a page that is ondisplay. In that case, the first page is said to be in partial use, and the secondpage is regarded as being in full use. You are allowed to destroy certain types of

destroy(reference, type)

444 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 451: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

nodes even when they are in use. In particular, nodes that contain graphical userinterface items can be destroyed while being displayed by an application.For example, PAGE1, which is not currently on display, contains a list item andseveral cells. PAGE2, which is being displayed in the Viewer, contains a popupitem that is populated with the cells from PAGE1. In this case, PAGE1 is inpartial use, and PAGE2 is in full use.The page node itself can only be destroyed if it is neither in full nor partial use.A page can only be deleted if it is not currently being displayed and no otherpage that refers to it is being displayed.

v If you destroy an entire page, the bindings to the XForms data model areautomatically removed. However, this update does not occur if you only destroyan item or option within the page. In other words, destroying items or optionsthat are bound to the data model can cause your form to behave erratically.

v There are types of nodes that you should not attempt to destroy. The ability todynamically destroy the elements of a form provides a great deal of control.However, the destruction of certain types of nodes could produce undesirableresults. For this reason, you should not attempt to destroy:– The form itself.– The form global or any of its descendants (excluding the XML data model).– Any page that is currently in full or partial use.– The page global (or any descendants) of a page that is in full or partial use.– A toolbar item belonging to a page that is in full use.– An action item belonging to a page that is in full use.– A help item.– An array element.– Any kind of option, including:

- An event option such as focused, activated, mouseover, or keypress.- A relative option such as itemfirst, itemlast, itemprevious, itemnext,

pagefirst, pagelast, pageprevious, or pagenext.Attempting to delete any of these nodes causes the form to display an errormessage.

v The default behavior of the destroy function only allows the destruction ofnodes that are not in use. However, there are several exceptions to this rule. Inparticular, the following nodes can be destroyed even when they are in use:– The graphical user interface items: box, button, check, combobox, field, labels,

line, list, pages, popup, radio, and spacer.– Cell items.– Data items.– Toolbar items, provided that the page is only in partial use.– Any portion of an XML data model.– Any elements in a non-XFDL namespace.– Custom options.– Options on inactive pages.

v There are other specific situations in which the destroy function cannot be used:– First, an item cannot destroy itself. The call to the destroy function should not

occur within the code for the item you wish to destroy.– Consider a form containing a field item and a button. Within the XFDL code

for the field item there is a destroy function that can be activated (or toggled)by the button. In this case, you would not be allowed to use the field’s

XFDL Version 7.7 445

Page 452: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

destroy function to delete the button. In other words, you are not permittedto destroy an item that activates the destroy function.

– Although you cannot specifically destroy a relative option such as pagenext,it might be possible to delete the entire node in which it occurs.

– For security reasons, you should not use destroy to delete signature items.The Lotus Forms API provides a specific method, called UFLDeleteSignature,for this purpose. For more information on this method, refer to the Java, C, orCOM Editions of theLotus Forms Server API – API User’s Manual for thelanguage you are using.

v You cannot use the destroy function to delete item or option nodes that arebound to the XForms model. To ensure that bound nodes are correctly deleted,you must destroy the entire page node.

v The status of the dirtyflag must be manually set to on when the form ismodified by the destroy function.

446 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 453: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

duplicateCopies a specified form element, places the copy in a designated location, andassigns it a new name. Computes in duplicate elements are evaluated immediately.A form node refers to a uniquely identifiable portion of a form, such as the formitself, a page, an item, an option or an array element. Every node within a formrequires a unique identifier (for example, PAGE1 or SAVE_BUTTON). Thisidentifier is referred to as a scope identifier or sid. Each sid must be unique withinits parent node.

When creating elements for duplication, you must use relative tags.

Syntax

Table 224. duplicate parameters

Parameter Type Description

reference Referencestring

A reference to the element you want to duplicate. Forexample, if you want to duplicate FIELD1 on PAGE1,the reference would be PAGE1.FIELD1.

type String The type of element being duplicated. Valid types arepage, item, or option.

For example, if you want to duplicate an elementwhose reference is PAGE1.FIELD1, the type is item.

newReference Referencestring

A reference that identifies where to put the newelement. The new element is created as either a childor sibling of this element. For example, to create anelement as a sibling of FIELD1, use PAGE1.FIELD1.

newType String The type of the newReference. Valid types are page,item, or option.

For example, if the newReference is PAGE2, thenewType is page; if the newReference is FIELD8, thenewType is item.

location String A description of where to put the new element inrelation to the newReference. Valid settings are:

append_childAdds the new element as the last child of thenewType.

after_siblingAdds the new element as a sibling of thenewType, placing it immediately after thatnode in the form structure.

before_siblingAdds the new element as a sibling of thenewType, placing it immediately before thatnode in the form structure.

newName String The new name for the duplicate element.

duplicate(reference, type, newReference, newType, location, newName)

XFDL Version 7.7 447

Page 454: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Returns

A duplicate element that contains the settings of the original element.

Example

In this example, the option custom:duplicate calls theduplicate function to make acopy of FIELD1 on PAGE1, which is identified as an item type. The call thenplaces the duplicate on PAGE2, which is identified as a page type, and places itimmediately after the last item on PAGE2 using append_child.

<button sid="duplicateFieldButton"><custom:duplicate xfdl:compute="toggle(activated, 'off', 'on') == '1' ? &#xA;

duplicate('Page1.Field1', 'item', 'Page2', 'page', &#xA;'append_child', new_Name) : ''"></custom:duplicate>

</button>

Usage detailsv If you duplicate an entire page, the elements in the new page automatically bind

to the XForms data model. However, this binding does not occur if you onlyduplicate individual items or options within the page. This behavior means thatduplicating individual items or options that are bound to the data model cancause your forms to behave erratically.

v When duplicating pages, you must also take into account the fact that newpages will contain the identical options and items as their originals. This isparticularly significant for the label option at the page level, which determinesthe text shown in the title bar of IBM Lotus Forms Viewer. When a page isduplicated, the label is also duplicated. Thus the new page node contains thesame label as the original, and the identity of the new page is not apparent tothe user viewing the form, who sees only the page label. To get around this, thelabel option of the page should be set to display the page sid. However, sincethe pages this effects do not exist when you write the code, you need some wayof dynamically referencing the page sid.You can use the function getReference to determine the page sid. getReferencewill return the reference to a page, item, or option node. In the followingexample, the value of the label option in PAGE1 will be hard-coded as“PAGE1”. If this page was duplicated, the new page might have a sid ofNew_PAGE1. The label for the page, and the title bar in the Viewer, however,would still display “PAGE1”

v Types of nodes– Original Node - The node to be duplicated– New Node - The node created by duplicating the original– Parent Node - The node the original node belongs to. For example, the parent

node of an item would be the page on which the item is located, and theparent node of a page would be the form

– Child Node - Any pages, items, options or array elements contained within theoriginal node. For example, an item node may contain several children,which would be the options describing that item. Each option, in turn, mayitself have several children the form of array elements.

– Sibling Node - Any node that is a child of the same parent as the originalnode’s parent. For example, if a page contains three items, INS_LABEL,NAME_FIELD and SAVE_BUTTON, then NAME_FIELD and SAVE_BUTTONare sibling nodes of INS_LABEL.

448 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 455: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

– Partial Reference - This term refers to an incomplete page, item or optionreference. For example, a partial reference to PAGE1.LABEL2.value would besimply value.

v Potential problems arise when nodes are duplicated. If a node were to beduplicated more than once, each copy would possess the same sid as the firstcopy. Using the function generateUniqueName in concert with the duplicatefunction eliminates this problem.

v When duplicating pages, you must also take into account that new pages willcontain the identical options and items as their originals. This is particularlysignificant for the label option at the page level, which determines the textshown in the title bar of IBM Lotus Forms Viewer. When a page is duplicated,the label is also duplicated. Thus the new page node contains the same label asthe original, and the identity of the new page is not apparent to the userviewing the form, who sees only the page label.To prevent this, the label option of the page should be set to display the pagesid. However, since the pages this duplication affects do not exist when youwrite the code, you need to dynamically reference the page sid using thegetReference function. getReference returns the reference to a page, item, oroption node. For example, if you hard-code the value of the label option inPAGE1 as PAGE1, then when this page is duplicated, the new page might havea sid of New_PAGE1. However, the label for the page and the title bar in theViewer will still display PAGE1.To get around

v Types of nodes:

Original nodeThe node to be duplicated.

New nodeThe node created by duplicating the original node.

Parent nodeThe node that the original node belongs to. For example, the parentnode of an item would be the page on which the item is located, and theparent node of a page would be the form.

Child nodeAny pages, items, options or array elements contained within theoriginal node. For example, an item node can contain several childelements, which would be the options describing that item. Each option,can also have several children, in the form of array elements.

Sibling NodeAny node that is a child of the same parent as the original node’sparent. For example, if a page contains three items, INS_LABEL,NAME_FIELD, and SAVE_BUTTON, then NAME_FIELD andSAVE_BUTTON are sibling nodes of INS_LABEL.

Partial ReferenceThis term refers to an incomplete page, item, or option reference. Forexample, a partial reference to PAGE1.LABEL2.value would be value.

Creating paging controls for duplicated pages and setting the tab order forduplicated items

If your form creates new pages, users will not be able to get to those pages unlesspaging controls are created as well. Because the pages do not exist when you arecreating the controls, you need some way of referencing duplicated pages.Likewise, it is difficult to set the tab order for items that do not exist yet.

XFDL Version 7.7 449

Page 456: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

To accomplish these tasks, you need to use the relative references provided byXFDL. These references let you refer to items or pages that either do not yet exist,or vary depending on how the form is configured. You can use these references tocompute the URL for a page that doesn’t exist yet. For example, the following codeshows how to use the pagenext option in a relative reference:

<button sid="next_BUTTON"><type>done</type><url compute="global.pagenext"></url><value>Next Page</value>

</button>

The available relative references are:

Relative option Refers to Reference syntax

pagefirst First page in the form description. global.pagefirst->item

pagelast Last page in the form description. global.pagelast->item

pageprevious Previous page in the formdescription. The first page points tothe last page in the form.

global.pageprevious->item

pagenext Next page in form description. Thelast page points to first page in theform.

global.pagenext->item

itemfirst First item in the page description. global.itemfirst->option

itemlast Last item in that page description. global.itemlast->option

itemprevious Previous item in the pagedescription. The first item points tolast item in page description.

global.itemprevious->option

itemnext Next item in the page description.The last item points to first item inpage description.

global.itemnext->option

450 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 457: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

forLoopCreates a loop that you can use to run a compute a number of times.

The forLoop function uses an option in your form, such as a custom option, as anindex that stores the current count of the loop. As the loop counts, it sets thisoption to the current count. For example, if the for loop counted from 1 to 3, itwould first set the option to 1, then to 2, then to 3. Each time the loop increments,it will perform a particular compute.

A form with a for loop begins counting that loop as soon as the form opens, unlessthe loop itself relies on a triggering event, such as a keypress event or atogglefunction.

Creating a Loop that Counts Once

You can create a loop that counts once by setting the initial count and the finalcount to be equal. For example, a loop that counts from 1 to 1 will count once.

Syntax

Table 225. forLoop parameters

Parameter Type Description

indexReference Referencestring

A reference to the option that stores the current countof the for loop. If this option does not exist, thefunction creates it with an empty value.

initialIndex Integer The starting value of the for loop. This value isinclusive, meaning that the for loop begins bycounting this value.

maxIndex Integer The ending value of the for loop. This value ininclusive, meaning that the for loop ends by countingthis value.

compute String The compute that you want to run each time the loopcounts.

Returns

1 on success or 0 (zero) on failure.

Example

In this example, the custom:toggle1 option contains a compute that is triggeredwhen a button in the form is clicked. After it is triggered, the compute does threethings:1. Resets the result field to a value of 1.2. Starts a for loop that runs from 1 to x, where x is a number typed in by the

user.3. Runs a compute each time the count changes. This compute multiplies the

value of the result field by the current count, then sets that value to the resultfield.

forLoop(indexReference, initialIndex, maxIndex, compute)

XFDL Version 7.7 451

Page 458: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<button sid="calculateButton"><value>Click to calculate</value><custom:toggle1 xfdl:compute="toggle( &#xA;

calculateButton.activated, 'off', 'on') == '1' ? &#xA;set('resultField.value', '1') + &#xA;forLoop('custom:counter', '1', numberField.value, &#xA;set('resultField.value', resultField.value * &#xA;custom:counter)) : ''"></custom:toggle1>

</button>

When run, this compute creates a loop that calculates the factorial of the number.On the first count, 1 * 1 is calculated and stored in the result field. On the secondcount, the value of the result field (1) * 2 is calculated and stored in the result field.On the third count, the value of the result field (2) * 3 is calculated, and stored inthe result field. These calculations continue until the final value has beencalculated and stored in the result field.

Usage detailsv You can create a loop that counts once by setting the initial count and the final

count to be equal. For example, a loop that counts from 1 to 1 will count once.

452 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 459: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

formatStringReturns a string formatted according to the rules set out in a referenced formatoption.

An error occurs if you specify a format option that is not valid.

Syntax

Table 226. formatString parameters

Parameter Type Description

reference Referencestring

A reference to the string to reformat. For example, toformat the value contained in FIELD3, the referencewould be FIELD3.value.

formatOptionReference String The format option used to apply to the reference. Forexample, to format the reference with the formatoptions defined in FIELD1, the string would beFIELD1.format.

Returns

The formatted string.

Example

In this example, the result of formatString in FIELD2 is ″$30,095.60″.<field sid="FIELD1">

<label>Field 1</label><format>

<datatype>dollar</datatype><presentation>

<showcurrency>on</showcurrency></presentation>

</format><value></value>

</field><field sid="FIELD2">

<label>Field 2</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="formatString(FIELD3.value, 'FIELD1.format')"></value>

</field><field sid="FIELD3">

<label>Field 3</label><value>30095.6</value>

</field>

In this example, formatString reformats a value as an integer and inserts it intocustom:value.

<field sid="Field4"><value>$1.00</value><format>

formatString(reference, formatOptionReference)

XFDL Version 7.7 453

Page 460: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<datatype>currency</datatype></format><custom:value xfdl:compute="formatString(value,

'custom:format')"></custom:value><custom:format>

<datatype>integer</datatype></custom:format>

</field>

454 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 461: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

generateUniqueNameCreates a unique name for an element. The generateUniqueName function isusually used with the duplicate function.

The unique name is constructed using a prefix and an integer that areconcatenated, as shown:

<prefix> +. <integer>

For example, in a form with a button that contains the code to copy a field usingthe duplicate function, you could include the generateUniqueName function. As aresult, when a user clicks this button, the newly created field would have a uniquename, such as newField_1″, which is composed of a designated prefix,″newField_″, and an automatically assigned integer (beginning at 1).

The function searches the form for any pages, items, or options with the samename as the specified prefix. If the name already exists within the scope of theparent element, then the function increments the integer until a unique name canbe generated.

The generateUniqueName function generates a name consisting of thenamePrefixand an integer. The function then searches the parent node specified by theduplicatefunction’stheReference and referenceStart for any page, item, or optionidentifiers with the same name. If the name already exists in the parent node thenthe function increments the integer until a unique name can be generated.

When generating unique names using this function, you also need to use the setfunction.

Syntax

Table 227. duplicate parameters

Parameter Type Description

reference Referencestring

A reference to the parent element of the element forwhich you want to generate a unique name. Forexample, if you want to generate a unique name for anitem on PAGE1, the reference would be PAGE1. Toindicate that the parent element is the current form,leave this parameter blank. For example, if youwanted to generate a unique name for a new page.

type String The type of node identified in the reference. Forexample, if the reference is PAGE1, the type would bepage. Valid types are form,page, item, option, or array.

prefix String The prefix for the unique name to be generated. Thisprefix can be any string. For example, if you choose″newField_″ as the prefix, the first name generated bythe function would be ″newField_1″, the second wouldbe ″newField_2″, and so on.

Returns

A string that is composed of characters, such asnamePrefix, and an integer.

generateUniqueName(reference, type, prefix)

XFDL Version 7.7 455

Page 462: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Example

In this example, the generateUniqueName function generates a unique name andreturns the result newField_1.

<button sid="duplicateFieldButton"><value>duplicate Field1</value><custom:name></custom:name><custom:generate xfdl:compute=

"toggle(activated, 'off', 'on') == '1' ? &#xA;set('custom:name', generateUniqueName('PAGE1', 'page', &#xA;

'newField_')) : ''"></custom:generate></button>

Notesv generateUniqueName generates a name consisting of the namePrefix and an

integer. The function then searches the parent node specified by theReferenceand referenceStart for any page, item, or option identifiers with the same name.If the name already exists in the parent node then the function increments theinteger until a unique name can be generated.

456 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 463: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getGets the value of either an XFDL option or an element in the XForms model.

Syntax

Table 228. get parameters

Parameter Type Description

reference Referencestring

A reference to the string to get.

When getting a string from an XFDL element, useXFDL referencing. For example, to retrieve the valueof ″FIELD1″, the reference would be FIELD1.value.

When getting a string from an element in the XFormsdata model, use XPath referencing. For example, toretrieve the value of the ZIP element, the referencemight be address/zip..

referenceType String Optional. Identifies the type of reference used in thereference parameter. To indicate a reference to anoption node, use option. To indicate a reference to anode below the option level, use array. To indicate areference to an XForms element, use an empty string(″″).

scheme String Optional. The referencing scheme used. Use xfdl torefer to XFDL elements in the form, or xforms to referto the XForms data model.

If you need to refer to a particular data model, youmust use a MIME type format instead, as shown:

application/xforms; model=ID

Set this value to match the ID of the model you wantto work with. If you do not specify a model, the firstmodel in the form is used.

If the scheme is not provided, it defaults to xfdl. Ifyou provide a scheme, you must also provide thereferenceType parameter.

Returns

The value of the form option reference or an empty string if an error occurs.

Examples

In this example, get retrieves the value of ″Field1″, which is ″gold″.<field sid="Field1">

<label>Field 1</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format>

get(reference, referenceType, scheme)

XFDL Version 7.7 457

Page 464: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<value>gold</value></field><field sid="Field2">

<label>Test get()</label><format>

<datatype>string</datatype></format><value compute="get('Field1.value')"></value>

</field>

The following sample demonstrates how to use the get function to retrieve a value(“Tatyana Kartoff”) from the XForms data model element “name”:

<xforms:instance id = 'loan'><loan>

<Borrower><Name>Tatyana Kartoff</Name><Address>

<street></street><city></city><state></state><country></country>

</Address>...other data model elements...</Borrower>

</loan></xforms:instance>

<field sid="Field2"><label>Test get()</label><format>

<datatype>string</datatype></format><value compute="get('instance(&quot;loan&quot;)/Borrower/Name', &#xA;

'','xforms')"></value></field>

Usage Detailsv The get function does not support XPath referencing for the entire form. Use

XPath references only when getting data from the XForms data model.v If you use the instance function to access a particular data instance, you must

use the escape sequence for the quotations marks (&quot;) around the parameter.For example:

get('instance(&quot;loan&quot;)/Borrower/Name', '','xforms')

v If you intend to use the XForms scheme, you must surround the parameter withsingle quotation marks. For example:

'xforms'

v If you attempt to get the value of an element in the XForms data model, andthat element is a parent (that is, it contains child elements), then the value of thefirst child text node is returned.

v If you reference an item that changes, the change does not automatically triggera re-evaluation of the function.

v The get and set functions are the only XFDL functions you should use to modifythe XForms data model.

458 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 465: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getAttrReturns the value of an attribute on a form element.

Syntax

Table 229. getAtt parameters

Parameter Type Description

reference Referencestring

A reference to the element that has the attribute. Forexample, to get an attribute from a custom dataelement in Field1, you might use:

Page1.Field1.custom:data

All namespace prefixes are resolved relative to thisnode.

type String The type of reference used. This value is one of page,item, option, or array.

attrName String The name of the attribute, including the appropriatenamespace. For example:

prefix:attribute

Use null for the empty namespace, or nothing for theXFDL namespace. All other namespace prefixes areresolved relative to the reference node supplied.

scheme String Optional. The referencing scheme used. Valid optionsare XFDL and xforms. The default value is XFDL .

Returns

The value of the attribute or an empty string if an error occurs.

Example

In this example, getAttr retrieves the value of the id attribute from the<custom:data> element.

<field sid="nameField"><value>John B.</value><custom:data id="12"></custom:data>

</field><field sid="idField">

<value compute="getAttr('nameField.custom:data', 'option','custom:id')"/></value>

</field>

getAttr(reference, type, attrName, scheme)>>>>>>> 1.5

XFDL Version 7.7 459

Page 466: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getDataByPathRetrieves specific information from a signature in the form, such as the signer’sname or the signer’s e-mail address.

Syntax

Table 230. getDataByPath parameters

Parameter Type Description

type String The type of object you are working with. The type isalways signature.

ref Referencestring

A reference to the signature item in the form.

path String The path to the data you are retrieving from thesignature.

Returns

A string containing the requested data.

About data paths

Data paths describe the location of information within a signature, just like filepaths describe the location of files on a disk. You describe the path with a series ofcolon separated tags. Each tag represents either a piece of data, or an object thatcontains further pieces of data (just like directories can contain files andsubdirectories).

For example, to retrieve the version of a signature, you would use the followingdata path:

Demographics

However, to retrieve the signer’s common name, you first need to locate thesigning certificate, then the subject, then finally the common name within thesubject, as follows:

SigningCert: Subject: CN

Some tags can contain more than one piece of information. For example, theissuer’s organizational unit might contain a number of entries. You can eitherretrieve all of the entries as a comma-separated list, or you can specify a specificentry by using a zero-indexed element number.

For example, the following path would retrieve a comma-separated list:SigningCert: Issuer: OU

Adding an element number of 0 would retrieve the first organizational unit in thelist, as shown:

SigningCert: Issuer: OU: 0

getDataByPath(type, ref, path)

460 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 467: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Signature tags

The following list describes the tags available in a signature object. Note thatClickwrap and Hash Message Authentication Code (HMAC) Clickwrap signatureshave additional tags, as detailed in “Clickwrap signature tags” and “HMACClickwrap Tags” on page 463 below.

EngineThe security engine used to create the signature.

SigningCertThe certificate used to create the signature. This object contains furtherinformation, as detailed in “Certificate tags” on page 462. Note that thisobject does not exist for Clickwrap or HMAC Clickwrap signatures.

HashAlgThe hash algorithm used to create the signature.

CreateDateThe date on which the signature was created.

DemographicsA string describing the signature.

Clickwrap signature tags

The following list describes additional tags available in both Clickwrap andHMAC Clickwrap signatures. Note that HMAC Clickwrap signatures have furthertags, as detailed in “HMAC Clickwrap Tags” on page 463 below.

TitleTextThe text for the Windows® title bar of the signature dialog box.

MainPromptThe text for the title portion of the signature dialog box.

MainTextThe text for the text portion of the signature dialog box.

Question1TextThe first question in the signature dialog box.

Answer1TextThe signer’s answer.

Question2TextThe second question in the signature dialog box.

Answer2TextThe signer’s answer.

Question3TextThe third question in the signature dialog box.

Answer3TextThe signer’s answer.

Question4TextThe fourth question in the signature dialog box.

Answer4TextThe signer’s answer.

XFDL Version 7.7 461

Page 468: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Question5TextThe fifth question in the signature dialog box.

Answer5TextThe signer’s answer.

EchoPromptText that the signer must echo to create a signature.

EchoTextThe signer’s response to the echo text.

ButtonPromptThe text that provides instructions for the Clickwrap signature buttons.

AcceptTextThe text for the accept signature button.

RejectTextThe text for the reject signature button.

Certificate tags

The following list describes the tags available in a certificate object. Note thatClickwrap and HMAC Clickwrap signatures do not contain these tags.

SubjectThe subject’s distinguished name. This object contains further information,as detailed in Distinguished Name Tags.

Issuer The issuer’s distinguished name. This object contains further information,as detailed in Distinguished Name Tags.

IssuerCertThe issuer’s certificate. This object contains the complete list of certificatetags.

EngineThe security engine that generated the certificate. This object containsfurther information, as detailed in Security Engine Tags.

VersionThe certificate version.

BeginDateThe date on which the certificate became valid.

EndDateThe date on which the certificate expires.

Serial The certificate’s serial number.

signatureAlgThe signature algorithm used to sign the certificate.

PublicKeyThe certificate’s public key.

FriendlyNameThe certificate’s friendly name.

462 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 469: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Distinguished name tags

The following list describes the tags available in a distinguished name object. Notethat Clickwrap and HMAC Clickwrap signatures do not contain these tags.

CN The common name.

E The e-mail address.

T The title.

O The organization.

OU The organizational unit.

C The country.

L The locality.

ST The state.

All The entire distinguished name.

HMAC Clickwrap Tags

The following list describes the tags available in HMAC Clickwrap signature. Notethat these tags are in addition to both the regular “Signature tags” on page 461 andthe “Clickwrap signature tags” on page 461.

HMACsignerA string indicating which answers store the signer’s ID.

HMACSecretA string indicating which answers store the signer’s secret.

NotarizationThe notarizing signatures. These signatures are one or more signatureobjects that contain further information, as detailed in “Signature tags” onpage 461. There can be any number of notarizing signatures. Use anelement number to retrieve a specific signature. For example, to get thefirst notarizing signature use:

Notarization: 0

If no element number is provided, the data is retrieved from the first validnotarizing signature found. If no valid notarizing signatures are found, thefunction returns an empty string (″″).

Security engine tags

The following list describes the tags available in the security engine object:

Name The name of the security engine.

Help The help text for the security engine.

HashAlgA hash algorithm supported by the security engine.

Example

The following example shows a label that displays the signer’s e-mail address afterthe form is signed. In this case, the label’s value is set using an if/then test todetermine whether the signer option on the signature button is set to anything

XFDL Version 7.7 463

Page 470: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

other than an empty string. If it is, then the form has been signed, andgetDataByPath is called to get the e-mail address of the signer.

<label sid="e-mailLabel"><value compute="Page1.sigButton.signer != '' ?

getDataByPath('signature', 'Page1.usersignature','SigningCert: Subject: E') : ''></value>

<label>

464 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 471: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getGroupedItemReturns a reference to the first item in a group. getGroupedItem can also return areference to the first item in a group that has a particular characteristic, such as aspecific option or setting.

getGroupedItem returns a reference to any of the following:v The first item in a given group.v The first item in a group that has a particular option. For example, the first item

with a bgcolor .v The first item in a group that has a particular option setting. For example, the

first item with a value of on.

Syntax

Table 231. getGroupedItem parameters

Parameter Type Description

group String The name of the group that you want to get an itemfrom. This name can include a page reference, such asPAGE1.myGroup.

option String Optional. When supplied, the function only searchesfor items that have this option.

literal String Optional. When supplied, the function only searchesfor items that have the specified option set to thisvalue. Use this parameter with theoption parameter. Ifthe empty function is used as this parameter,getGroupedItem searches for an item that has no valueset for the specified option.

groupContext String Optional. The starting point to use to locate the groupif the group name is not fully qualified. For example,if the group was on the first page, you would usePAGE1.

groupContextType String Optional. The level of the group context parameter,such as page, item or option. Currently, only page isvalid.

referenceType String Optional. Sets the scope of the reference that isreturned. The reference begins at the level below this.For example, to get a reference that begins at the pagelevel, set this parameter to page Valid settings are formand page. The default reference type is form.

scheme String Optional. The referencing scheme used. The defaultscheme is XFDL.

Returns

A reference to the first item matching the search criteria or an empty string if anerror occurs.

getGroupedItem(group, option, literal, groupContext, groupContextType,[itemScopeType], scheme)

XFDL Version 7.7 465

Page 472: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage details

getGroupedItem supports the empty function as its third parameter. This supportallows getGroupedItem to return items that contain empty values in the specifiedoption.

Example

In this example, getGroupedItem gets the scope identifier (sid) of the radio buttonthat is turned on.

<field sid="Field1"><label>The SID of the selected radio button is:</label><value compute="getGroupedItem('Page1.radioGroup', 'value','on')"></value>

</field>

466 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 473: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getInstanceRefReturns a reference to a particular instance in the XML Data Model. You mustknow the ID of the instance.

Syntax

Table 232. getInstanceRef parameters

Parameter Type Description

instanceID String The ID of the data instance.

scheme String Optional. The referencing scheme used. Valid optionsare XFDL and xforms. The default value is XFDL.

Returns

A string that contains a fully qualified reference to the data instance or an emptystring if an error occurs.

Example

The following example uses to getInstanceRef to set the value of a label. The labelwill then display a reference to the personnelInfo instance.

<field sid="instanceReference"><value compute="getInstanceRef('personnelInfo')"></value>

</field>

getInstanceRef(instanceID, [scheme])

XFDL Version 7.7 467

Page 474: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getPositionReturns the position index for an element within its parent.

For example, if a page contained two fields, and you called this function on thesecond field, it would return a value of ″1″, indicating that it was the second child.Note that indexing is zero-based.

Syntax

Table 233. getPosition parameters

Parameter Type Description

reference Referencestring

A reference to the element whose position you wantto determine.

type String The type of reference used. This is one of page, item,option, or array.

scheme String Optional. The referencing scheme used. Valid optionsare XFDL and xforms. The default value is XFDL.

Returns

An integer representing the position of the element within its parent or an emptystring if an error occurs.

Example

This example uses getPosition to determine the position index of thelastNameField on the first page. It then adds one to the index to change it fromzero-based indexing to one-based indexing, and concatenates that value into astring that reads: ″The lastNameField is element #2 on page one.″

<page sid="Page1"><field sid="firstNameField"></field><field sid="lastNameField"></field>

</page><page sid="Page2">

<field sid="positionField"><value compute="'The lastNameField is element #' +. &#xA;

(getPosition('Page1.lastNameField', 'item') + 1) &#xA;+. ' on page one.'"></value>

</field></page>

getPosition(reference, type, scheme)>>>>>>> 1.4

468 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 475: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getPrefReturns the value of any setting in the Viewer Preferences form. For example, youcould use this function to retrieve the user’s e-mail address from the Preferencesform.

Syntax

Table 234. getPref parameters

Parameter Type Description

prefName String The name of the Preferences setting to get.

Returns

A string containing the value of the Preferences setting or an empty string if anerror occurs.

Usage details

The following table shows the names for each setting in the Preferences form.Unless otherwise noted, each setting will have a value appropriate to the valueoption of the item type listed. For example, a field can be set to any string value, acheck box can be set to on or off, and so on.

Table 235. names of preference settings

Preferences Setting Type Name

Basic Network Access Popup menu networkAccess

Try to locate browserautomatically

Check box locateBrowser

Path to Browser Field overrideDefaultPathToBrowser

Use Default SimpleMAPI Client

Check box useMAPI

SMTP Server Field mailHost

Return Address Field returnEmailAddress

Use Enhanced FocusIndicator

Check box focusIndicator

Use Operating SystemColors

Check box useSystemColors

Input Do Predictive InputChecking—

Check box predictiveChecking

I Prefer to Enter Dates

Valid settings are:DayMonthYear,MonthDayYear, andYearMonthDay.

Radio buttons defaultDateFormat

Stop Tab From InvalidInput Items

Check box forbidTaboutOnError

getPref(prefName)

XFDL Version 7.7 469

Page 476: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 235. names of preference settings (continued)

Preferences Setting Type Name

Stop Tab From EmptyMandatory Items

Check box forbidTaboutOnMandatory

Enable Smartfill Check box smartfillEnabled

Printing Print Radio Buttons asCheck Boxes

Check box printRadiosAsChecks

Print Radio ButtonsWithout Values

Check box printRadiosWithoutValues

Print Scroll Bars onFields

Check box printscroll barsOnFields

Print single Line Fieldsas Lines

Check box printsingleLineFieldsAsLines

Print Border AroundForm Edge

Check box printFormBorder

Page Layout Defaults

Valid settings are:fitToPage, shrinkToPage,tileOneDirection, andtileTwoDirections.

Radio buttons printedPageLayout

Print each page asseparate print job

Check box printPageSeparately

Print black and white(excluding images)

Check box printBlackAndWhite

Advanced Show Boundary on AllForm Items

Check box displayBoundingBoxes

Use ’X’ Style CheckBoxes Valid settings are:X and check.

Check box checkBoxStyle

Scroll Fields on Zoom Check box scrollFieldsOnZoom

Digital CertificateIdentity Filter

Field certIdentifyFilter

Path to Netscape Profile Field overrideDefaultPathToNetscapeProfile

Check CertificateRevocation List (CRL)Distribution Points

Check box checkCRLDistributionPoints

Example

In this example, getPref is used to automatically populate a field with the user’se-mail address:

<field sid="emailAddress"><label>E-mail address:</label><value compute="getPref('returnEmailAddress')"></value>

</field>

470 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 477: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

getReferenceReturns a reference for the element that contains the call. The function works as a″Where am I?″ check for a page, item, or option. It is always called from within theelement for which the reference is needed, but the returned reference can be forthat element or any of its parents.

For example, getReference could be called from within a page’s label , and returna reference for that option (for example, PAGE1.global.label), its parent item (forexample, PAGE1.global), or the page it is on (for example, PAGE1).

This function is especially useful when duplicating pages, because new pagescontain identical options and items as their originals.

Syntax

Table 236. getReference parameters

Parameter Type Description

element String The element that you want to identify. Possible valuesinclude the page scope identifier (sid), the item oroption type, and the name or value of the item oroption. For instance, to return the reference for a labeloption containing the call, the element parameterwould be ″label″.

type String The element type. This is one of page, item, option, orarray.

level String The level in the reference for the function to return. Ifthe function is called from an option, but the level isidentified as item, the reference returned would be″page.item″.

scheme String Optional. The referencing scheme used. The defaultsetting is XFDL.

Returns

A reference to the element (page, item, or option) from which the function wascalled, or an empty string if an error occurs.

Example

In this example, getReference returns a reference to the page, which is PAGE1.<page sid="PAGE1">

<global sid="global"><label compute="getReference('label', 'option', 'page')"

></label></global>

In this example, getReference returns a reference to the label option, which in thiscase is PAGE1.global.label.

getReference(element, type, level, scheme)

XFDL Version 7.7 471

Page 478: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<page sid="PAGE1"><global sid="global">

<label compute="getReference('label', 'option', 'option')"></label>

</global>

472 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 479: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

isValidFormatReturns the Boolean result of whether a string is valid according to the setting ofthe format option referred to in formatOptionReference. Note that you cannot usethis function to check the validity of strings in items with XForms.

An error occurs if a nonexistent format is specified.

Syntax

Table 237. isvalidformat parameters

Parameter Type Description

string String The string to be checked against the format. Forexample, to check 23.2 against a specific format, thestring would be “23.2”.

formatOptionReference String The option reference of the format, including the pagescope identifier (sid) if necessary, to check the stringagainst. For example, to check 23.2 against a formatspecified in Field1, the formatOptionReference wouldbe “Field1.format”.

Returns

″1″ if the string follows the format, ″0″ if not, or an empty string if an error occurs.

Example

In this example, the result of isValidFormat is ″0″ because the string to checkcontains a non-integer number representation and the specified format to check isof type integer.

<field sid="Field1"><label>Field 1</label><format>

<datatype>integer</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value>45</value>

</field><field sid="Field2">

<label>Test isValidFormat()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="isValidFormat('23.2', 'Field1.format')"

></value></field>

isValidFormat(string, formatOptionReference)

XFDL Version 7.7 473

Page 480: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

setSets the value of an XFDL form option or an element in the XForms model.

Syntax

Table 238. set parameters

Parameter Type Description

reference Referencestring

A reference to the option or data element to set.

If setting an XFDL option, use XFDL referencing. Forexample, to set the value of “Field1”, the referencewould be ″Field1.value″. Note that the reference mustbe contained in quotes.

When setting a string in an element in the XFormsdata model, use XPath referencing. For example, to setthe value of the ZIP element, the reference might beaddress/zip.

value String The reference’s new value. For example, to set thereference’s new value to silver, the value would besilver; to set the value of a check box to off, the valuewould be off.

referenceType String Optional. Identifies the type of reference used in thereference parameter. To indicate a reference to anoption node, use option. To indicate a reference to anode below the option level, use array. To indicate areference to the XForms data model, use ″″ (emptystring).

scheme String Optional. The referencing scheme used. Valid optionsare XFDL and xforms. The default value is XFDL .

If you need to refer to a particular data model, youmust use a MIME type format instead, as shown:

application/xforms; model=ID

Set this to the ID of the model you want to workwith. If you do not specify a model, the first model inthe form is used.Note: If you provide a scheme, you must also providethe referenceType parameter.

Returns

″1″ if the operation completed successfully, ″0″ if an error occurred. An error occursif the specified form option could not be set to the specified value.

Examples

In this example, the result of set is ″1″ and the value of Field1 is set to ″silver″.<field sid="Field1">

<label>Field 1</label><value>gold</value>

</field>

set(reference, value, referenceType, scheme)

474 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 481: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<field sid="Field2"><label>Test set()</label><value compute="set('Field1.value', 'silver')"></value>

</field>

In this example, if a form user selects the ″CHECK1″ check box (thereby turning itsvalue on), the set function sets the value of ″CHECK2″ to off.

<check sid="CHECK1"><custom:set xfdl:compute="value == 'on' ? &#xA;

set('CHECK2.value', 'off') : ''"></custom:set><value>off</value>

</check><check sid="CHECK2">

<custom:set xfdl:compute="value == 'on' ? &#xA;set('CHECK1.value', 'off') : ''"></custom:set>

<value>off</value></check>

The following sample demonstrates how to use the set function to set a value(“Tatyana Kartoff”) in the XForms data model element “name”:

<loan><Borrower>

<Name></Name><Address>

<street></street><city></city><state></state><country></country>

</Address>...other data model elements...

</Borrower></loan>

<field sid="Field2"><label>Test set()</label><format>

<datatype>string</datatype></format><value compute="set('instance(&quot;loan&quot;)/Borrower/Name', &#xA;

"Tatyana Kartoff",'','xforms')"></value>

</field>

Usage detailsv The set function does not support XPath referencing for the entire form. Use

XPath references only when setting data in the XForms model.v If the option you are setting does not exist, the set function creates it only when

the containing page and item already exist. The set function does not createelements in the XForms model.

v If you set the value of an XFDL option that has a compute, the compute isdestroyed.

v You can use the set function to create ″grouped″ check boxes. For example, if aform user selects one check box (thereby turning its value on), the set functioncan turn the value of another check box off.

v When you use a set function to turn a radio button on (or off), you must alsouse a set function to turn all of the other radio buttons in the same group off (oron).

v When a compute within the set function causes a change to the form, the formchecks for other computes referenced by the set function and evaluates themimmediately.

XFDL Version 7.7 475

Page 482: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v If you use the instance function to access a particular data instance, you mustuse the escape sequence for the quotations marks (&quot;) that appear aroundthe parameter. For example:

set('instance(&quot;loan&quot;)/Borrower/Name', 'Bill Smith','','xforms')

v If you intend to use the XForms scheme, you must surround the parameter withsingle quotation marks. For example:

'xforms'

v The set function does not work on values that are set to be read-only in theXForms model; however, it does work on values that are set to be read-onlythrough the readonly option.

v If you attempt to set the value of an element in the XForms data model, and thatelement is a parent (that is, it contains child elements), then the value of the firstchild text node is set.

v For security reasons, the set function is not allowed to change the value of anoption or suboption in an XForms-associated item (that is, an XFDL item thatcontains an XForms control or an XFDL item that has been created by anxforms:group, xforms:switch, xforms:repeat, xforms:select1, or xforms:select.

v The get and set functions are the only XFDL functions that you should use tomodify the XForms data model.

476 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 483: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

setAttrSets the value of an attribute on a form element.

Syntax

Table 239. setAtt parameters

Parameter Type Description

reference Referencestring

A reference to the element that has the attribute. Forexample, to set an attribute from a custom dataelement in Field1, you might use:

Page1.Field1.custom:data

All namespace prefixes are resolved relative to thisnode.

type String The type of reference used. This value is one of page,item, option, or array.

attrName String The name of the attribute, including the appropriatenamespace. For example:

prefix:attribute

Use null for the empty namespace, or nothing for theXFDL namespace. All other namespace prefixes areresolved relative to the reference node supplied.

value String The value to assign to the attribute.

scheme String Optional. The referencing scheme used. Valid optionsare XFDL and xforms. The default value is XFDL .

Returns

″1″ if the operation completed successfully or ″0″ if an error occurred.

Example

In this example, setAttr sets the value of the id attribute in the <custom:data>element to ″12″.

<field sid="nameField"><value>John B.</value><custom:data id=""></custom:data>

</field><field sid="idField">

<value compute="setAttr('nameField.custom:data', 'option','id', '12')"></value>

</field>

Usage details1. Do not use the setAttr function to change the value of a single node.2. You can use setAttr to change the value of a nodeset binding if the items you

are setting are contained inside an xforms:repeat item. This allows you to copya table to a new page and reset the binding of that table (for cases in whichtables needs to wrap to a new page). You cannot set any nodeset bindings thatare not contained inside a table.

setAttr(reference, type, attrName, value, scheme)

XFDL Version 7.7 477

Page 484: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

3. Do not use setAttr to modify the action attribute of a submission.

478 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 485: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

toggleMonitors a specific form option and detects any changes to the value of thatoption. This function can detect any change in an option, or can watch for specificchanges. For example, you can create a toggle that detects when an option changesfrom on to off, or from Fred to Jim.

An error occurs if the specified form option does not exist.

Syntax

Table 240. toggle parameters

Parameter Type Description

reference Referencestring

A reference to the option to monitor. For example, tomonitor the value of a check box called″noChoiceAllowed″, the reference would benoChoiceAllowed.value.

start String Optional. The starting condition for toggle. Forexample, set this to off to monitor when a check boxis checked. Check boxes toggle from off to on whenthey are selected.

end String Optional. The ending condition for toggle. Forexample, set this to on to monitor when a check boxis cleared. Check boxes toggle from on to off whenthey are cleared.

Returns

″1″ if the specified change occurs in the specified option, or ″0″ if another changeoccurs.

Example

In this example, toggle monitors a specific option for any change. Every time thevalue of ″nameField″ changes, toggle returns ″1″, and then a new time is enteredinto ″timeStampField″, using the now function.

<field sid="timeStampField"><value compute="toggle(nameField.value) == '1' ? now() : ''"

></value><label>Time Stamp</label><readonly>on</readonly>

</field><field sid="nameField">

<label>Name</label><value></value>

</field>

In this example, toggle monitors a check box to determine if the check box ischecked. If the value of the check box goes from off to on, the value of the labelchanges to ″The box has been checked.″

<label sid="checkStatusLabel"><value compute="toggle(check1.value, 'off', 'on') == '1' ? &#xA;

'The box has been checked.' : &#xA;

toggle(reference, start, end)

XFDL Version 7.7 479

Page 486: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

'The box has not been checked.'"></value></label><check sid="check1">

<value>off</value></check>

480 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 487: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.addressbookSets the value of one or more form options based on user selection of e-mailaddresses. The function opens the user’s e-mail client address book and allowsthem to select e-mail addresses.

This function uses extended Messaging Application Programming Interface (MAPI)when available, but otherwise uses simple MAPI.

Note: If Microsoft Exchange users have not configured their Simple Mail TransferProtocol (SMTP) addresses, the Microsoft Exchange common name will bereturned.

Syntax

Table 241. viewer.addressbook parameters

Parameter Type Description

to_field String References a form option that is set when a userselects the To information.

cc_field String References a form option that is set when a the userselects the cc information. The to_field parametermust be present for this parameter to receive input.

bcc_field String References a form option that is set when a the userselects the Bcc information. The to_field and cc_fieldparameters must be present for this parameter toreceive input.

Returns

Returns ″1″ on success and an empty string on failure. Errors are logged and anerror form launches on failure.

Example

In the following example, when the user clicks the form’s Address Book button, anaddress book dialog box displays, allowing the user to select e-mail addressesusing the To, Cc, or Bcc fields:

<button sid="ADDRESS_BOOK"><type>select</type><value>Address Book</value><custom:opt xfdl:compute="(toggle(activated, 'off', &#xA;

'on') == '1' ? viewer.addressbook('TO_FIELD.value', &#xA;'CC_FIELD.value', 'BCC_FIELD.value') : '')"></custom:opt>

<visible compute="(isAvailable('function', &#xA;'viewer.addressbook') > '0' ? 'on' : 'off')">on</visible>

<itemlocation><x>337</x><y>47</y>

</itemlocation></button>

viewer.addressBook(to_field, cc_field, bcc_field)

XFDL Version 7.7 481

Page 488: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.envReturns a string that contains the details of the environment in which IBM LotusForms Viewer is operating. Determines whether the Viewer is stand-alone orembedded in a browser, embedded in Eclipse, or embedded in an HTML page. TheURL of the submit button changes depending upon the Viewer environment.

Syntax

Returns

A string containing the location of the Viewer, either as stand-alone or insideanother object. The strings it can include are:

standaloneThe Viewer is operating as a standalone Viewer.

eclipseThe Viewer is operating inside Eclipse.

browserThe Viewer is operating inside a browser.

html-objectThe Viewer is operating inside an HTML page.

Example

The following example determines which environment in which the Viewer isoperating. When the Viewer is operating in standalone mode, the form issubmitted to server1. If it is operating inside a browser, it is submitted to server2and so on. Two custom options are used, one containing a compute that calculatesthe Viewer environment, the other specifying which URL to use for eachenvironment.

<button sid = "Submit"><value>Submit</value><type>submit</type><custom:enviro xfdl:compute="toggle(global.global.activated, &#xA;

'off', 'on') == '1' ? viewer.env() : ''"></custom:enviro><custom:envString xfdl:compute="custom:enviro == 'standalone'&#xA;

? ('http://server1/cgi-bin/submit') &#xA;: custom:enviro == 'browser' &#xA;? ('http://server2/cgi-bin/submit') &#xA;: custom:enviro == 'html-object' &#xA;? ('http://server3/cgi-bin/submit') &#xA;: custom:enviro == 'eclipse' &#xA;? ('http://server4/cgi-bin/submit') : ''"></custom:envString>

<url compute="custom:envString"></url></button>

viewer.env()

482 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 489: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.fileOpenDisplays an Open File dialog box and allows the user to select a file. Returns thefile name and path of the selected file, but does not actually open the file. Thisfunction allows users to select a specific file that is accessed at another time.

For example, the IBM Lotus Forms Viewer uses this function in the preferencesform to allow the user to set the location of the Web browser.

Syntax

Table 242. viewer.fileOpen parameters

Parameter Type Description

startdir Directorypath

Default directory where the file browser searches forfiles.

extfilters String A list of one or more strings, which specify the fileextensions that can be selected in the Open File dialogbox. The list must be comma delimited, and thestrings should follow this format: <text description>*.<ext> . For example, “HTML document *.html”would represent HTML files. The exact text of thestring displays in the Open File dialog box.Note: A filter of *.* represents any file name or type.A list of file extensions, separated by commas,specifies the types of files to display in the dialog box.

Returns

A string containing the path of the file to be opened.

Example

The following example sets the URL option in a link button. When the button isselected, an Open File dialog box displays, and the user can select a specific file.The path and file name are returned and used as the URL option for the linkbutton. Because it is a link button, the selected file is opened by the browser.

Note: The parameters in this example specify that the Open File dialog box willdefault to the My Documents folder, and that it will display both XFDL (.xfd) andHTML (.htm) files.

<button sid="fileOpen"><itemlocation>

<x>0</x><y>209</y>

</itemlocation><type>link</type><value>Viewer.fileOpen</value><url compute="toggle(activated, 'off' , 'on') == '1' ? viewer.fileOpen

('C:\\My Documents' 'XFDL Document *.xfdl, HTML Documents*.html') : ''">

</url></button>

viewer.fileOpen(startdir, [extfilter])

XFDL Version 7.7 483

Page 490: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.fileSaveDisplays a Save File dialog box and allows the user to select or type a file name.The path and file name selected are returned, but the file is not actually saved.

This function is intended for use with other applications, which can perform theactual save action based on the function return value. For example, a configurationform (like the IBM Lotus Forms Viewer’s preferences form) might allow the user toset a default location to which all files should be saved. The application wouldthen check the preferences form, and save all files in the specified location.

Syntax

Table 243. viewer.fileSave parameters

Parameter Type Description

startdir Directorypath

Default directory where files are saved.

default_text Fileextension

Default file extension used when files are saved.

extfilters String A list of one or more strings, which specify the fileextensions that can be selected in the Save File dialogbox. The list must be comma delimited, and thestrings should follow this format: <text description>*.<ext> . For example, “HTML document *.html”would represent HTML files. The exact text of thestring displays in the Save File dialog box.

Note that a filter of *.* represents any file type.

Returns

A string containing the directory path of the file to be saved.

Example

The following example sets the value of a label. When the button on the form isclicked, a Save File dialog opens, and the user selects a folder and file name. ThefileSave function returns the path to this location, and the set function is used toassign the path to the value option of the label.

Note: The parameters in this example specify that the Save File dialog box willdefault to the My Documents folder, that the file name will default to a “.xfd”extension. The filters specify that XFDL (.xfd), HTML documents (.html and .htm),and Word documents (.doc) are acceptable file extensions.

<label sid="pathofsavedfile"><size>

<width>50</width><height>1</height>

</size><value><custom:saveasdialog xfdl:compute="toggle(activated, 'off',

'on') == '1' ? set('pathofsavedfile.value', viewer.fileSave('C:\My Documents', 'frm', 'Forms *.xfd, HTML Forms .htm,

viewer.fileSave(startdir, default_text,extfilter_1, extfilter_2,... extfilter_n)

484 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 491: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

*.html, *.doc')) : ''"&gt;></custom:saveasdialog&gt;></value>

<itemlocation><x>118</x><y>328</y><height>80</height><width>387</width>

</itemlocation></label>

<button sid="savebutton"><type>select</type><value>Viewer.fileSave</value><custom:saveasdialog xfdl:compute="toggle(activated, 'off', 'on')

== '1' ? set('pathofsavedfile.value', viewer.fileSave('C:\My Documents','frm', 'Forms *.xfd, HTML Forms .htm, *.html, *.doc')) : ''">

</custom:saveasdialog><itemlocation>

<x>0</x></itemlocation>

</button>

XFDL Version 7.7 485

Page 492: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getDefaultFilenameReturns the default file name of a form. The IBM Lotus Forms Viewer maintains adefault file name for all open forms, unless they are temporary files. A form isconsidered temporary if it is passed to the Viewer by the Web browser in responseto a Web transaction. Temporary files have no default filenames.

Syntax

Returns

Returns a string containing the default file name of the form. This string does notinclude any path information.

Usage details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the getDefaultFilename function. If you wantgetDefaultFilename to run when the form opens, toggle the function off of thevalue of the global.global.activated option. This option switches to on when theform is opened.

Example

The following example creates a label in the form that displays the default filename when the user clicks the getFilename button.

<label sid = "filename_LABEL"><value compute="toggle(getFilenameButton.activated, &#xA;

'off', 'on') == '1' ? viewer.getDefaultFilename() :value"></value>

</label>

viewer.getDefaultFilename()

486 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 493: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getHeightMeasures the height of an item in either pixels or characters.

Syntax

Table 244. viewer.getHeight parameters

Parameter Type Description

units String Determines whether height is measured in chars orpixels.

item Referencestring

Optional. References the scope identifier (sid) of theitem you want to measure. If no item is specified, thecurrent item is measured.

Returns

Returns a string containing the height of the current or specified item in eitherpixels or characters.

Usage details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the getHeight function. If you want getHeight to run when theform opens, toggle the function off of the value of the global.global.activatedoption. This option switches to on when the form is opened.

Example

In the following example, when a user clicks BUTTON1, getHeight calculates theheight in pixels of FIELD3:

<field sid="FIELD3"><itemlocation>

<x>17</x><y>25</y><width>48</width><height>397</height>

</itemlocation><value compute="toggle(BUTTON1.activated, 'off', 'on') == &#xA;

'1' ? viewer.getHeight('pixels') : value"></value><scrollhoriz>always</scrollhoriz>

</field>

viewer.getHeight(units, item)

XFDL Version 7.7 487

Page 494: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getHelpModeReturns the status of the IBM Lotus Forms Viewer’s Help mode. The Viewer has ahelp mode that is entered when the user clicks the help icon on the Viewer toolbar.While the help mode is active, help messages that have been added to the form aredisplayed for the user as hover help. getHelpMode should be used in conjunctionwith the toggle function

Syntax

Returns

Returns either ″on″ or ″off″.

Example

The following example creates a button in the form that turns the help mode onand off, like the button in the Viewer’s toolbar. When the button is clicked, theform uses getHelpMode to determine whether the help mode is currently on or off.Based on that value, the form uses setHelpMode to change the setting of the helpmode. So, if the help mode is on, the form sets it to off, and if the help mode is off,the form sets it to on.

<button sid="toggleHelp_BUTTON"><value>Toggle Help Mode</value><custom:toggle_OPTION xfdl:compute="toggle(activated, &#xA;

'off', 'on')=='1' ? viewer.getHelpMode()=='on' ? &#xA;viewer.setHelpMode("off") : viewer.setHelpMode &#xA;('on') : ''"></custom:toggle_OPTION>

</button>

viewer.getHelpMode()

488 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 495: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getWidthMeasures an item’s width in either pixels or characters.

Syntax

Table 245. viewer.getWidth parameters

Parameter Type Description

units String Determines whether width is measured in chars orpixels.

item Referencestring

Optional. References the scope identifier (sid) of theitem you want to measure. If no item is specified, thecurrent item is measured.

Returns

Returns a string containing the width of the current or specified item in eitherpixels or characters.

Usage details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the getWidth function. If you want getWidth to run when theform opens, toggle the function off of the value of the global.global.activatedoption. This option switches to on when the form is opened.

Example

In the following example, when a user selects BUTTON1, getWidth calculates thewidth in pixels of FIELD3:

<field sid="FIELD3"><itemlocation>

<x>17</x><y>25</y><width>48</width><height>397</height>

</itemlocation><value compute="toggle(BUTTON1.activated, 'off', 'on') == &#xA;

'1' ? viewer.getWidth('pixels') : value"></value><scrollhoriz>always</scrollhoriz>

</field>

viewer.getWidth(units, [item])

XFDL Version 7.7 489

Page 496: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getXCalculates the x coordinate as the distance from the left edge of the form to the leftedge of the item in pixels.

Syntax

Table 246. viewer.getX parameters

Parameter Type Description

item Referencestring

Optional. References the scope identifier (sid) of theitem you want to measure. If no item is specified, thecurrent item is measured.

Returns

Returns a string containing the x coordinate of the item in pixels.

Usage Details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the getX function. If you want getX to run when the formopens, toggle the function off of the value of the global.global.activated option.This option switches to on when the form is opened.

Example

In the following example, when a user selects BUTTON1, getX calculates the xcoordinate of FIELD3:

<field sid="FIELD3"><itemlocation>

<x>17</x><y>25</y><width>48</width><height>397</height>

</itemlocation><value compute="toggle(BUTTON1.activated, 'off', 'on') == &#xA;

'1' ? viewer.getX() : '' "></value><scrollhoriz>always</scrollhoriz>

</field>

viewer.getX(item)

490 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 497: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.getYCalculates the y coordinate as the distance from the top edge of the form to the topedge of the item in pixels.

Syntax

Table 247. viewer.getY parameters

Parameter Type Description

item Referencestring

Optional. References the scope identifier (sid) of theitem you want to measure. If no item is specified, thecurrent item is measured.

Returns

Returns a string containing the y coordinate of the item in pixels.

Usage Details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the getY function. If you want getY to run when the formopens, toggle the function off of the value of the global.global.activated option.This option switches to on when the form is opened.

Example

In the following example, when a user selects BUTTON1, getY calculates the ycoordinate of FIELD3:

<field sid="FIELD3"><itemlocation>

<x>17</x><y>25</y><width>48</width><height>397</height>

</itemlocation><value compute="toggle(BUTTON1.activated, 'off', 'on') == &#xA;

'1' ? viewer.getY() : ''"></value><scrollhoriz>always</scrollhoriz>

</field>

getY(item)

XFDL Version 7.7 491

Page 498: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.setHelpModeSets the IBM Lotus Forms Viewer help mode to on or off. The Viewer has a helpmode that is entered when the user clicks the help icon on the toolbar. While thehelp mode is active, help messages that have been added to the form are displayedfor the user as tool tips.

Help mode can only be set to on if the page currently being displayed containshelp items. If there is no help available in the current page, then help modecannot be initialized.

Syntax

Table 248. viewer.setHelpMode parameters

Parameter Type Description

helpModeSetting String The status the help mode should be set to. Validsettings are on or off.

Example

The following example creates a button that will turn the help mode on whenclicked. Note that this example also uses the toggle function .

<button sid = "help_mode_BUTTON"><value>Help Mode</value><custom:mode_OPTION xfdl:compute="toggle &#xA;

(help_mode_BUTTON.activated)== '1' ? &#xA;viewer.setHelpMode("on") : ''"></custom:mode_OPTION>

</button>

viewer.setHelpMode(helpModeSetting)

492 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 499: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.measureHeightDynamically changes the height of a field to fit the text entered by a user. Theheight of the field can be measured in either pixels or characters.

This function should be used as part of a size or itemlocation options, to allowitems to be dynamically sized based on the amount of text in those items. Theviewer.measureHeight function must be used in conjunction with the togglefunction or be triggered by the event model.

Syntax

Table 249. viewer.measureHeight parameters

Parameter Type Description

units String Determines whether height is measured in chars orpixels.

item Referencestring

Optional. References the item you want to measure. Ifno item is specified, the item containing themeasureHeight function will be measured.

scrollvert String Optional. Determines whether a scrollbar should betaken into consideration when measuring the heightof a field. Used only if you have a dynamically-addedvertical scrollbar that only appears when the field hasthe focus. If this parameter is used, its setting must bealways.

Returns

Returns a number representing the height in lines or pixels.

Example

The example below sets the height of the field to either the value returned by theviewer.measureHeight function, or to the minimum height required for two lines oftext, whichever is greater. The calculation is based on the default 8pt Arial font,which means that the minimum height for two lines is 38 pixels. Other fonts andfont sizes have different heights. The field resizes itself when the user tabs out ofthe field or moves the cursor to another item on the form.

In this example, the value ″38″ is the height (in pixels) that the field is set towhen it is empty. This value must be determined based on the font size usedand how many blank lines of text you want to show when the field is empty.

<field sid = "description_FIELD"><scrollhoriz>wordwrap</scrollhoriz><scrollvert>always</scrollvert><value></value><itemlocation>

<x>100</x><y>50</y><width>300</width><height compute="(toggle(value) == '1') and &#xA;

viewer.measureHeight(units, item, scrollvert)

XFDL Version 7.7 493

Page 500: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

(viewer.measureHeight('pixels') > '38') ? &#xA;viewer.measureHeight('pixels') : '38'"></height>

</itemlocation></field>

Character values for height should be used to set the second element of the sizeoption. For example:

<size><width>60</width><height compute="(toggle(value) == '1') ? &#xA;

viewer.measureHeight('chars') : '1'"></height></size>

Using the size option to set the height of an item does not always allow for anexact fit. In some cases the item may be slightly larger than the text displayed,depending on the font and font size used.

Usage detailsv You must use the event model, such as keypress or mouseover events or the

toggle function, to trigger the viewer.measureHeight function.v The viewer.measureHeight function should be used only with field, label, or

box.v To have viewer.measureHeight run automatically, when the form opens, toggle

the function off of the value of the global.global.activated option. This optionwill switch to on when the form is opened.

494 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 501: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.messageBoxDisplays a message box that prompts the user. The message can be an OK box thatprompts the user to acknowledge by pressing OK, or a QUESTION box, thatprompts the user to answer Yes or No.

In each case, the message box displays a specified title and message. The messagebox returns a value based on the user’s response.

Syntax

Table 250. viewer.messageBox parameters

Parameter Type Description

message String Contains the message to display in the main portionof the message box.

caption String Contains the caption to display in the title bar of themessage box.

messagetype Messagebox type

Specifies whether the message box is an OK or aQUESTION box. If the type is OK, then the box willcontain an OK button. If the type is QUESTION, thenthe box contains a Yes button and a No button. Thedefault type is OK.

Returns

1 if the user selects the OK or Yes button. 0 if the user selects a No button.

Example

This example uses an action to open a message box when the form opens. Themessage tells the user that the button has been activated.

If the user clicks ″No″, the messageBox function returns a value of ″0″. Thecompute on the active option of the cancel_form action then evaluates to false, andthe active option of cancel_form is set to off, so the form opens as normal. If theuser clicks ″Yes″, the value returned by the function is 1, and the action’s activeoption is set to on, closing the form.

<button sid="BUTTON1"><itemlocation>

<x>0</x><y>650</y><width>255</width>

</itemlocation><value>messageBox - Click Me</value><custom:onClick xfdl:compute="toggle(PAGE1.BUTTON1.activated, 'off', 'on')

== '1' ? (viewer.messageBox('you have just activated this button by clicking on it.','activated event', '0')) : ''"></custom:onClick>

</button>

messageBox(message caption, messagetype)

XFDL Version 7.7 495

Page 502: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.paramLets you call one of several name attributes of the HTML param element. It returnsthe value of the specified name attribute’s associated value attribute. This functionis only valid if the IBM Lotus Forms Viewer is embedded in an HTML page.

Syntax

Table 251. viewer.param parameters

Parameter Type Description

name String The value of the name attributes in the HTML paramelement. They are:

v XFDLID

v TTL

v detach_id

v refresh_URL

v retain_viewer

v portlet_URL

v instance_1... instance_n

.

Returns

The value of the HTML param element’s value attribute.

Usage details

The HTML object element is used to embed XFDL forms inside HTML pages. TheHTML param element consists of name and value attributes that have no meaningin HTML. However the properties of the name and value attributes determine theViewer’s behavior when embedded in an HTML page. The viewer.param functionreturns the value of the param element’s value attribute for use in XFDL computes.To do this, it must call the relevant attribute property by name to retrieve its value.These properties are:

XFDLIDReturns the ID of the tag that contains the form information.

TTL Returns the length of time that the detached form is alive before beingdestroyed automatically. The value is given in seconds. For example, 60.

detach_idReturns the unique ID of the form instance, which is used in successiveobjects to allow the form to be reattached and updated.

refresh_URLReturns the URL called to reload the XFDL form if detach_id has timedout.

retain_viewerReturns either off or on, depending on whether the Viewer remainsavailable after completing replace or done actions. If retain_viewer is off,

viewer.param(name)

496 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 503: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

the Viewer closes after completing either action. If it is on, the Viewerremains available for further use, such as to retain form data after asubmission.

portlet_URLReturns the URL of the portlet.

instance_1... instance_nReturns information regarding the XML data inside the HTML documentthat will replace or be appended to a specific XML instance inside theXFDL form. This information includes:v The ID of the new instance

Two additional values can also be returned:v The ID of the form instancev Either replace or append, depending upon whether the new instance

data replaces or adds to the original instance data. Note that replace isthe default value.

v The reference within the instance that indicates where the new datashould be placed. Note that any namespaces listed in this value resolverelative to the document root.

Note: You must use the event model, such as keypress or mouseover events or thetoggle function, to trigger the param function. If you want getHeight to run whenthe form opens, toggle the function off of the value of the global.global.activatedoption. This option switches to on when the form is opened.

Example

In the following example, when a user selects BUTTON1, param returns theXFDLID value to FIELD3:

<field sid="FIELD3"><itemlocation>

<x>17</x><y>25</y><width>48</width><height>397</height>

</itemlocation><value compute="toggle(BUTTON1.activated, 'off', 'on') == &#xA;

'1' ? viewer.param('XFDLID') : value"></value></field>

XFDL Version 7.7 497

Page 504: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.setCursorPlaces the cursor at a specific location in a field or highlights a specific section oftext within a field. Use this function when you want the user to start typing aftersome information that is already in a field, or when you want the user to replace aspecific section of text.

Syntax

Table 252. viewer.setCursor parameters

Parameter Type Description

startValue Integer The start position of the cursor within a field.

endValue Integer Optional. The end position of the highlighted textwithin a field.

Returns

1 if function is successful or 0 if errors occur.

Usage detailsv If both parameters have the same value, the cursor is placed at the location

indicated.v If the endValue is less than startValue, the second parameter is ignored and the

cursor is placed at the location indicated by the first parameter.v If the endValue is greater than the length of the field, all of the text and white

space (such as spaces) in the field, from the location indicated by the firstparameter to the end of the field, is highlighted.

Example

In this example, when the user tabs into the field, the word ″shall″ is highlighted.Note that setCursor must be used in conjunction with the toggle function .

<field sid = "FIELD1"><label>Set Cursor Field</label><custom:set_cursor xfdl:compute="toggle(focused, 'off', 'on') &#xA;

== '1' ? viewer.setCursor('6', '10') : ''"></custom:set_cursor><value>What shall we do with the drunken sailor?</value>

</field>

viewer.setCursor(startValue, endValue)

498 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 505: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.setDefaultFilenameSets the default file name of a form, unless they are temporary files. A form isconsidered temporary if it is passed to the IBM Lotus Forms Viewer by the Webbrowser in response to a Web transaction. Temporary files have no defaultfilenames.

Use this function when you are using the same form many times, and you want touniquely identify each copy of the form based on who completed it and when itwas filled out. For example, you might create a new file name based on the username and the date.

Syntax

Table 253. viewer.setDefaultFilename parameters

Parameter Type Description

units String The new default file name for the form. This stringshould not include path information.

Returns

Nothing

Usage details

You must use the event model, such as keypress or mouseover events or the togglefunction, to trigger the setDefaultFilename function. If you wantsetDefaultFilename to run when the form opens, toggle the function off of thevalue of the global.global.activated option. This option switches to on when theform is opened.

Example

In this example, setDefaultFilename is used when the save button is clicked. Notethat this example also uses the toggle function.

<button sid = "save_BUTTON"><value>Save</value><custom:filenameSet_Option xfdl:compute="toggle &#xA;

(save_BUTTON.activated) == '1' ? viewer.setDefaultFilename( &#xA;'myform' +. date()) : ''"></custom:filenameSet_Option>

<type>saveform</type></button>

When the button is clicked, the default file name is set to be ″myform<date>″. Forexample, if the form was saved on September 13, 2007, the file name would be setto ″myform20070913″.

viewer.setDefaultFilename(file name)

XFDL Version 7.7 499

Page 506: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms.getPosInSetReturns an index that indicates the position in a set. For example, for a table itemthis function determines which row of the table the compute is in. For a group(checkgroup or radiogroup), this function determines which item in the group thecompute is in.

This function is part of the xforms package of functions, and must include thexforms. prefix.

Syntax

Returns

An integer representing the position in the set. The integer is one-based. Thismeans that the first element/row returns a value of 1, the second a value of 2, andso on.

Example

The following checkgroup uses the xforms.getPosInSet and xforms.getSizeOfSetfunctions to arrange the checks in two equal length columns. To achieve this, the xand y coordinates are computed for each item in the group as shown:

<checkgroup sid="color"><xforms:select ref="color" appearance="full">

<xforms:label>Select the colors you like:</xforms:label><xforms:itemset nodeset="../choice">

<xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<itemlocation><x compute="floor((xforms.getPosInSet() - '1') / &#xA;

(ceiling(xforms.getSizeOfSet() / '2'))) * '60'"/><y compute="(xforms.getPosInSet() - '1') % &#xA;

(ceiling(xforms.getSizeOfSet() / '2')) * '20'"/></itemlocation>

</xforms:extension></xforms:itemset>

</xforms:select></checkgroup>

To calculate the x coordinate, the following algorithm is used:1. Calculate the size of the set, divide this number by two, then get the ceiling of

that value.This calculation determines the length of the first column, which is alwayslonger if there is an odd number of items.

2. Determine the position of the item in the set and subtract one.This calculation returns a zero-based position in the set.

3. Divide the position in the set by the length of the first row, then get the floor ofthis value.This returns a zero if the position is less than the length of the first row, or aone if the position is equal to or greater than the length of the first row. Thiscalculation works because the set is zero-based, so the first five items (0-4)return a zero because they are all less than 5.

xforms.getPosInSet()

500 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 507: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

4. Multiply by 60.This calculation returns an x coordinate of zero if the item is in the firstcolumn, or an x coordinate of 60 if the item is in the second column, effectivelyindenting the second column.

To calculate the y coordinate, the following algorithm is used:1. Calculate the size of the set, divide this number by two, then get the ceiling of

that value.This calculation determines the length of the first column, which is alwayslonger if there is an odd number of items.

2. Determine the position of the item in the set and subtract one.This calculation returns a zero-based position in the set.

3. Get the modulus of the position in the set divided by the length of the firstrow.This calculation returns zero for the first item, one for the second, two for thethird, and so on. When the end of the first row is reached, the modulus beginsagain at zero.

4. Multiply by 20.This determines the y coordinate, so the first item has a y coordinate of zero,the second a y coordinate of 20, and so on. The second row resets at zero andbegins the count again.

XFDL Version 7.7 501

Page 508: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms.getSizeOfSetReturns the size of a set. For example, for a table item this function determineshow many rows are in the table. For a group (checkgroup or radiogroup), thisfunction determines how many items are in the group

This function is part of the xforms package of functions, and must include thexforms. prefix.

Syntax

Returns

An integer representing the size of the set.

Example

The following checkgroup uses the xforms.getPosInSet andxforms.getSizeOfSetfunctions to arrange the checks in two equal length columns.To achieve this, the x and y coordinates are computed for each item in the groupas shown:

<checkgroup sid="color"><xforms:select ref="color" appearance="full">

<xforms:label>Select the colors you like:</xforms:label><xforms:itemset nodeset="../choice">

<xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value><xforms:extension>

<itemlocation><x compute="floor((xforms.getPosInSet() - '1') / &#xA;

(ceiling(xforms.getSizeOfSet() / '2'))) * '60'"/><y compute="(xforms.getPosInSet() - '1') % &#xA;

(ceiling(xforms.getSizeOfSet() / '2')) * '20'"/></itemlocation>

</xforms:extension></xforms:itemset>

</xforms:select></checkgroup>

To calculate the x coordinate, the following algorithm is used:1. Calculate the size of the set, divide this number by two, then get the ceiling of

that value.This calculation determines the length of the first column, which is alwayslonger if there is an odd number of items.

2. Determine the position of the item in the set and subtract one.This calculation returns a zero-based position in the set.

3. Divide the position in the set by the length of the first row, then get the floor ofthis value.This returns a zero if the position is less than the length of the first row, or aone if the position is equal to or greater than the length of the first row. Thiscalculation works because the set is zero-based, so the first five items (0-4)return a zero because they are all less than 5.

4. Multiply by 60.

xforms.getSizeOfSet()

502 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 509: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This calculation returns an x coordinate of zero if the item is in the firstcolumn, or an x coordinate of 60 if the item is in the second column, effectivelyindenting the second column.

To calculate the y coordinate, the following algorithm is used:1. Calculate the size of the set, divide this number by two, then get the ceiling of

that value.This calculation determines the length of the first column, which is alwayslonger if there is an odd number of items.

2. Determine the position of the item in the set and subtract one.This calculation returns a zero-based position in the set.

3. Get the modulus of the position in the set divided by the length of the firstrow.This calculation returns zero for the first item, one for the second, two for thethird, and so on. When the end of the first row is reached, the modulus beginsagain at zero.

4. Multiply by 20.This determines the y coordinate, so the first item has a y coordinate of zero,the second a y coordinate of 20, and so on. The second row resets at zero andbegins the count again.

XFDL Version 7.7 503

Page 510: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms.updateModelUpdates the XForms model in the form. In general, the model is automaticallyupdated by the forms viewing application when required. However, this functionhas been added for completeness.

This function is part of the xforms package of functions, and must include thexforms. prefix.

Syntax

Table 254. xforms.updateModel parameters

Parameter Type Description

id String Optional. The ID of the model you want to update. Ifno ID is provided, the first model is updated.

Returns

″1″ if the operation completed successfully or ″0″ if an error occurred.

xforms.updateModel(id)

504 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 511: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xmlmodelUpdateUpdates the XML data model in the form. Use this function when computes havechanged the structure of the data model in some way, such as changing or addingbindings. These structural changes do not take effect until the xmlmodelUpdatefunction is called.

Syntax

Returns

″1″ if the operation completed successfully or ″0″ if an error occurred.

Example

The following XML data model has two instances for customer data. In this case,the second data instance is bound to the form, linking first name and last name.

<xmlmodel><instances>

<xforms:instance xmlns="http://www.w3.org/2003/xforms"><customers>

<customerData><firstName></firstName><lastName></lastName>

</customerData><customerData>

<firstName></firstName><lastName></lastName>

</customerData><customers>

<xforms:instance></instances><bindings>

<bind><ref>[customers][1][firstName]</ref><boundOption>Page1.firstNameField.value</boundOption>

</bind><bind>

<ref>[customers][1][lastName]</ref><boundOption>Page1.lastNameField.value</boundOption>

</bind></bindings>

</xmlmodel>

The following button changes the data model so that the form elements are boundto the first data instance rather than the second. When the button is clicked, thetoggle function is triggered, which uses two set functions to change theboundOption elements in the data model. It also calls the xmlmodelUpdatefunction to ensure that the changes take effect immediately.

<button sid="updateDataModel"><value>Click to Update Data Model</value><type>select</type><custom:update compute=

"toggle(activated, 'off', 'on') == '1' &#xA;? set(global.global.xmlmodel[bindings][0][ref], &#xA;'[customers][0][firstName]') + &#xA;

xmlmodelUpdate()

XFDL Version 7.7 505

Page 512: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

set(global.global.xmlmodel[bindings][1][ref], &#xA;'[customers][0][lastName]') + xmlmodelUpdate() &#xA;: ''"></custom:update>

</button>

506 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 513: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xmlmodelValidateValidates the XML Data Model against the available schemas.

A form can contain schemas as part of the XML Data Model, or may link toexternal schemas. In either case, the active schemas are listed in the schemaattribute on the xmlmodel element. Only those schemas listed in the schemaattribute are used to validate data.

Syntax

Returns

The schema error message if the validation fails or an empty string if thevalidation is successful.

Example

The following example creates a Submit button in the form. When the user clicksthe button, the toggle function triggers the xmlmodelValidate function, whichvalidates the data.

<button sid="submitForm"><value>Submit</value><type>done</type><custom:results></custom:results><custom:opt xfdl:compute="toggle(activated, 'off', 'on') &#xA;

== '1' ? &#xA;set('custom:results', xmlmodelValidate()) &#xA;+ (strlen(custom:results) > '0' &#xA;? viewer.messageBox(custom:results) &#xA;+ set('activated', 'off') &#xA;: '') : ''"></custom:opt>

</button>

Time and date functionsTime and date functions let you calculate dates and time. For example, a time anddate function could calculate the current date and time or determine how muchtime has passed since a specified date.

dateReturns a date in ″yyyymmdd″ format. This function either converts a number ofseconds (from 12 a.m., 1 January, 1970) or returns the current date if no value isprovided.

Syntax

xmlmodelValidate()

date(dateSecs)

XFDL Version 7.7 507

Page 514: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 255. date parameters

Parameter Type Description

dateSecs Integer Optional. The number of seconds from 12 am, 1January, 1970. If no value is provided, the current dateis returned.

Returns

A string containing the current date, or the date specified by the a date representedby the number of seconds since 00:00:00 GMT, 1 January, 1970

Example

In this example, if run on 18 January, 2008, the result of date is ″20080118″.<field sid="dateTestField">

<label>Test date()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="date()"></value>

</field>

508 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 515: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dateToSecondsReturns the number of seconds from the GMT date and time (represented in dateand time respectively) since 00:00:00 GMT, 1 January, 1970.

When passing a date parameter to the function dateToSeconds, use a format that isused by XFDL. See the format option description for valid date formats.

Note: The best way to ensure that you pass a date in a valid format is to enter thedate in a field, label or cell that has an XFDL format option assigned to it. See thesecond example below.

When passing a time parameter to the function dateToSeconds, the time mayconsist only of hours:minutes. You can also use a 24-hour clock (for example, 23:34)or a 12-hour clock with A.M and P.M. (11:34 P.M.) designators. The time parameteris optional.

An error occurs if either of date or time is not well-formed.

To call the reverse of this function use the date function.

Syntax

Table 256. dateToSeconds parameters

Parameter Type Description

date String A date in a recognized format.

time String Optional. A time (ending in minutes) in a validformat. For example, 23:34 or 11:34 p.m.

reference Referencestring

Optional. A reference to an item that contains theformat option to use when interpreting the date. If noformat is provided, the function uses the form localeto determine the date format.

Returns

A string containing the number of seconds, or an empty string if an error occurs.

Example

In this example, the result of dateToSeconds is ″890329140″.<field sid="dtsField">

<value compute="dateToSeconds('2008-03-19', '09:39')"></value></field>

In the following example, the first field takes a date as input, and formats it usingthe XFDL long format. The second field calls the dateToSeconds function, and usesan option reference as a parameter (enterDateField.value). This reference takes thealready-formatted date that the user enters, and passes it into the function.

<field sid="enterDateField"><format>

<datatype>date</datatype><presentation>

dateToSeconds(date, time, reference)

XFDL Version 7.7 509

Page 516: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<style>long</style></presentation>

</format><value></value>

</field><field sid="dtsField">

<value compute="dateToSeconds(enterDateField.value, '09:39')"></value>

</field>

510 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 517: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dayReturns the numeric day of the month for the provided date in dateSecs or thecurrent date if one is not provided. The provided date is a string representing thenumber of seconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 257. day parameters

Parameter Type Description

dateSecs Integer Optional. The number of seconds from 12 am, 1January, 1970. If no value is provided, the current dateis returned.

Returns

A string containing the day, or an empty string if an error occurs.

Example

In this example, the result of day is ″19″.<field sid="dayTestField">

<label>Test day()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="day('890300356')"></value>

</field>

day(dateSecs)

XFDL Version 7.7 511

Page 518: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

dayOfWeekReturns the numeric day of the week where Sunday=1 for the provided date indateSecs or the current date, if one is not provided. The provided date is a stringrepresenting the number of seconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 258. dayOfWeek parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the day of the week, or an empty string if an error occurs.

Example

In this example, the result of dayOfWeek is ″5″.<field sid="dowTestField">

<label>Test dayOfWeek()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="dayOfWeek('890300356')"></value>

</field>

dayOfWeek(dateSecs)

512 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 519: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

endOfMonthReturns the number of seconds since 00:00:00 GMT, 1 January, 1970 to the currenttime on the last day of the month in the date provided in dateSecs or the currentdate if one is not provided. The provided date is a string representing the numberof seconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 259. endOfMonth parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the number of seconds, or an empty string if an error occurs.

Example

In this example, the result of endOfMonth is ″891337156″.<field sid="eomTestField">

<label>Test endOfMonth()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="endOfMonth('890300356')"></value>

</field>

endOfMonth(dateSecs)

XFDL Version 7.7 513

Page 520: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

hourReturns the numeric hour for the provided hour in dateSecs or the current hour, ifone is not provided. If using dateSecs, the provided date is a string representingthe number of seconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 260. hour parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the hour, or an empty string if an error occurs.

Example

In this example, the result of hour is ″9″.<field sid="hourTestField">

<label>Test hour()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="hour('890300356')"></value>

</field>

hour(dateSecs)

514 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 521: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

minuteReturns the numeric minute for the provided date in dateSecs or the current dateif one is not provided. The provided date is a string representing the number ofseconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 261. minute parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the minute, or an empty string if an error occurs.

Example

In this example, the result of minute is ″39″.<field sid="minuteTestField">

<label>Test minute()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="minute('890300356')"></value>

</field>

minute(dateSecs)

XFDL Version 7.7 515

Page 522: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

monthReturns the numeric month of the year for the provided date in dateSecs or thecurrent date if one is not provided. The provided date is a string representing thenumber of seconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 262. month parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the month, or an empty string if an error occurs.

Example

In this example, the result of month is ″3″.<field sid="monthTestField">

<label>Test month()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="month('890300356')"></value>

</field>

month(dateSecs)

516 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 523: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

nowReturns the number of seconds since 00:00:00 GMT, 1 January, 1970.

Syntax

Returns

A string containing the number of seconds 00:00:00 GMT, 1 January, 1970.

Example

In this example, if run at 09:39:16 GMT on Thursday, March 19th, 2008, the resultof now would be ″890300356″.

<field sid="nowTestField"><label>Test now()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="now()"></value>

</field>

now()

XFDL Version 7.7 517

Page 524: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

secondReturns the numeric month of the year for the provided date in dateSecs or thecurrent date if one is not provided. The provided date is a string representing thenumber of seconds since 00:00:00 GMT, 1 January, 1970.

Returns the numeric second for the provided date in dateSecs or the current dateif one is not provided. The provided date is a string representing the number ofseconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 263. second parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the second, or an empty string if an error occurs.

Example

In this example, the result of second is ″16″.<field sid="secondTestField">

<label>Test second()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="second('890300356')"></value>

</field>

second(dateSecs)

518 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 525: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

timeReturns the current time in ″hh:mm AM″ format.

Syntax

Returns

A string containing the current time.

Example

In this example, if run at 3:22 in the afternoon, the result of time would be ″3:22PM″.

<field sid="timeTestField"><label>Test time()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="time()"></value>

</field>

time()

XFDL Version 7.7 519

Page 526: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

yearReturns the numeric year for the provided date in dateSecs or the current date ifone is not provided. The provided date is a string representing the number ofseconds since 00:00:00 GMT, 1 January, 1970.

An error occurs if dateSecs is not well-formed.

Syntax

Table 264. year parameters

Parameter Type Description

dateSecs Integer Optional. A date represented by the number ofseconds since 00:00:00 GMT, 1 January, 1970. If novalue is supplied, the current date is used.

Returns

A string containing the year, or an empty string if an error occurs.

Example

In this example, the result of year is ″1998″.<field sid="yearTestField">

<label>Test year()</label><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="year('890300356')"></value>

</field>

year(dateSecs)

520 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 527: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Header/Footer FunctionsThis is a collection of functions that can be used within the printsettings option toadd header and footer information to a form. These headers and footers do notappear on the screen, but do appear when the form is printed.

Each header and footer can be one or more lines in height. However, they can beno larger than 1/3 of the page size. Each header and footer is also divided intothree separate sections: the left, the middle, and the right. By placing text in aparticular section, you control where the text is positioned, as follows:v Left – The text begins at the left edge of the form.v Middle – The text is centered in the middle of the form.v Right – The text is positioned so that it ends at the right edge of the form.

Each section can contain different text. For example, you might put a date in theleft section, a title in the middle section, and a page number in the right section.

If you place a long string of text in a header or footer, it will overlap the othersections of that header or footer. For example, suppose you put the following textin the left section of your header:

This form is for demonstration purposes only. Do not distribute.

This text would start at the left edge of the form, but would continue to overlapthe middle portion of the header. Futhermore, a longer string would also overlapthe right portion of the header.

Any hard returns placed in a string are respected. For example, you could avoidoverlapping the other sections of the header by using the same string with hardreturns, as shown:

This form is fordemonstration purposesonly. Do not distribute.

If a string is wider than the form, it is truncated appropriately. For example, astring that starts on the left edge of the form is truncated once it reaches the rightedge of the form, and vice versa. If a string starts in the middle of the form, it istruncated on both the left and right edges.

Setting the PrintSettings Option

When using the Header/Footer functions, you must include two additional arraysin the printsettings option for the form. The printsettings option should beconfigured as follows:

<printsettings><pages>page list</pages><dialog>dialog settings</dialog><header>header information</header><footer>footer information</footer>

</printsettings>

The header and footer information are themselves arrays, and should look like this:<header>

<left>left text</left><center>center text</center><right>right text</right>

</header>

XFDL Version 7.7 521

Page 528: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

All text can be set as normal, using strings, computes, or functions to determinewhat the text should be.

For more information on configuring the page list and dialog settings, refer to theXFDL Specification.

Pages vs. Sheets

Forms often contain multiple pages. These pages are just like the pages of a paperform - you complete one page at a time, and “flip” between the pages (usuallywith a next or previous page button) while completing the form.

However, when a form is printed, sometimes a single page of the form will be toolarge to fit on one piece of paper. Since there is no limit to the space you can takeup on the computer screen, some form pages may in fact cover many pieces ofpaper when printed. To make the distinction between a “form page” and the“number of pieces of paper” more clear, we call the pieces of paper “sheets”. So, ifthe first page of a form prints on three pieces of paper, we say that the page coversthree sheets.

This distinction is important for numbering, since the Header/Footer functionsallow you to number both pages and sheets when printing your form.

522 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 529: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printActualFormPagePrints the page number of the page currently being printed. Numbering beginsfrom the first page being printed and does not include pages not being printed.

Syntax

Returns

Numbering begins from the first page being printed, and does not include pagesnot being printed.

Example

This example shows how page numbers would be applied when printing. Forexample, if the third page of the form was being printed, but pages 1-2 were not,the number 1 would be printed on the third page. Note that pages with multiplesheets will have the same number on each sheet.

<printsettings><pages>page list</pages><dialog>dialog settings</dialog><footer>

<left compute="'Page Number ' +. viewer.printActualFormPage()"></left></footer>

</printsettings>

When printing page 3 (using printActualFormPage) without printing pages 1-2 ,the footer will display as below:

Page 1

viewer.printActualFormPage()

XFDL Version 7.7 523

Page 530: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printActualTotalFormPagesPrints the total number of pages being printed. Numbering begins with the firstpage being printed, and does not include pages not being printed.

Syntax

Returns

Numbering begins with the first page being printed, and does not include pagesnot being printed. For example, if a form that contained 3 pages was being printed,but page 1 was not being printed, then the total number of pages would be 2.

Example

This example shows how page numbers would be applied when printing. Notethat the total page count is not affected by the number of sheets any page mayprint on. For example, if two pages of the form printed on three sheets, the pagecount would still be two.

<printsettings><pages>page list</pages><dialog>dialog settings</dialog><footer>

<right compute="'Page Number ' +. viewer.printActualTotalFormPages()"></right>

</footer></printsettings>

viewer.printActualTotalFormPages()

524 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 531: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printDatePrints the current date from your computer’s system clock.

Syntax

Returns

Returns the date for the locale selected. The date is formatted to reflect the localesettings specified in the form.

Example

This example shows how the print date can be added to the left header.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><header>

<left compute="'Printed on ' +. viewer.printDate()"></left></header>

</printsettings>

When printed, the header will show the date on the left-hand side of the page asshown below:

Printed on September 24, 2007

viewer.printDate()

XFDL Version 7.7 525

Page 532: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printFormPagePrints the page number of the page currently being printed.

Syntax

Returns

Numbering begins from the first page of the form and includes all pagesregardless of whether the pages are being printed.

Example

This example shows how page numbers would be applied when printing. Whenthe third page of the form is being printed, the number 3 would be printed on thepage. This would be true even if page 1 was not printed. Note that pages withmultiple sheets will have the same number on each sheet.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><footer>

<left compute="'Page Number ' +. viewer.printFormPage()"></left></footer>

</printsettings>

Footer of page 14 would display the page number as follows:

Page 14

viewer.printFormPage()

526 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 533: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printPageSheetPrints the sheet number of the form currently being printed. Each piece of paperused in printing is one “sheet”. In this case, numbering begins with the first sheetused to print the current page.

Syntax

Returns

Each piece of paper used in printing is one “sheet”. In this case, numbering beginswith the first sheet used to print the current page. For example, if a form printedpage two on two pieces of paper, then the numbers of those pieces of paper wouldbe 1 and 2 respectively.

Example

This example shows how page numbers would be applied when printing.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><footer>

<right compute="'Sheet Number ' +. viewer.printPageSheet()"></right></footer>

</printsettings>

viewer.printPageSheet()

XFDL Version 7.7 527

Page 534: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printSheetPrints the sheet number of the form currently being printed. Each piece of paperused in printing is one “sheet”, and numbering begins with the first piece of paperused to print the form.

Syntax

Returns

Each piece of paper used in printing is one “sheet”, and numbering begins withthe first piece of paper used to print the form. For example, if a form printed pageone on one sheet of paper, page two on two sheets of paper, and page three on onesheet of paper, the sheets would be numbered 1 through 4. If a page is not printed,the sheet count does not include that page. For example, if page one in theexample above were not printed, the other sheets would be numbered 1, 2, and 3respectively.

Example

This example shows how sheet numbers would be applied when printing.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><footer>

<right compute="'Sheet Number ' +. viewer.printSheet()"></right></footer>

</printsettings>

viewer.printSheet()

528 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 535: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printTimePrints the current time from your computer’s system clock.

Syntax

Returns

Returns the time for the locale selected. The time is formatted to reflect the localesettings specified in the form.

Example

This example shows how the print time can be added to the center header.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><header>

<center compute="'Printed at ' +. viewer.printTime()"></center></header>

</printsettings>

The header will appear with the print time in the center of the page as shownbelow:

Printed at 8:45 am

viewer.printTime()

XFDL Version 7.7 529

Page 536: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printTotalFormPagesPrints the total number of pages in the form. Numbering begins from the first pageof the form, and includes all pages regardless of whether they are being printed.

Syntax

Returns

Numbering begins from the first page being printed, and includes pages not beingprinted. For example, if a form that contained 3 pages was being printed, then thetotal number of pages would be 3. This would be true even if page 1 was notbeing printed.

Example

This example shows how page numbers would be applied when printing. Notethat the total page count is not affected by the number of sheets any page mayprint on. For example, if a three page form prints on four sheets, the page count isstill three.

<printsettings><pages>page list</pages><dialog>dialog settings</dialog><footer>

<right compute="'Page Number ' +. viewer.printTotalFormPages()"></right></footer>

</printsettings>

When printed, the page number will appear on the right-hand side of the footer asshown below.

Page 3

viewer.printTotalFormPages()

530 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 537: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

viewer.printTotalPageSheetsPrints the total number of sheets necessary to print the current page. Each piece ofpaper used in printing is one “sheet”. Numbering begins with the first sheet usedto print the current page.

Syntax

Returns

Each piece of paper used in printing is one “sheet”. Numbering begins with thefirst sheet used to print the current page. For example, if a form printed page twoon two pieces of paper, then the number 2 would be printed on both sheets.

Example

This example shows how sheet numbers would be applied as a footer whenprinting.<printsettings>

<pages>page list</pages><dialog>dialog settings</dialog><footer>

<right compute="'Sheet Number ' +. viewer.printTotalPageSheets()"></right></footer>

</printsettings>

viewer.printTotalPageSheets()

XFDL Version 7.7 531

Page 538: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Bidirectional functionsThis is a collection of functions that can be used with bidirectional languages, suchas Arabic and Hebrew.

bidiorderingTransforms text between logical and visual ordering. Visual ordering stores theuser data in the order in which it was typed. Logical ordering stores the data inthe order in which it is displayed on the screen. Use this function to transformdata that is stored in a different order than it is displayed. For example, yourdatabase or back end application may require data to be stored in logical order,while the form needs to display the text in visual order.

Visual

Logical

Form

Call bidiordering to transform

text when loading data

Call bidiordering to transform

text when submitting data

Logical

Visual

Form

Call bidiordering to transform

text when loading data

Call bidiordering to transform

text when submitting data

This function can be used as part of an XFDL compute or in an XPath expression.

Syntax

Table 265. bidirectional ordering parameters

Parameter Type Description

reference reference string, XPathexpression or a literal string

a reference to the element thatcontains the string you want totransform.

orientationInput ltr specifies the orientation of theinput string to Left-To-Right. Forexample, text written in English.

rtl specifies the orientation of theinput string to Right-To-Left. Forexample, text written in Arabic.

orderingSchemeInput logical specifies the orderingscheme of theinput string. Stores text in theorder in which it was typed.

visual specifies the orderingscheme of theinput string. Stores text in theorder it appears on the user’sscreen.

bidiordering('reference','orientationInput','orderingSchemeInput','orientationOutput','orderingSchemeOutput')

532 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 539: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 265. bidirectional ordering parameters (continued)

Parameter Type Description

orientationOutput ltr specifies the orientation of theinput string. Left-To-Right text.For example, text written inEnglish.

rtl specifies the orientation of theinput string. Right-To-Left text.For example, text written inArabic.

orderingSchemeOutput logical specifies the orderingscheme of theinput string. Stores or display textin the order in which it wastyped.

visual specifies the orderingscheme of theinput string. Stores or display textin the order it appears on theuser’s screen.

Returns

Returns a string containing transformed text.

Example

The bidiordering function can be used in two ways:v XFDL computesv XPath expressions

XFDL computes

As with XFDL functions, you can use bidiordering as part of an XFDL compute. Thefollowing example shows how to create a check box that sets the value ofPAGE2.phoneNumberField to that it contains the same information asPAGE1.phoneNumber field, except that the field on page 2 is transformed fromlogical to Left-To-Right ordering to Visual Left-To-Right ordering. ThePAGE1.phoneNumber field is modified by bidiordering to transform the phonenumber from logical to visual ordering.<field sid="phoneNumberField">

<value compute="PAGE1.CHECK1.value == 'on' &#xA? (set('PAGE2.phoneNumberField.value', bidiordering(PAGE1, &#xA

phoneNumber.value, 'ltr', 'logical', 'ltr', 'visual')&#xA: '')"></value>

</field>

XPath expressions

The following example shows how to use an XPath expression to trigger thebidiordering function to reorder an element attribute in the data model from visualRight-To-Left ordering to visual Left-To-Right ordering.<button sid="button2">

<xforms:trigger><xforms:action ev:event="DOMActivate"><xforms:setvalue ref="instance('main')/@attribute"value="xfdl:bidiordering(instance('main')/@attribute, 'rtl', 'visual',

XFDL Version 7.7 533

Page 540: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

'ltr', 'visual')"></xforms:setvalue></xforms:action></xforms:trigger>

</button>

This example shows how to use bidiordering in an XForms bind to reorder a literalstring in the bidiString node from logical Left-To-Right ordering to visualLeft-To-Right ordering. For the purposes of this example, the upper case charactersrepresent bidirectional Arabic text.<xforms:bind nodeset="instance('data')/strings/bidiString"calculate="xfdl: bidiordering('english ARABIC','ltr','logical','ltr','visual')"/>

534 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 541: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

shapedigitsTransforms numerals between Arabic (European) numerals and national numeralsand determines whether they are displayed left-to-right or right-to-left.

This function can be used as part of an XFDL compute or in an XPath expression.

Syntax

Table 266. shape digits parameters

Parameter Type Description

inputText Reference string, literal stringor XPath expression

a string or reference to an elementthat contains the string you wantto transform.

numberShapingOutput nominal uses Arabic numerals exclusively.

national uses national locale numeralsystem exclusively.

contextual selects the numeric symbolsdepending on proceeding context.

orientationOutput ltr specifies the orientation of theinput string to Left-To-Right. Forexample, text written in English.

rtl specifies the orientation of theinput string to Right-To-Left. Forexample, text written in Arabic.

Returns

Returns a string containing transformed numbers.

Example

The shapedigits function can be used in three ways:v XFDL computesv XPath expressionsv XForm binds

XFDL computes

The following example takes the literal string “abc 123” and transforms thenominal digits to national digits displayed from Left-To-Right.<value compute="shapedigits('abc 123','national','ltr') "></value>

XPath expressions

The following example uses an XPath expression to call the shapedigits function.<xforms:setvalue ref="instance('main')/field_contents"

value="xfdl:shapedigits('abc=123')"> </xforms:setvalue>

shapedigits(inputText numericShapingOutput, orientationOutput)

XFDL Version 7.7 535

Page 542: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XForms binds

The following example uses an XForms bind to call the shapedigits function.<xforms:bind nodeset="instance('data')/strings/bidiString"

calculate="xfdl:shapedigits('abc=123')"> </xforms:bind>

536 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 543: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

insertunicodecharacterAllows you to insert Unicode control characters inside text strings. While thisfunction allows you to insert any Unicode control character, it is most frequentlyused to insert control characters that ensure that bidirectional text is displayedcorrectly. This is needed when the required order of your text does not match theorder specified by the Unicode Bidirectional Algorithm (UBA).

For example, a file path such as C:\mydir\FORMS\MYFORMS.XFDL (where capitalletters indicate Right-To-Left text) renders as C:\mydir\MYFORMS.XFDL\FORMSaccording to UBA. To ensure that this file path renders correctly, you need to insertUnicode control characters before the delimiters. These control characters will thenoverride the text directions assumed by UBA.

This function checks the text string to see if control characters already exist, toavoid inserting duplicate control characters.

This function can be written as part of an XFDL compute or XPath expression.

Syntax

Table 267. insertunicodecharacter parameters

Parameter Type Description

reference Reference string, literal stringor XPath expression

a literal string or reference to thetext that you want to apply thefunction to.

controlCharacter string 16 bit Unicode control charactersplaced before each delimiter. thesecharacters must be specified inUTF-16 hexadecimal format.

For example, 0x200E.

delimiter symbol or character Special symbol or character thatmarks the beginning or end of aunit of data.

For example, forward slash (/).

Space separated lists of multipledelimeters are supported.

Results

String containing formatted text.

Examples

The insertunicodecharacter function can be used in three ways:v XFDL computesv XPath expressionsv XForm binds

insertunicodecharacter(reference,controlCharacter,delimiter)

XFDL Version 7.7 537

Page 544: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XFDL computes

In the following example, assume that capital letters indicate Right-To-Left text. Asyou can see, the text string in the compute shows day/year/month. This is thedirection that the Unicode Bidirectional Algorithm assumed that the text shouldtake when it encountered the string 19/MAY/2007. The Unicode BidirectionalAlgorithm parsed the 19 in a Left-To-Right direction, but switched to aRight-To-Left direction when it encountered the Right-To-Left text in MAY. TheRight-To-Left direction continued when it reached 2007, which can be rendered asboth Left-To-Right and Right-To-Left and therefore gives not strong directional cuesto the Unicode Bidirectional Algorithm. As a result, the Unicode BidirectionalAlgorithm places the year before the month.

With insertunicodecharacter, we can override the Unicode Bidirectional Algorithmso that the date is displayed in the correct order (MAY/19/2007) by insertingLeft-To-Right Unicode control characters before the / delimiter.<value compute="insertunicodecharacter('19/2007/MAY,'0x200e','/')"></value>

XPath expressions

The following example uses an XPath expression to call the insertunicodecharacterfunction.<xforms:setvalue ref="instance('main')/field_contents" value="xfdl:

insertunicodecharacter("19/2007/MAY", 0x200E,'/' )"></xforms:setvalue>

XForms binds

The following example uses an XForms bind to call the insertunicodecharacterfunction:<xforms:bind nodeset="instance('data')/strings/bidiString"

calculate="xfdl: insertunicodecharacter("19/2007/MAY",0x200E,'/' )"/>

538 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 545: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

format2ltrEnsures that the text before each delimiter is displayed in a left-to-right direction.This function is needed when the order of your text does not match the orderspecified by the Unicode Bidirectional Algorithm (UBA).

This function checks the string to see if direction control characters already exist inthe string to avoid inserting duplicated controls.

This function can be written as an XFDL compute or XPath expression.

Syntax

Table 268. format2ltrparameters

Parameter Type Description

reference Reference string, literal stringor XPath expression

a literal string or reference to thetext that you want to apply thefunction to.

delimiter symbol or character special symbol or character thatmarks the beginning or end of aunit of data. For example, forwardslash (/).

Returns

String containing a formatted text in ltr (Left-To-Right) orientation.

Examples

The format2ltr function can be used in three ways:v XFDL computesv XPath expressionsv XForm binds

XFDL computes

In the following example, assume that capital letters indicate Left-To-Right text. Asyou can see, the text string in the compute shows day/year/month. This is thedirection that the Unicode Bidirectional Algorithm assumed that the text shouldtake when it encountered the string 19/MAY/2007. The Unicode BidirectionalAlgorithm parsed the 19 in a Left-To-Right direction, but switched to aRight-To-Left direction when it encountered the Right-To-Left text in MAY. TheRight-To-Left direction continued when it reached 2007, which can be rendered asboth Left-To-Right and Right-To-Left text and therefore gives no strong directionalcues to the Unicode Bidirectional Algorithm. As a result, the Unicode BidirectionalAlgorithm places the year before the month.

With format2ltr, we can override the Unicode Bidirectional Algorithm so that thedate is displayed in a Left-To-Right order (19/MAY/2007) by insertingLeft-To-Right Unicode control characters before the / delimiter.<value compute="format2ltr('19/2007/MAY', '/' ) "></value>

format2ltr(reference, delimiter)

XFDL Version 7.7 539

Page 546: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XPath expressions

The following example uses an XPath expression to call the format2ltr function:<xforms:setvalue ref="instance('main')/field_contents"

value="xfdl:format2ltr("19/2007/MAY",'/')"></xforms:setvalue>

The following example uses an XPath expression in a bind to call the format2ltrfunction:<xforms:bind nodeset="instance('data')/strings/bidiString"calculate="xfdl:format2ltr("19/2007/MAY",'/')">

540 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 547: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

format2rtlEnsures that the text before each delimiter is displayed in a right-to-left direction.This function is needed when the order of your text does not match the orderspecified by the Unicode Bidirectional Algorithm (UBA).

This function checks the string to see if direction control characters already exist inthe string to avoid inserting duplicated controls.

This function can be written as an XFDL compute or XPath expression.

Syntax

Table 269. 2 format2rtl parameters

Parameter Type Description

reference Reference string, literal stringor XPath expression

a literal string or reference to thetext that you want to apply thefunction to.

delimiter Symbol or character special symbol or character thatmarks the beginning or end of aunit of data. For example, forwardslash (/).

Results

String containing a formatted text in rtl (Right-To-Left) orientation.

Examples

The format2rtl function can be used in three ways:v XFDL computesv XPath expressionsv XForm binds

XFDL computes

In the following example, assume that capital letters indicate Left -To-Right text. Asyou can see, the text string in the compute shows month/year/day. This is thedirection that the Unicode Bidirectional Algorithm assumed that the text shouldtake when it encountered the string 2007/MAY/19. The Unicode BidirectionalAlgorithm parsed the 19 in a Left-To-Right direction, but switched to Left -To-Righttext direction when it encountered the Left -To-Right text in MAY. The Left-To-Right direction continued when it reached 2007, which can be rendered as bothLeft-To-Right and Right-To-Left text and therefore gives no strong directional cuesto the Unicode Bidirectional Algorithm. As a result, the Unicode BidirectionalAlgorithm places the year after the month.

With format2rtl, we can override the Unicode Bidirectional Algorithm so that thedate is displayed in a Right-To-Left order (2007/MAY/19) by insertingRight-To-Left Unicode control characters before the / delimiter.<value compute="format2rtl('MAY/2007/19','/' )"></value>

format2rtl(reference, delimiter)

XFDL Version 7.7 541

Page 548: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XPath expressions

The following example uses an XPath expressions to call the format2rtl function:<xforms:setvalue ref="instance('main')/field_contents"value="xfdl: format2rtl ("MAY/2007/19",'/')"></xforms:setvalue>

The following example uses an XPath expression in a bind to call the format2rtlfunction:<xforms:bind nodeset="instance('data')/strings/bidiString"

calculate="xfdl: format2rtl ("MAY/2007/19",'/')"></xforms:bind>

542 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 549: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

applysymmetricswappingEnsures that symmetric characters, such as parentheses or greater than and lessthan signs, are swapped when displayed in the Right-to-Left orientation. In otherwords, this function “mirrors” symmetric characters, replacing the left characterwith the right character, and vice versa.

Examples of symmetric characters:v { }v [ ]v < >v ( )

This function can be used as part of an XFDL compute, an XForms bind or anXPath expression.

Syntax

Table 270. apply symmetrical swapping parameters

Parameter Type Description

reference Reference string, literal stringor XPath expression

a literal string or reference to thetext that you want to apply thefunction to.

Results

String containing Right-To-Left text with swapped symmetrical characters.

Examples

The applysymmetricswapping function can be used in three ways:v XFDL computesv XPath expressionsv XForm binds

XFDL computes

The following example assumes the capitalized text used in this compute isbidirectional. As a result, the data displayed is ABCD ] EFG [ HI. Notice, thebrackets were mirrored.<value compute=" applysymmetricswapping (' ABCD [ EFG ] HI')"></value>

XPath expressions

The following example uses an XPath expression to call theapplysymmetricswapping function.<xforms:setvalue ref="instance('main')/field_contents"

value="xfdl: applysymmetricswapping('ABCD [ EFG ] HI')"></xforms:setvalue>

applysymmetricswapping(reference)

XFDL Version 7.7 543

Page 550: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XForms binds

The following example uses an XForms bind to call the applysymmetricswappingfunction.<xforms:bind nodeset="instance('data')/strings/bidiString"

calculate="xfdl: applysymmetricswapping ('ABCD [ EFG ] HI')"/>

Details on XForms function callsXFDL supports the use of XForms functions. These functions can be included inXPath expressions, and are only available when dealing with XForms-relatedprocesses.

XPathXForms uses XPath to address data nodes in binds, to express constraints, and tospecify calculations. Simple XPath expressions resemble file system and directorypaths in appearance. However, instead of moving through files and folders, XPathexpressions move through nodes in the XForms data model. For more informationabout XPath, see http://www.w3.org/TR/xpath.

Return typesXForms functions can return the following data types:v Boolean – a true or false value.v string – a group of alphanumeric characters.v number – a double precision number.v nodeset – a set of nodes in the data model. The set may be empty, or it may

contain or more nodes.

Empty return valuesSome functions will return the string ″NaN″ when they are unable to compute areal return value. NaN means ″not a number″, and generally indicates an emptynodeset.

544 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 551: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Boolean functionsThe following functions use Boolean conditions.

boolean-from-string

Converts a string to a Boolean value. This is useful for converting string content,such as content from an instance data node, to a Boolean result, which is requiredto set some of the properties on data elements, such as relevant and read-only.

Syntax

Table 271. boolean-from-string parameters

Parameter Type Description

string string the string to convert. The strings″true″ and ″1″ are converted totrue. All other strings areconverted to false.

Returns

A Boolean value.

Example

The following data model contains two instances. The first instance, called ″po″,contains the beginning of a table that will track the items that are being ordered.The second instance, called ″temps″, contains a temporary variable that trackswhether the form is being submitted.

<xforms:model functions="current"><xforms:instance id="po" xmlns="">

<po><order>

<row><product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order><subtotal>0</subtotal><tax>0</tax><total>0</total>

</po></xforms:instance><xforms:instance id="temps" xmlns="">

<root><submitting>false</submitting>

</root></xforms:instance>

The following bind determines whether each row in the table is relevant:<xforms:bind nodeset="order/row[not(last())]"

relevant="boolean-from-string( if( qty > 0 orinstance('temps')/submitting='false', 'true', 'false'))"/>

boolean-from-string(string)

XFDL Version 7.7 545

Page 552: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This bind uses an if, instance, and boolean-from-string function to createfollowing logic: if the row has a quantity greater than zero, or the form is notbeing submitted (as tracked by the submitting element in the temps instance), thenreturn ″true″; otherwise, return ″false″. Since the if function returns these values asstrings, the boolean-from-string function is used to convert the result to a Booleanvalue, which then sets the relevance of the nodeset.

546 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 553: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

if

Creates a basic if/then/else decision point in an XPath expression.

Syntax

Table 272. if parameters

Parameter Type Description

condition Boolean an XPath expression that isevaluated as true or false.

then String a value that is returned if thecondition is true.

else String a value that is returned if thecondition is false.

Returns

Returns the then parameter if the condition is true, or the else parameter if thecondition is false.

Example

The following data model contains two instances. The first instance, called ″po″,contains the beginning of a table that will track the items that are being ordered.The second instance, called ″temps″, contains a temporary variable that trackswhether the form is being submitted.

<xforms:model functions="current"><xforms:instance id="po" xmlns="">

<po><order>

<row><product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order><subtotal>0</subtotal><tax>0</tax><total>0</total>

</po></xforms:instance><xforms:instance id="temps" xmlns="">

<root><submitting>false</submitting>

</root></xforms:instance>

The following bind determines whether each row in the table is relevant:<xforms:bind nodeset="order/row[not(last())]"

relevant="boolean-from-string( if( qty > 0 orinstance('temps')/submitting='false', 'true', 'false'))"/>

if(condition, then, else)

XFDL Version 7.7 547

Page 554: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

This bind uses an if, instance, and boolean-from-string function to createfollowing logic: if the row has a quantity greater than zero, or the form is notbeing submitted (as tracked by the submitting element in the temps instance), thenreturn ″true″; otherwise, return ″false″. Since the if function returns these values asstrings, the boolean-from-string function is used to convert the result to a Booleanvalue, which then sets the relevance of the nodeset.

548 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 555: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Number functionsThe following functions deal with numbers.

avgAverages the values for a set of nodes. The strings values of the nodes areconverted to numbers, added together, and then divided by the number of nodes.

Syntax

Table 273. average parameters

Parameter Type Description

nodeset XPath An XPath reference to a set ofnodes.

Returns

A number representing the average, or NaN if any node is the nodeset is not anumber or the nodeset is empty.

Example

The following model contains the beginnings of a table that tracks test scores forstudents:

<xforms:model><xforms:instance xmlns="">

<root><students>

<row><name/><studentNumber/><score/>

</row></students><lowScore/><highScore/><averageScore/>

</root></xforms:instance>

</xforms:model>

The following bind uses the avg function to populate the <averageScore> element:<xforms:bind nodeset="averageScore"

calculate="avg(../students/row/score)"/>

avg(nodeset)

XFDL Version 7.7 549

Page 556: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

minDetermines the minimum value from a set of nodes. The string value of each nodeis converted to a number, then the minimum value is determined.

Syntax

Table 274. minparameter

Parameter Type Description

nodeset XPath An XPath reference to a set ofnodes.

Returns

A number representing the minimum value, or NaN if the nodeset was empty orone of the nodes in the set evaluated to NaN.

Example

The following model contains the beginnings of a table that tracks test scores forstudents:

<xforms:model><xforms:instance xmlns="">

<root><students>

<row><name/><studentNumber/><score/>

</row></students><lowScore/><highScore/><averageScore/>

</root></xforms:instance>

</xforms:model>

The following bind uses the min function to populate the <lowScore> element:<xforms:bind nodeset="lowScore"

calculate="min(../students/row/score)"/>

min(nodeset)

550 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 557: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

maxDetermines the maximum value from a set of nodes. The string value of each nodeis converted to a number, then the maximum value is determined.

Syntax

Table 275. max parameter

Parameter Type Description

nodeset XPath An XPath reference to a set ofnodes.

Returns

A number representing the maximum value, or NaN if the nodeset was empty orone of the nodes in the set evaluated to NaN.

Example

The following model contains the beginnings of a table that tracks test scores forstudents:

<xforms:model><xforms:instance xmlns="">

<root><students>

<row><name/><studentNumber/><score/>

</row></students><lowScore/><highScore/><averageScore/>

</root></xforms:instance>

</xforms:model>

The following bind uses the max function to populate the <highScore> element:<xforms:bind nodeset="highScore"

calculate="max(../students/row/score)/>

max(nodeset)

XFDL Version 7.7 551

Page 558: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

count-non-emptyDetermines the number of non-empty nodes in a nodeset. A node is considered tobe non-empty if it can be converted into a string with a length greater than zero.

Syntax

Table 276. count-non-empty parameter

Parameter Type Description

nodeset XPath An XPath reference to a set ofnodes.

Returns

A number representing the number of non-empty nodes in the set.

Example

The following model contains the beginnings of a table that tracks test scores forstudents:

<xforms:model><xforms:instance xmlns="">

<root><students>

<row><name/><studentNumber/><score/>

</row></students><lowScore/><highScore/><averageScore/><testsMarked/>

</root></xforms:instance>

</xforms:model>

The following bind uses the count-non-empty function to determine how manystudents have scores, then puts that value in the <testsMarked> element:

<xforms:bind nodeset="testsMarked"calculate="count-non-empty(../students/row/score)"/>

count-non-empty(nodeset)

552 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 559: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

indexDetermines which row of a repeat currently has the focus. Repeats are indexedwith a one-based count. For example, the first row is row 1, the second is row 2,and so on.

Syntax

Table 277. index parameter

Parameter Type Description

repeatID XPath An XPath reference to the idattribute of an xforms:repeatoption.

Returns

A number indicating which row has the focus.

Example

The following button adds a row to a table of students and test scores. When thebutton is clicked, the xforms:insert action creates a new row within the table. Thisinsert action uses the index function to determine which row in the table currentlyhas the focus, and then places the new row after the row with the focus.

<button sid="addRow"><xforms:trigger>

<xforms:label>Add Row</xforms:label><xforms:action ev:event="DOMActivate">

<xforms:insert nodeset="students/row"at="index('studentTable')" position="after"/>

<xforms:setfocus control="studentTable"/></xforms:action>

</xforms:trigger></button>

index(repeatID)

XFDL Version 7.7 553

Page 560: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

randomGenerates a random number between 0.0 and 1.0. For example, random() couldreturn 0.14159265358979.

Syntax

Table 278. random parameter

Parameter Type Description

condition Boolean Optional. An XPath expressionthat is evaluated as true or false.

If true, random number generatoris first seeded with a source ofrandomness before generating therandom value.

Returns

A random number between 0.0 and 1.0.

Example

The following example shows how to generate a random number in FIELD1.<xformsmodels>

<xforms:model><xforms:instance id="INSTANCE" xmlns="">

<document><FIELD1></FIELD1>

</document></xforms:instance>

<xforms:bind calculate="random(true) * seconds-from-dateTime(now())"nodeset="randomNumber"></xforms:bind>

</xforms:model></xformsmodels>...<field sid="FIELD1">

<xforms:input ref="instance('INSTANCE')/FIELD1"><xforms:label></xforms:label>

</xforms:input>...</field>

Usage Details1. Default: False

decimal-stringRounds a number based on the decimal precision.

Note: The decimal-string function must be declared in the functions attribute ofthe xforms:model element.

random(condition)

554 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 561: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Syntax

Table 279. decimal string parameter

Parameter Type Description

value string The numerical expression that willbe rounded based on the precisionspecified by the precisionparameter.

precision number Controls the representation detailssuch as the number of fractionaldigits in it

Returns

Returns a decimal based on the precision specified in the precision parameter. Ifthe precision value = 0, an integer is returned. If the result of the conversion isNaN, negative infinity, positive infinity, or outside the range -14 to +14, thendecimal-string() returns an empty string.

Example

In the following example, the monthly interest rate is calculated on the principaland is then rounded to the nearest cent:

<xformsmodels><xforms:model functions="decimal-string" id="MODEL">

<xforms:instance xmlns="" id="INSTANCE2"><data>...</data>

</xforms:instance>...<xforms:bind calculate="decimal-string(../principal *

(../rate div 100 div 12), -2)"nodeset="instance('INSTANCE1')/monthly_payment">

</xforms:bind>...

Table 280. Returned values based on various decimal-string values.

Example Returns

decimal-string(100.33000000002, 2) 100.33

decimal-string(-100.33000000002, 2) -100.33

decimal-string(100.33000000002, 4) 100.33

decimal-string(100.33000000002, -12) 100.330000000020

decimal-string('100.334999999998', 2) 100.33

decimal-string(-100.335000000000, 2) -100.34

decimal-string(-100.345000000000, 2) -100.34

decimal-string(.33000000002, -3) 0.330

decimal-string(100.000000002, 8) 100.0

decimal-string(100.000000002, 0) 100

decimal-string(value,precision)

XFDL Version 7.7 555

Page 562: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Usage Details1. If precision is a negative number, then the result of the rounding procedure is

padded with trailing zeros, if necessary, to exactly n fractional digits.

556 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 563: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

String functionsThe following functions deal with strings.

property

Queries the forms viewing engine to determine one of the following:v XForms version – Which version of XForms is being used.v XForms conformance – Which aspects of XForms are supported.

Syntax

Table 281. property parameter

Parameter Type Description

string string One of the following strings:

v version

v conformance-level

Returns

If querying the version, returns a string with the major and minor version ofXForms. For example, ″1.0″.

If querying the conformance, XFDL forms viewing applications return full. Otherapplications may return other values, depending on their support for XForms.

Example

The following model contains a <conformance> data element that is populated bya bind. This bind uses the property function to check the conformance level of theapplication processing the form, and records that level in the form.

<xforms:model><xforms:instance id="conformance" xmlns="">

<root><conformance/>

</root></xforms:instance><xforms:bind nodeset="instance('conformance')/conformance"

calculate="property('conformance-level')"/></xforms:model>

property(string)

XFDL Version 7.7 557

Page 564: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

compareCompares two strings and determines whether they have the same value.

Syntax

Table 282. fncompare parameter

Parameter Type Description

compareA string The first string that you want tocompare.

compareB string The second string that you wantto compare.

Returns

Returns 0 if the two strings match, 1 if the first string is greater than the second, or-1 if the second string is greater than the first. If either of the comparator strings isempty, then the return is empty.

For example:v Comparing the strings ″abc″ and ″abc″ returns 0.

Example

The following example shows how to compare the value of two elements todetermine whether they are the same.

<xformsmodels><xforms:model>

<xforms:instance id="INSTANCE" xmlns=""><document>

<totalOwed></totalOwed><totalPaid></totalPaid><result></result>

</document></xforms:instance>

<xforms:bind calculate="compare(../totalOwed, ../totalPaid)"nodeset="result"></xforms:bind>

</xforms:model></xformsmodels>...<field sid="TotalOwed">

<xforms:input ref="instance('INSTANCE')/totalOwed"><xforms:label>100</xforms:label>

</xforms:input>...</field><field sid="TotalPaid">

<xforms:input ref="instance('INSTANCE')/totalPaid"><xforms:label>50</xforms:label>

</xforms:input>...</field><field sid="Result">

<xforms:input ref="instance('INSTANCE')/result">

compare(compareA, compareB)

558 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 565: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<xforms:label></xforms:label></xforms:input>

...</field>

XFDL Version 7.7 559

Page 566: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

DateTime functionsThe following functions deal with dates and time.

nowGets the current date and time from the system clock on the local computer.

Syntax

Returns

A string representing the time in the following format: 2005-10-20T17:00:00Z.

Example

The following buttons submits a purchase order form. When the button is clicked,the actions are triggered in order. First, the xforms:setvalue action uses the nowfunction to record the time of submission. Then, the xforms:send action submitsthe form to the server.

<button sid="submitPO"><xforms:trigger>

<xforms:action ev:event="DOMActivate"><xforms:setvalue ref="timeStamp" value="now()"/><xforms:send submission="sendPO"/>

<xforms:label>Submit PO</xforms:label></xforms:trigger>

</button>

now()

560 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 567: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

days-from-dateDetermines how many days difference there is between 1970-01-01 and theprovided date.

For example, days-from-date("2002-01-01") returns 11688, anddays-from-date("1969-12-31") returns -1

Syntax

Table 283. days-from-date parameter

Parameter Type Description

date xsd:date A date in one of the formatsspecified below.

Formats

The date may be written in any of the following formats:

date The date written in the following format:

yyyy-mm-dd

Where:v yyyy is a four digit year, such as 2005.v mm is a two digit month, such as 02 or 10.v dd is a two digit day, such as 05 or 22.

Note that the date must include the dashes. For example, June 21, 2005would be written as:

2005-06-22

dateTimeThe date and time written in the following format:

yyyy-mm-ddThh:mm:ssZ

Where:v yyyy is a four digit year, such as 2005.v mm is a two digit month, such as 02 or 10.v dd is a two digit day, such as 05 or 22.v T is the time separator. You must include this.v hh is a two digit hour (24 hour clock), such as 02 or 18.v mm is a two digit minute, such as 03 or 55.v ss is at least a two digit second, such as 08 or 43. The seconds value may

also include a decimal fraction.v Z is the timezone indicator. For no timezone adjustment, simply append

Z to the string. To make a timezone adjustment, replace the Z with thefollowing expression:(+ | -) hh:mm

Where:

days-from-date(date)

XFDL Version 7.7 561

Page 568: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

– hh is a two digit hour (24 hour clock).– mm is a two digit minute.

Note that the dateTime must include the dashes and colons. For example,June 21, 2005 at 4:55 PM Central Daylight Savings Time would be writtenas:

2005-06-21T16:55:00-05:00

Returns

A number representing the number of days, or NaN if the input does not matchthe allowed formats.

Example

The following model might appear in an overdue notice for an online movie rental.The model contains a due date as well as a ″days late″ entry. The number of daysthe rental is late is calculated by a bind that performs the following processing:convert today’s date (retrieved with the now function) to days, then convert thedue date to days, then subtract the due date from today’s date.

<xforms:model><xforms:instance xmlns="">

<root><dueDate/><daysLate/>

</root></xforms:instance><xforms:bind nodeset="daysLate"

calculate="days-from-date(now()) - days-from-date(../dueDate)"/></xforms:model>

562 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 569: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

days-to-dateDetermines the date based on the number of days that have passed since1970-01-01. For example, days-to-date(-1) returns 1969-12-31.

Syntax

Table 284. days-to-date parameter

Parameter Type Description

days number Any number. Positive numbersreturn dates after January 1, 1970.Negative numbers return datesbefore January 1, 1970. Fractionalnumbers are rounded up to thenearest whole number.

Returns

A date that corresponds to January 1, 1970 plus the input number or an emptystring if the input is NaN (not a number).

Example

The following model might appear on a payment due billing form. The modelcontains a “number of days before payment due” element, a due date element, anda placeholder for the sum of today’s date plus the “number of days”.

This model contains two calculations. The first determines the date on whichpayment is due, returned as the number of days, since January 1, 1971. The secondcalculation takes that number and turns it into the due date.<xforms:model>

<xforms:instance xmlns=""><root>

<dueNumber></dueNumber><numberDays>20</numberDays><dueDate></dueDate>

</root></xforms:instance>

<xforms:bind calculate="days-from-date(now()) +../numberDays" nodeset="dueNumber">

</xforms:bind><xforms:bind calculate="days-to-date(../dueNumber)" nodeset="dueDate"></xforms:bind>

</xforms:model>

days-to-date(days)

XFDL Version 7.7 563

Page 570: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

local-dateDetermines the local date in the user’s time zone. For example, on October 13,2006 local-date() would have returned 2006-10-13-08:00 (if the timezone is PST).

Syntax

Returns

A number representing the result of now() is converted to a local date based on theuser’s time zone. If no time zone information is available, then only the dateportion of the result of now() is returned. The timezone information is omitted.

Example

The following buttons submits a purchase order form. When the button is clicked,the actions are triggered in order. First, the xforms:setvalue action uses thelocal-date function to record the local date of submission. Then, the xforms:sendaction submits the form to the server.

<button sid="submitPO"><xforms:trigger>

<xforms:action ev:event="DOMActivate"><xforms:setvalue ref="timeStamp" value="local-date()"/><xforms:send submission="sendPO"/>

<xforms:label>Submit PO</xforms:label></xforms:trigger>

</button>

local-date()

564 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 571: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

local-dateTimeDetermines the local date and time in the user’s time zone. For example, onOctober 13, 2006 4:04 P.M. could return 2006-10-13T16:04:17-08:00 (if thetimezone is PST).

Syntax

Returns

A number representing the result of now() is converted to a local date and timebased on the users’ time zone. If no time zone information is available, then onlythe date and time portion of the result of now() is returned.

Example

The following buttons submits a purchase order form. When the button is clicked,the actions are triggered in order. First, the xforms:setvalue action uses thelocal-dateTime function to record the local date and time of submission. Then, thexforms:send action submits the form to the server.

<button sid="submitPO"><xforms:trigger>

<xforms:action ev:event="DOMActivate"><xforms:setvalue ref="timeStamp" value="local-dateTime()"/><xforms:send submission="sendPO"/>

<xforms:label>Submit PO</xforms:label></xforms:trigger>

</button>

local-dateTime()

XFDL Version 7.7 565

Page 572: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

seconds-from-dateTimeDetermines how many seconds difference there is between 1970-01-01 and theprovided date.

Syntax

Table 285. seconds-from-datetime parameter

Parameter Type Description

dateTime xsd:dateTime A date and time written in thefollowing format:

yyyy-mm-ddThh:mm:ssZ

Where:

v yyyy is a four digit year, suchas 2005.

v mm is a two digit month, suchas 02 or 10.

v dd is a two digit day, such as05 or 22.

v T is the time separator. Youmust include this.

v hh is a two digit hour (24 hourclock), such as 02 or 18.

v mm is a two digit minute, suchas 03 or 55.

v ss is at least a two digit second,such as 08 or 43. The secondsvalue may also include adecimal fraction.

v Z is the timezone indicator. Forno timezone adjustment, simplyappend Z to the string. To makea timezone adjustment, replacethe Z with the followingexpression:

(+ | -) hh:mm

Where:

– hh is a two digit hour (24hour clock).

– mm is a two digit minute.

Note that the dateTime mustinclude the dashes and colons. Forexample, June 21, 2005 at 4:55 PMCentral Daylight Savings Timewould be written as:

2005-06-21T16:55:00-05:00

seconds-from-dateTime(dateTime)

566 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 573: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Returns

A number representing the number of seconds, or NaN if the input does not matchthe allowed format.

Example

The following example shows an XForms model and a button item:<xforms:model>

<xforms:instance id="timeData" xmlns=""><root>

<timeOpened/><timeSubmitted/><elapsedTime/>

</root></xforms:instance><xforms:bind nodeset="elapsedTime"

calculate="(seconds-from-dateTime(../timeSubmitted) -seconds-from-dateTime(../timeOpened)) div 60"/>

<xforms:setvalue ev:event="xforms-ready"ref="instance('timeData')/timeOpened" value="now()"/>

</xforms:model><button sid="submit">

<xforms:trigger><xforms:action ev:event="DOMActivate">

<xforms:setvalue ref="instance('timeData')/timeSubmitted"value="now()"/>

<xforms:send submission="send"/></xforms:action><xforms:label>Submit</xforms:label>

</xforms:trigger></button>

The model contains data elements that record when the form is first opened, whenthe form is submitted, and the elapsed time between the two. When the XFormsmodel is first ready, an xforms:setvalue function is triggered in the model andrecords the time the form was opened. When the user clicks the submit button, anxforms:setvalue action is triggered in the button and records the time the form wassubmitted. The change in value also causes the xforms:bind to update, whichcalculates the elapsed time by converting both times into seconds, subtracting thetimeOpened from the timeSubmitted, and then dividing by 60 to convert the resultto minutes.

seconds-to-dateTimeDetermines the date based on the number of seconds that have passed since1970-01-01. For example, seconds-to-dateTime(0) returns 1970-01-01T00:00:00Z.

Syntax

seconds-to-dateTime(seconds)

XFDL Version 7.7 567

Page 574: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 286. seconds-to-datetime parameter

Parameter Type Description

seconds number Any number. Positive numbersreturn dates after January 1, 1970.Negative numbers return datesbefore January 1, 1970. Fractionalnumbers will be rounded to thenearest whole number.

Returns

A date, and time that corresponds to January 1, 1970 plus the input number, orempty string if the input number is NaN.

Example

The following example shows the results of adding startdate andnumberOfSeconds to display endDateTime<xforms:model><xforms:instance xmlns=""><root><startDate>2007-01-15T00:00:00Z</startDate><numberOfSeconds>400</numberOfSeconds><endDateTime></endDateTime></root></xforms:instance>

<xforms:bind calculate="seconds-to-dateTime(seconds-from-dateTime(/root/startDate)+/root/numberOfSeconds)" nodeset="/root/endDateTime"></xforms:bind>

</xforms:model>

Result for endDateTime will be 2007-01-15T00:06:40Z

568 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 575: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

seconds

Converts a duration to an equal number of seconds. Durations may include days,hours, minutes, and seconds.

Syntax

Table 287. seconds parameter

Parameter Type Description

duration xsd:duration a duration, written in the following format:

PnYnMnDTnHnMnS

where:

v P marks the string as a duration.

v nY gives the number of years.

v nM gives the number of months.

v nD gives the number of days.

v T separates the date from the time.

v nH gives the number of hours.

v nM gives the number of minutes.

v nS gives the number of seconds.

For example, P1Y3M3DT12H34M21S is: 1 year, 3months, 3 days, 12 hours, 34 minutes, and 21seconds.

If any of the values are zero, they may beomitted. For example, P120D is 120 days.Furthermore, the year and month values areignored by this function.

The T designator may only be absent if there areno time elements. The P designator must alwaysbe present.

The number of seconds may include a decimalfraction.

Returns

A number (possibly fractional) representing the number of seconds, or NaN if theinput does not match the allowed format.

Example

The following model converts days, hours and minutes into a total number ofminutes. The model contains data elements for days, hours, and minutes. The usertypes these values into fields that are linked to the data elements. When data isentered, the xforms:bind uses the concat function to turn the data into a formatted

seconds(duration)

XFDL Version 7.7 569

Page 576: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

duration string, converts that string to seconds using the seconds function, and thendivides by sixty to convert the time to minutes. This value is then stored in the<totalTime> element.

<xforms:model><xforms:instance xmlns="">

<root><days/><hours/><minutes/><totalTime/>

</root></xforms:instance><xforms:bind nodeset="totalTime"

calculate="seconds(concat('P', ../days, 'DT', ../hours, 'H',../minutes, 'M')) div 60"/>

</xforms:model>

570 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 577: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

months

Converts a duration to an equal number of months. Durations may include daysand months.

Syntax

Table 288. months parameter

Parameter Type Description

duration xsd:duration a duration, written in thefollowing format:

PnYnMnDTnHnMnS

where:

v P marks the string as aduration.

v nY gives the number of years.

v nM gives the number ofmonths.

v nD gives the number of days.

v T separates the date from thetime.

v nH gives the number of hours.

v nM gives the number ofminutes.

v nS gives the number of seconds.

For example,P1Y3M3DT12H34M21S is: 1 year,3 months, 3 days, 12 hours, 34minutes, and 21 seconds.

If any of the values are zero, theymay be omitted. For example,P11M is 11 months. Furthermore,only the year and month valuesare used by this function. Allother values are ignored.

Returns

A whole number representing the number of months, or NaN if the input does notmatch the allowed format.

Example

The following model converts years and months into a total number of months.The model contains data elements for years and months. The user types thesevalues into fields that are linked to the data elements. When data is entered, the

months(duration)

XFDL Version 7.7 571

Page 578: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

xforms:bind uses the concat function to turn the data into a formatted durationstring, converts that string to months using the months function. This value is thenstored in the <totalTime> element.

<xforms:model><xforms:instance xmlns="">

<root><years/><months/><totalTime/>

</root></xforms:instance><xforms:bind nodeset="totalTime"

calculate="months(concat('P', ../years, 'Y', ../months, 'M'))"/></xforms:model>

572 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 579: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Node-set functionsThe following functions set the node.

instanceLocates a particular data instance within a given model

Syntax

Table 289. instance parameter

Parameter Type Description

instanceID string The value of the id attribute forthe instance.

Returns

The instance nodeset.

Example

The following data model contains two instances. The first instance, called ″po″,contains the beginning of a table that will track the items that are being ordered.The second instance, called ″temps″, contains a temporary variable that trackswhether the form is being submitted.

<xforms:model functions="current"><xforms:instance id="po" xmlns="">

<po><order>

<row><product/><unitCost>0</unitCost><qty></qty><lineTotal></lineTotal>

</row></order><subtotal>0</subtotal><tax>0</tax><total>0</total>

</po></xforms:instance><xforms:instance id="temps" xmlns="">

<root><submitting>false</submitting>

</root></xforms:instance>

The following bind determines whether each row in the table is relevant:<xforms:bind nodeset="order/row[not(last())]"

relevant="boolean-from-string( if( qty > 0 orinstance('temps')/submitting='false', 'true', 'false'))"/>

This bind uses an if, instance, and boolen-from-string function to create followinglogic: if the row has a quantity greater than zero, or the form is being submitted(as tracked by the submitting element in the temps instance), then return ″true″;otherwise, return ″false″. Since the if function returns these values as strings, the

instance(instanceID)

XFDL Version 7.7 573

Page 580: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

boolean-from-string function is used to convert the result to a Boolean value,which then sets the relevance of the nodeset.

Usage notes1. An id attribute is mandatory if you want to use xforms:instance with the

Forms Services Platform.

574 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 581: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Utility functionsThe following functions are utility functions:

chooseGiven two nodesets, this function returns one of them (that is, it chooses betweenthem) based on the results of an XPath expression.

Syntax

Table 290. choose parameter

Parameter Type Description

boolean XPath An XPath expression that resultsin a Boolean value. On true,nodeset1 is used; on false,nodeset2 is used.

nodeset1 XPath An XPath expression thatevaluates to a nodeset.

nodeset2 XPath An XPath expression thatevaluates to a nodeset.

Returns

A nodeset.

Example

The following popup presents a list of either states or provinces, depending onwhether the user indicates they are from the US or Canada. In this case, a full listof the states and provinces are included in the data model. The user selects US orCanada from a radiogroup. The popup then uses the choose function to select theright group of nodes from the data model: if the user selected the US (the US dataelement is true), the popup uses states; if not, the popup uses provinces.

<popup sid="stateProvince"><xforms:select1 ref="stateProvince" appearance="full">

<xforms:label>Select your State/Province:</xforms:label><xforms:itemset nodeset="choose(US='true',states/state,provinces/

province)"><xforms:label ref="@show"></xforms:label><xforms:value ref="."></xforms:value>

</xforms:itemset></xforms:select1>

</popup>

choose(boolean, nodeset1, nodeset2)

XFDL Version 7.7 575

Page 582: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

powerCalculates the value of xn, where you supply x and n.

Syntax

Table 291. power parameter

Parameter Type Description

xvalue number The base number. This is raised tothe power of n.

nvalue number The exponent. This is applied thex value.

Returns

A number representing the result, or NaN if the result is not a real number.

Example

The following model uses the power function to apply the Pythagorean theorem tothe sides of a triangle. The user enters sides a and b into fields that are linked tothe <a> and <b> data elements. Side c is then calculated by the xforms:bind,which uses the power function to get the square root of a2 + b2. This value is thenstored in the <c> data element.

<xforms:model functions="power"><xforms:instance xmlns="">

<root><a/><b/><c/>

</root></xforms:instance><xforms:bind nodeset="c"

calculate="power(../a * ../a + ../b * ../b, 0.5)"/></xforms:model>

Usage Details1. To use the power function, you must include the power function in the

functions attribute of the <xforms:model> tag.

power(xvalue, nvalue)

576 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 583: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

currentReturns the nodeset that is currently providing the context for the XPathexpression. This is useful when you need to reset the context in the middle of anXPath expression.

Syntax

Returns

Returns the context nodeset.

Example

The following model contains two data instances are used to create a form thatconverts currencies. The first instance contains the user-supplied information,including the amount and the currency they want to convert to. The secondinstance contains information about exchange rates.

<xforms:model functions="current"><xforms:instance xmlns="">

<converter><amount>100</amount><currency>jpy</currency><convertedAmount></convertedAmount>

</converter></xforms:instance><xforms:instance xmlns="" id="convTable">

<convTable date="20040212" currency="cdn"><rate currency="eur">0.59376</rate><rate currency="mxn">8.37597</rate><rate currency="jpy">80.23451</rate><rate currency="usd">0.76138</rate>

</convTable></xforms:instance>

<xforms:model>

The following bind populates the <convertedAmount> element based on the dataprovided by the user and the exchange rate:

<bind nodeset="convertedAmount" calculate="../amount *instance('convTable')/rate[@currency=current()/../currency]"/>

The bind multiplies the <amount> by the proper conversion rate. The context nodefor this bind is established by the nodeset attribute as the <convertedAmount>element in the first instance. This means that all XPath is evaluated relative to thisnode. However, to determine the conversion rate we must refer to the secondinstance. To do this, we use the instance function to retrieve the second instance,and then check the <rate> elements in that instance.

Next, we find the correct rate by do a string comparison between the currencyattribute of each <rate> element and the contents of the <currency> element in thefirst instance. However, the <currency> element is in the first instance, and wehave already changed our context to the second instance by using the instancefunction. So, to refer to the <currency> element in the first instance we must usethe current function, as shown:

current()/../currency

current()

XFDL Version 7.7 577

Page 584: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using the current function resets our context to the <convertedAmount> node,which was established as our context node by the nodeset attribute on the bind. Sothis expression evaluates to:

convertedAmount/../currency

This retrieves the contents of the currency node in the first data element. Thisvalue is then compared to the currency attribute on each <rate> element until thecorrect <rate> element is located.

Usage Details1. To use the current function, you must include the current function in the

functions attribute of the <xforms:model> tag.

Signature BasicsSignatures are applied to forms as a security measure for both the provider andthe user of the form. This topic contains introductory information and descriptionsof the fields used to create signature buttons.

A typical signature button is created using the following options:<button sid="BUTTON1">

<type><value><format><size><signformat><signature>

</button>

These options define the characteristics of the signature button in the followingways:v type — Setting the type option to signature indicates that this is a signature

button.v value — The value option sets the text that the button displays. In general, you

will display an instruction, such as ″Click here to sign″, or the signer’s identity(typically the signer’s name and e-mail address).

v format — Use format to make the signature mandatory, so that the user mustsign the button before submitting the form.

v size — Use size to set the size of the button. We recommend that you setsignature buttons to be at least 40 characters wide. This ensures that there isroom to display the signer’s name and e-mail address on the button.

v signformat — Use signformat to set which type of signature you want thebutton to create, such as Netscape, Microsoft, ClickWrap, etc.,

v signature — The signature option sets the name of the signature item that willbe created when the form is signed.

In addition to the options listed above, signature buttons also use a number offilters that determine which portions of the form are signed. These filters arecreated by adding a combination of filtering options to the button.

Signing a FormThis page describes the signer option and signature item which are automaticallycreated when a user clicks the signature button.

578 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 585: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

When a user clicks a signature button, the Viewer automatically creates thefollowing elements in the form:v A signer option is added to the signature button. This option contains the

signer’s name and e-mail address. However, the value assigned to this optiondepends on the signature engine that was used to sign the form.

v A signature item is created on the same page as the signature button. This itemis given the name indicated in the button’s signature option, and is used to storethe details of the signature.

While you do not need to create the signature item yourself, the following codeshows the options typically used in a signature item:

<signature sid="SIGNATURE1"><layoutinfo><signformat><signature><fullname><mimedata>

</signature>

The signature item will also include any of the filtering options used in thesignature button. See also making signatures mandatory for information onassigning values to unsigned buttons.

What the user seesThis section shows a pictorial description of what an end-user sees when a digitalsignature is required on a form.

To sign a form, users click the signature button. Typically, signature buttons arerecognized by the text they display, or a label near the button. They also tend to belarger than the text, since they also have to display the signer’s name once they aresigned.

Click to signClick to sign

When users click the signature button, the Digital Signature Viewer opens. TheDigital Signature Viewer allows users to sign forms, verify or delete existingsignatures, and view the details of what parts of the form were signed.

No SignatureNo Signature

Digital Signature VDigital Signature Vieweriewer

OKOK SignSign AdvancedAdvanced DeleteDelete

Users click Sign to sign the form. If they have more than one certificate installedon their computer, a dialog box appears, displaying all of the available signaturesand allowing them to choose one. Once users have selected a certificate, the formis signed and the Digital Signature Viewer displays the details of the signature.

XFDL Version 7.7 579

Page 586: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Signature is VSignature is Validalid

Digital Signature VDigital Signature Vieweriewer

OKOK SignSign AdvancedAdvanced DeleteDelete

Signer: (cs) Deanna Drschiwiski, [email protected]: (cs) Deanna Drschiwiski, [email protected]: Microsoft Base Cryptographic Provider v1.0CSP: Microsoft Base Cryptographic Provider v1.0HashHash Algorithm: shalAlgorithm: shal

Certificate Information:Certificate Information:

PureEdge Solutions Inc., Public Level 1 Service OfPureEdge Solutions Inc., Public Level 1 Service Offering CAfering CA““wwwwww.verisign.com/repository/CPS Incorp. by Ref, LIAB.L.verisign.com/repository/CPS Incorp. by Ref, LIAB.LTD(c)96TD(c)96””,,Customer - CustomerService, Customer Info2 - PureEdge, (cs) DeannaCustomer - CustomerService, Customer Info2 - PureEdge, (cs) DeannaDrschiwiski, [email protected], [email protected]

PureEdge Solutions Inc., VPureEdge Solutions Inc., VerSignerSign TTrust Network,rust Network, TTerms of use aterms of use athttps://wwwhttps://www.verisign.com/RP.verisign.com/RPAA (c)00, Class 1 CA(c)00, Class 1 CA - OnSite Individual- OnSite IndividualSubscriberSubscriber, PureEdge Solutions Inc., Level 1 Public CA, PureEdge Solutions Inc., Level 1 Public CA

Users then click OK to return to the form. In the form, the signature buttonchanges to reflect the new signature. Typically, it displays the name and e-mailaddress of the signer (although this depends on the type of signature engine used).

(cs) Deanna Drschiwiski, [email protected](cs) Deanna Drschiwiski, [email protected]

Once a form is signed, the Viewer prevents users from changing any of the signedinformation. Furthermore, when the user mouses over a signed item in a form,hover help appears indicating that the item has been signed and cannot be altered.

Lease TLease Termination Dateermination Date

01/17/201001/17/2010

This item is digitally signed and cannot be altered.This item is digitally signed and cannot be altered.

Setting the text that the button displaysThis topic describes how to set the text displayed by a signature button, both priorto being clicked and after being clicked by the user. A compute can also be used toset the text displayed by a signature button.

Signature buttons switch between two states: unsigned and signed. When asignature button is unsigned, it is generally good practice to have the buttondisplay instructions, such as ″Click here to sign″. When a signature button issigned, it is generally a good practice to show the identity of the person whosigned it.

Since buttons display the text in their value option, you must set the value optionappropriately, depending on whether the button is unsigned or signed. To do this,you must use a compute.

The compute for this relies on the button’s signer option. The signer option iscreated by the Viewer when the button is signed. This means that there is nosigner option until the user clicks the button to sign the form.

With this in mind, you can create a simple test to set the value of the button. If thesigner option has no value (that is, if it does not exist), then there is no signatureand the button should read ″Click here to sign″. If the signer option has a value,

580 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 587: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

then there is a signature and the button should show the identity of the signer.Since the signer option stores the signer’s identity, the button’s value can bet set toequal the signer option.

More formally, you might express this logic as: if the signer option is empty, thenset the button’s value to ″Click here to sign″; otherwise, set the button’s value toequal the signer option.

In XFDL, you would write this as follows:<button sid="BUTTON1">

<value compute="signer == '' ? 'Click to sign' : signer"></value></button>

Making signatures mandatoryYou can make a signature mandatory on a form so that users cannot submitunsigned forms.

Most signatures are required. That is, most documents that offer a place to signalso require a signature before they can be accepted or processed.

Similarly, you may want to make your signature buttons mandatory. When youmake the signature button mandatory, the Viewer will prevent the user fromsubmitting the form until they have signed it. This ensures that you do not receiveunsigned forms.

You can use the format option to make signatures mandatory. In this case, theformat option should contains two elements:v datatype — Allows you to set the data type to string. This means that the value

of the button (the text that is displayed by the button) will be a string. Forexample:

<datatype>string</datatype>

v constraints — Allows you to place constraints on items, such as templates,lengths, and ranges. You can also use constraints to make the button mandatory.The format of constraints is:

<constraints><settingname1>setting</settingname1>

...<settingnamen>setting</settingnamen>

</constraints>

In this case, you only want to ensure that the signature button is mandatory, sothat the user must sign the button before they can submit the form. Therefore, youmust add the mandatory element. The format of mandatory is:

<mandatory>on|off</mandatory>

The mandatory element must be contained inside the constraints element, asshown:

<constraints><mandatory>on</mandatory>

</constraints>

For example, the format option would be written as:<button sid="BUTTON1">

<format><datatype>string</datatype><constraints>

XFDL Version 7.7 581

Page 588: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<mandatory>on</mandatory></constraints>

</format></button>

Once you have set the button to be mandatory, you may also need to change thevalue option of the button. This is because the mandatory feature is triggered offof the value option of the item. If the item has no value, the Viewer will force theuser to provide a value. If the item has a value, the Viewer will allow the user tocontinue.

Earlier, we discussed setting unsigned buttons to read ″Click here to sign″.However, if we assign a value to a button that is unsigned, the mandatory featurewill not work correctly. Thus, we must modify the logic that sets the button’s valueoption.

In this case, we want to use the following logic: if the signer option is empty, thenset the button’s value to empty; otherwise, set the button’s value to equal thesigner option.

For example, a button with the correct format and value options would be writtenas:

<button sid="BUTTON1"><format>

<datatype>string</datatype><constraints>

<mandatory>on</mandatory></constraints>

</format><value compute="signer == '' ? '' : signer"></value>

</button>

Note: This works for forms that have a single signature. If your form requiresmultiple signatures, there are more sophisticated methods that you must use tomake each signature become mandatory in turn.

Signing portions of formsForms are frequently signed by more than one person. This topic shows how it ispossible to have multiple signatures on a form; where a secondary signatureendorses the primary.

For example, many forms include a ″For Office Use Only″ section that requires asecond signature by one of the staff processing the form. In these cases, the officeworker must be able to enter more information in the unsigned portion of the formand then add their own signature.

The following diagrams show a form in which the first signature signs the body ofthe form, but not the second signature. The second signature then signs the bodyof the form, including the first signature. This allows the second signer to endorsethe original signature.

582 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 589: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Signature 1 Signature 2Signature 1 Signature 2

Signature 1 Signature 2Signature 1 Signature 2

Signature1 signs the filledSignature1 signs the filledsection of the form.section of the form.

Signature2 signs Signature 1Signature2 signs Signature 1and the filled section of the form.and the filled section of the form.

XFDL makes this possible by using signature filters. Signature filters specify whichparts of the form a particular signature will sign. This means that you can createone signature that sign only the first portion of the form, and then a secondsignature that signs the second portion of the form, or the entire form.

Note: If you do not use any signature filters, the entire form is signed by default.

About the signature filtersYou can use various keep and omit signature filters, as well as the filtering optionsthat use the keep and omit filters.

When creating filters, you must first decide what type of filtering you want to use:v keep — Keep filters let you specify the portions of the form you want to sign,

leaving the rest of the form unsigned.v omit — Omit filters let you specify the portions of the form you don’t want

signed, and ensures that the rest of the form is signed. Omit filters providesgreater security than keep filters, and should be used as a best practice.

Once you have decided what sort of filtering to use, you can create your filters bycombining the various filtering options. The filtering options are:v signitems option — Specifies the types of items that the signature will keep or

omit. For example, you might set the filter to omit all button items from thesignature.

v signoptions option — Specifies the types of options that the signature will keepor omit. For example, you might set the filter to omit all triggeritem optionsfrom the signature.

v signgroups option — Specifies one or more groups, as defined by the groupoption, that the signature will either keep or omit. This filters any radio buttonsor cells belonging to that group, but does not filter list, popup, or comboboxitems. For example, if you had a popup containing a cell for each State, youmight set the filter to omit the State group, which would omit all cells in thatgroup.

v signdatagroups option — Specifies one or more datagroups, as defined by thedatagroup option, that the signature will either keep or omit. This filters dataitems belonging to that datagroup, but does not filter any action, button, or cellitems. For example, if you had an enclosure button containing references, youmight set a filter to omit the References datagroup, which would omit all dataitems in that group.

XFDL Version 7.7 583

Page 590: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v signinstance option — Specifies the XForms instance data that the signature willeither keep or omit. For example, you might set the filter to omit any data thatis not sent to the server.

v signitemrefs option — Specifies individual items that the signature will keep oromit. For example, you might set the filter to omit BUTTON1 on PAGE1.

v signoptionrefs option — Specifies individual options that the signature willkeep or omit. For example, you might set the filter to omit BUTTON1.value onPAGE1.

v signnamespaces option — Specifies all of the form elements and attributes inthe indicated namespace that the signature will keep or omit. For example, youmight set the filter to omit the http://www.ibm.com/xmlns/prod/XFDL/Custom namespace.

v signpagerefs option — Specifies individual pages that the signature will keep oromit. For example, you might set the filter to omit PAGE1.

Each filtering option must be set to either keep or omit, and must include a list ofelements. For example, to omit all buttons and labels from a signature, you woulduse the following filter:

<button sid="BUTTON1"><signitems>

<filter>omit</filter><itemtype>button</itemtype><itemtype>label</itemtype>

</signitems></button>

Signatures can include any number filters. Each filter acts in an order ofprecedence. For example, the signitems filter is always processed first. Thesignoptions filter is then only applied to those items that remain.

For example, to omit all button and label items, as well as omitting all bgcoloroptions in the remaining items, you would use the following filter:

<button sid="BUTTON1"><signitems>

<filter>omit</filter><itemtype>button</itemtype><itemtype>label</itemtype>

</signitems><signoptions>

<filter>omit</filter><optiontype>bgcolor</optiontype>

</signitems></button>

For detailed description of the order of precedence, see ″Order of Precedence ofSignature Filters″.

Using Filters to Guarantee Form Security: Digital signatures protect the legalvalidity of signed forms. If you do not use best practices when creating yoursignature filters, you increase the chance that users will be able to repudiate signedforms based on a misunderstanding about what they’ve signed.

For example, a mortgage contract with a flawed signature filter could allowtampering to terms that are crucial to the contract. This alteration could confuse ormodify the terms of the contract, and result in a challenge to the validity of thedocument.

584 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 591: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Judicious use of omit and keep filters can guarantee form security. As a bestpractice, you should always use the omit filter to create signatures. If you use akeep filter, it should only be to sign another signature that is already using an omitfilter.

Using these practices will help prevent you from accidentally excluding items andoptions that should be signed, and will prevent malicious users from adding to theform’s contents without breaking the signature.

Order of precedence of signature filtersFilters have an order of precedence.

Please refer to “Order of precedence of filters” on page 638 for more informationon the order of precedence for filters.

Elements to exclude from signaturesCertain items should always be excluded from signatures to ensure that the Viewercan update properly.

There are certain form elements that you should always exclude from signatures.For example, when you click a submit button, the triggeritem option isautomatically set, recording the name of the button that triggered the submission.However, if a signature been applied to the triggeritem option, the Viewer will notbe able to update the option correctly.

In general, you should always exclude the following form elements from asignature:v the triggeritem optionv the coordinates optionv any portion of the form that subsequent users will changev subsequent signatures and signature buttonsv the signature item that stores the information for the signature you are creating

Setting the signature typeYou can use a number of different signatures engines.

XFDL supports a number of different signature engines. Each signature buttonmust be configured to use a specific engine when signing the form. The availableengines are:v Generic RSAv Authenticated Clickwrapv Microsoft CryptoAPIv Netscapev Entrustv Clickwrapv Silanisv XML Digital Signature (DSig)

You can specify the signature engine for your form by using the engine parameterin the signformat option. If you do not include a signformat option or do not setthe engine parameter, the form will use the Generic RSA engine by default.

XFDL Version 7.7 585

Page 592: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Note: XML DSig is not a signature engine itself, but a set of rules that determineswhat should be signed. An external signature engine, such as Generic RSA,Microsoft CryptoAPI orNetscape, is used to sign the form.

Using Generic RSA signaturesThe Generic RSA engine is the default signing engine, and is used if no otherengine type is specified in the signformat option. It automatically searches for anystandard RSA certificates on the user’s computer, which includes both MicrosoftCryptoAPI and Netscape certificates.

To create a signature button that uses the Generic RSA engine, set the followingparameters in the signformat option:v MIME type — The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case, Generic RSA.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

For example, the XFDL code for a button that uses the Generic RSA engine andprevents the signature from being deleted looks like this:

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="Generic RSA";delete="off"

</signformat></button>

586 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 593: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using Microsoft CryptoAPI signaturesThe CryptoAPI engine uses certificates located in the Microsoft certificate store toencrypt signature buttons for security purposes.

To create a signature button that uses the CryptoAPI engine, set the followingparameters in the signformat option:v MIME type — The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case, CryptoAPI.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

CryptoAPI also uses optional parameters to set specific CSP behavior. You shouldonly set these parameters if you need to use a specific CSP. In all other cases, youshould accept the default values. The parameters are:v csp — The cryptographic service provider used to create the signature. This

should only be set if you need to use a specific CSP. Otherwise, the signaturewill default to the Microsoft Base Cryptographic Service Provider.

v csptype — Identifies the type of CSP in use. This should only be set if you needto use a specific CSP. Otherwise, the signature will default to a full RSAimplementation (rsa_full).

For example, the generic XFDL code for a button using the CryptoAPI enginelooks like this:

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="CryptoAPI"

</signformat></button>

XFDL Version 7.7 587

Page 594: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using Netscape signaturesThe Netscape engine uses certificates located in the Netscape certificate store forsignature security. Although the Viewer does not support Netscape, the Firefoxbrowser also uses Netscape certificates.

To create a signature button that uses the Netscape engine, set the followingparameters in the signformat option:v MIME type — The MIME type that will be used to store the signature

information. You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case, Netscape.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

Netscape also uses an optional parameter to set the hash algorithm used togenerate the signature. This parameter is:v hashalg — The name of the hash algorithm to use when generating the

signature. Valid algorithms are sha1 and md5. The default algorithm is sha1.

For example, the generic XFDL code for a button using the Netscape engine lookslike this:

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="Netscape"

</signformat></button>

588 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 595: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Creating Clickwrap signaturesClickwrap signatures are electronic signatures that do not require digitalcertificates. While they still offer a measure of security due to an encryptionalgorithm, Clickwrap signatures are not security tools.

Instead, Clickwrap signatures offer a simple method of obtaining electronicevidence of user acceptance to an electronic agreement. The Clickwrap signingceremony authenticates users through a series of questions and answers, andrecords the signer’s consent. Clickwrap style agreements are frequently found inlicensing agreements and other online transactions.

To create a signature button that uses the Clickwrap engine, set the followingparameters in the signformat option:v MIME type – The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine – The name of the signing engine to use. In this case, ClickWrap.v delete – Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

For example, the XFDL code for a generic signature button using the Clickwrapengine looks like this:

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="ClickWrap"

</signformat></button>

This creates a minimal Clickwrap signing ceremony with default options, asshown:

Click-WClick-Wrap Signing Ceremonyrap Signing Ceremony

Click-WClick-Wrap Signing Ceremonyrap Signing Ceremony

Click theClick the Accept button to sign.Accept button to sign.

AcceptAccept NotNot AcceptAccept

You can add more features to the signing ceremony by using additionalparameters. For example, you may want to ask the signer some questions to helpconfirm their identity, and then have them type some text to confirm theiragreement. These additional parameters are discussed in the next section.

XFDL Version 7.7 589

Page 596: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Customizing your Clickwrap signing ceremony:

You can customize your Clickwrap signing ceremony by adding parameters to thesignformat option.

The following table lists the optional parameters, their use, and their defaultsettings.

Table 292. clickwrap parameters

Parameter Use Default Text

titleText Sets the title of the signingceremony. This is generallyused to describe the signingceremony, the company, orthe title of the agreement.

Click-Wrap Signing Ceremony

mainPrompt Typically used to explain thesigning ceremony to users.

None

mainText Normally contains the maintext of the agreement. Forexample, the text of alicensing agreement. You canadd as much text asnecessary to this parameter;the signing ceremonyautomatically displaysscrollbars if the text is longerthan the display field.

None

question1Text -question5Text

Allows you to ask from oneto five questions that helpestablish the identity of theuser.

None

answer1Text -answer5Text

These are the answers to thequestions asked byquestion1Text toquestion5Text. The Viewernormally adds theseparameters to the form asusers complete the fields.However, you canprepopulate the answers ifyou want.

None

echoPrompt Use this to instruct the userto echo the echoText.Generally, if you includeechoText, you will want thisto say something like, ″Pleasetype the following phrase toshow that you understandand agree to this contract.″

None

echoText This is the actual text thatthe user should echo, orre-type. Generally, thisshould say something like, ″Iunderstand the terms of thisagreement.″

None

590 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 597: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 292. clickwrap parameters (continued)

Parameter Use Default Text

buttonPrompt This is an instruction linethat appears above the acceptand reject buttons. The usermust click the accept buttonto sign, so generally theprompt should saysomething like, ″Click acceptto sign this document.″

Click the Accept button to sign.

acceptText Sets the text that the acceptbutton displays.

Accept

rejectText Sets the text that the rejectbutton display.

Not Accept

The following diagram illustrates a customized Clickwrap signing ceremony thatuses all of the optional parameters:

ThisThis ACME Solutions Inc. (ACME Solutions Inc. (””ACMEACME””) end-user license) end-user license

agreement (agreement (””EULAEULA””) accompanies the) accompanies the ACME software programACME software program

(the(the ““SoftwareSoftware””) and related explanatory materials (the) and related explanatory materials (the

““DocumentationDocumentation””) provided or made accessible to you.) provided or made accessible to you. ThisThis

EULAEULA is a legal agreement between you andis a legal agreement between you and ACME that setsACME that sets

ACME IncorporatedACME Incorporated

End User LicenseEnd User License AgreementAgreement

Full Name:Full Name:

Address:Address:

E-Mail address:E-Mail address:

WWork telephone number:ork telephone number:

Home telephone number:Home telephone number:

TTo indicate your acceptance of the terms of this agreement, please re-type the followingo indicate your acceptance of the terms of this agreement, please re-type the followingtext exactly as displayed.text exactly as displayed.

““I understand the terms of this agreement.I understand the terms of this agreement.””

Please clickPlease click ““II AcceptAccept”” to accept this agreement. Clickto accept this agreement. Click ““Do NotDo Not AcceptAccept”” to terminate.to terminate.

II AcceptAccept Do NotDo Not AcceptAccept

Click-WClick-Wrap Signing Ceremonyrap Signing Ceremony

The following is the XFDL code that created the above signing ceremony. Note thatthe values of some parameters, such as the mainText, have been shortened fromthe example above.

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="ClickWrap";titleText="ACME Incorporated";

XFDL Version 7.7 591

Page 598: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

mainPrompt="End User License Agreement";mainText="This ACME Solutions...";question1Text="Full name:";question2Text="Address:";question3Text="Email address:";question4Text="Work telephone number:";question5Text="Home telephone number:";echoPrompt="To indicate your acceptance...";echoText="I understand the terms of this agreement."

</signformat></button>

Using authenticated Clickwrap signaturesAuthenticated Clickwrap enables users to securely sign a form without relying onan extended PKI infrastructure.

In normal use, the user signs the form by entering an ID and secret, such as apassword. When the form is sent to the server, the server retrieves the user’s secretfrom a database and uses that secret to verify the signature. Furthermore, theserver can notarize the Authenticated Clickwrap by signing it with a digitalcertificate, thereby creating a secondary digital signature. This secondary signatureshows that the server has confirmed the identity of the signer, and ensures that theoriginal signature can be trusted over time.

Authenticated Clickwrap signatures use all of the parameters that Clickwrapsignatures support. However, in practice you will probably only use thequestion1Text through question5Text, and some additional parameters that areunique to Authenticated Clickwrap.

To create a signature button that uses the Authenticated Clickwrap engine, set thefollowing parameters in the signformat option:v MIME type — The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case,

HMAC-ClickWrap.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

In addition to these parameters and the parameters used by Clickwrap signature,Authenticated Clickwrap signatures also use the following parameters:v HMACSigner — Indicates which answers identify the signer. The answer is

always written as answern. For example, if question1Text asked the user’s name,then answer1 would identify the signer. Note that this parameter is mandatory.

v HMACSecret — Indicates which answers contain the secret. The answer isalways written as answern. For example, if question2Text asked for the user’ssecret, then answer2 would identify the signer. Note that this parameter ismandatory.

v readonly — Indicates which answers are read-only. This is useful if you haveprepopulated the form, and want to ensure certain answers cannot be changed.The answer is always written as answern. For example, if you wanted to makethe first answer read-only, then you would use answer1.

592 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 599: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Note: The HMACSigner and the HMACSecret cannot point to the same answer.Furthermore, if you list more than one answer, you must separate the answerswith a comma. Be sure not to add any additional white space, such as a space. Forexample, ″answer1,answer2″ is correct.

For example, the following code shows a signature button that will request theuser’s ID and password:

<button sid="BUTTON1"><signformat>

application/vnd.xfdl;engine="HMAC-ClickWrap";question1Text="Enter your ID:";question2Text="Enter your password:";HMACSigner="answer1";HMACSecret="answer2";

</signformat></button>

XFDL Version 7.7 593

Page 600: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using Entrust signaturesThe Entrust engine uses Entrust certificates rather than RSA certificates. As such,users must have Entrust software installed on their computers to access thosecertificates.

To create a signature button that uses the Entrust engine, set the followingparameters in the signformat option:v MIME type — The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case, Entrust.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

For example, the generic XFDL code for a button using the Entrust engine lookslike this:

<button sid="BUTTON1"><type>signature</type><signformat>

application/vnd.xfdl;engine="Entrust"

</signformat></button>

594 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 601: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Using Silanis signaturesThe Silanis engine uses special Silanis technology. As such, users must have Silanissoftware installed on their computers to access those certificates and use Silanis toset signatures.

To create a signature button that uses the Silanis engine, set the followingparameters in the signformat option:v MIME type — The MIME type that is used to store the signature information.

You should always use application/vnd.xfdl.v engine — The name of the signing engine to use. In this case, Silanis.v delete — Optional. This flag sets whether the user can delete the signature. By

default, users can delete all signatures. If you want to prevent a signature frombeing deleted, set this to off.

Additionally, Silanis software allows you to create No-Lock signatures by addingthe following parameter:v lock — This flag sets whether the signature locks the data. By default, this is set

to on, which means signatures lock the data they sign. If you want to prevent asignature from locking data, set this to off. For more information, refer to″About No-Lock Signatures″.

XFDL Version 7.7 595

Page 602: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Sizing the signature button and scaling the image:

Silanis signatures display an image rather than text on the signature button. Thisallows the Silanis software to show a graphic of the user’s handwritten signatureonce the form is signed.

Example

In most cases, this image is larger than the standard button size for a digitalsignature. To account for this, you should:v Make the signature button larger than normal.v Use the imagemode option to scale the image to the correct size.

To make the signature button larger, use the extent setting in the itemlocationoption to change its height. You may want to experiment to determine theappropriate size.

To ensure that the image fits within the button, you should also set theimagemode option to scale. This will resize the image (either by shrinking it orenlarging it) to a best fit within the button, and will maintain the original aspectratio.

The following code creates a button that is 300 pixels wide and 150 pixels tall, andthat scales the image to fit the button.

<button sid="BUTTON1"><itemlocation>

<x>10</x><y>10</y><width>300</width><height>150</height>

</itemlocation><imagemode>scale</imagemode>

</button>

596 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 603: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Storing the signature images:

The graphic that displays the user’s handwritten signature is captured once andthen saved until needed. It is not placed in the form until the form is signed.

However, the form must still contain a data item that can store the image aftersigning. This means that you must add a data item to your form for this purpose.The data item should include an empty mimedata option, as shown:

<data sid="SIGIMAGE"><mimedata></mimedata>

</data>

This item will store the images provided by Silanis once the form is signed.

You also need to supply a ″blank″ image that the button can display before theform is signed. This image does not actually have to be blank, but should indicatethat the button has not yet been signed.

To add the blank image, create another data item that contains your image, asshown:

<data sid="BLANKIMAGE"><mimetype>image/jpeg</mimetype><mimedata encoding="base64-gzip">

H5NstasOO4H=98YDADB3jgSFg+9g813y5h9SDYG2</mimedata>

</data>

Note: Silanis provides a standard image that you can use for unsigned buttons.However, this image is only available through the Designer, which willautomatically set up the signature button for you.

XFDL Version 7.7 597

Page 604: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Linking to the signature image:

You should include an empty data item in your form. This item stores the Silanissignature image once the form is signed. However, before the Viewer can locate theempty data item, you must add a link to the button that points to it.

To create this link, set the signatureimage option to the name of the data item. Forexample, to link to a data item called SIGIMAGE, you would use the followingcode:

<button sid="BUTTON1"><signatureimage>SIGIMAGE</signatureimage>

</button>

Note: This does not control which image is displayed by the button. It simplycreates a link that tells the Viewer which data item contains the signature image.

598 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 605: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Displaying the right image:

The signature button must display one of two images: the blank image, or thesignature image provided by the Silanis software. As with any button, the imageoption is used to set which image is displayed.

However, when using Silanis, a compute must also be used to determine whichimage to display.

This compute relies on the signer option in the button: if the signer option isempty, then the form has not been signed and the image option should be set tothe blank image; if the signer option has any other value, then there is a signaturepresent and the image option should be set to the image supplied by Silanis.

The following example shows a compute that makes this decision. In this case, thedata items that contain the images are named BLANKIMAGE and SIGIMAGE:

<button sid="BUTTON1"><image compute="signer == '' ? 'BLANKIMAGE' : &#xA;

'SIGIMAGE')"></image></button>

XFDL Version 7.7 599

Page 606: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Putting it all together:

The following example shows a signature button that is completely configured fora Silanis signature.

In addition, the code includes the BLANKIMAGE data item and the SIGIMAGEdata item:

<button sid="BUTTON1"><type>signature</type><signformat>application/vnd.xfdl; engine="Silanis"</signformat><itemlocation>

<x>10</x><y>10</y><width>300</width><height>150</height>

</itemlocation><imagemode>scale</imagemode><signatureimage>SIGIMAGE</signatureimage><image compute="signer == '' ? 'BLANKIMAGE' : &#xA;

'SIGIMAGE')"></image></button><data sid="BLANKIMAGE">

<mimetype>image/jpeg</mimetype><mimedata encoding="base64-gzip">

H5NstasOO4H=98YDADB3jgSFg+9g813y5h9SDYG2</mimedata>

</data><data sid="SIGIMAGE">

<mimedata></mimedata></data>

About no-lock signatures:

When you create a No-Lock signature, the Viewer does not lock the data coveredby that signature. This means that you can make changes to the data even thoughit is signed.

Making changes in this way still invalidates the signature, but you can then applya second signature to the same data to approve the changes. This returns theoriginal signature to a valid state.

This is useful in some workflows. For example, you might create a form in whichan employee completes a section and then signs. You might then want a managerto review the form, make any corrections that are necessary to the employee’swork, and then sign the form himself to approve the changes.

Creating a no-lock signature:

With a No-Lock signature, the Viewer does not lock the data covered by thatsignature. This means users can make changes to data even though it has beensigned.

To create a No-Lock signature, set the lock parameter to off in the signformatoption, as shown:

<signformat>application/vnd.xfdl; engine="Silanis"; lock="off"</signformat>

600 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 607: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

When creating a No-Lock signature, you must also add a special setting to thevalue and signer options for the signature button. This setting is the transientattribute, which is added to the value and signer tags as shown:

<button sid="BUTTON1"><value transient="on"></value><signer transient="on"></signer>

</button>

Finally, you must add the transient attribute to the image option as well. In thiscase, the transient attribute can go either before or after the compute attribute. Forexample, the following image option has the transient attribute before thecompute attribute:

<image transient="on" compute="signer == '' ? &#xA;'BLANKIMAGE' : 'SIGIMAGE')"></image>

The transient setting allows the options to temporarily change their values withoutbreaking any signatures. This ensures that the signature does not become stuck ina particular state once a second, overlapping signature is applied.

Creating an approving signature for no-lock scenarios:

An approving signature added to a form so users can approve changes made todata covered by a No-Lock signature. The approving signature must sign all datathat is covered by the No-Lock signature, as well as the No-Lock signature itself.

If it does not cover the same data as the No-Lock signature, the No-Lock signaturewill not return to a valid state when the approving signature is applied.

The approving signature may also cover additional data. For instance, you mayhave a ″public″ section of your form that is covered by a No-Lock signature, and a″office use only″ section that is covered by an approving signature. In this case, theapproving signature would cover both the ″public″ and ″office use only″ sections.

When you create an approving signature, you must:v Prevent the No-Lock signature from signing its own signature image.v Prevent all approving signatures from signing the image for the No-Lock

signature.

This ensures that the signature image can change later if the state of the signaturechanges. For example, if something happens to make the signature invalid, thenthe image must change to reflect that.

Preventing the No-Lock Signature from Signing the Image

To prevent the No-Lock signature from signing its signature image, use thesignitemrefs filter to omit the entire data item from the signature. For example, ifthe signature image were stored in the SIGIMAGE1 item, you would use thefollowing filter:

<signitemrefs><filter>omit</filter><itemrefs>SIGIMAGE1</itemrefs>

</signitemrefs>

If your signature item already contains a signitemrefs filter that omits items,simply add the signature image to the list of items.

XFDL Version 7.7 601

Page 608: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Preventing Approving Signatures from Signing the Image

Next you need to prevent all approving signatures from signing the signatureimage for the No-Lock signature. Again, you use the signitemrefs filter to do this,as shown:

<signitemrefs><filter>omit</filter><itemrefs>SIGIMAGE1</itemrefs>

</signitemrefs>

You must add this filter to all signatures that will sign the No-Lock signature.

Putting it all together:

The following example shows two buttons: a No-Lock signature button, and anapproving signature button (that locks the form).

The No-Lock signature button stores its image in the SIGIMAGE1 data item, whilethe approving signature button stores its image in the SIGIMAGE2 data item.

Note that only the filters already discussed have been added to the signaturebuttons. In an actual form, the No-Lock signature would also filter out theapproving signature.

<button sid="NoLockSig"><type>signature</type><signformat>

application/vnd.xfdl;engine="Silanis";lock="off"</signformat>

<itemlocation><x>10</x><y>10</y><width>300</width><height>150</height>

</itemlocation><imagemode>scale</imagemode><signatureimage>SIGIMAGE1</signatureimage><value transient="on"></value><signer transient="on"></signer><image transient="on" compute="signer == '' ? &#xA;

'BLANKIMAGE' : 'SIGIMAGE1')"></image><signitemrefs>

<filter>omit</filter><itemrefs>SIGIMAGE1</itemrefs>

</signitemrefs></button><button sid="ApprovingSig">

<type>signature</type><signformat>application/vnd.xfdl; engine="Silanis"</signformat><itemlocation>

<x>10</x><y>40</y><width>300</width><height>150</height>

</itemlocation><imagemode>scale</imagemode><signatureimage>SIGIMAGE2</signatureimage><value></value><signer></signer><image compute="signer == '' ? 'BLANKIMAGE' : &#xA;

'SIGIMAGE2')"></image><signitemrefs>

602 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 609: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<filter>omit</filter><itemrefs>SIGIMAGE1</itemrefs>

</signitemrefs></button><data sid="BLANKIMAGE">

<mimetype>image/jpeg</mimetype><mimedata encoding="base64-gzip">

H5NstasOO4H=98YDADB3jgSFg+9g813y5h9SDYG2</mimedata>

</data><data sid="SIGIMAGE1">

<mimedata></mimedata></data><data sid="SIGIMAGE2">

<mimedata></mimedata></data>

XML digital signatures (DSig) overviewXML DSig (Digital Signature) is a standard published by the W3C that defines acommon way of creating a signature in an XML document. This standard defineshow to express the signature within an XML syntax, and how to determine whatportions of the XML document are signed.

The XML DSig standard provides a set of rules that determine what content needsto be signed. For instance, it includes a series of filters that let you include orexclude different parts of the XML document from the signature. The standard alsodetermines how those instructions should be added to the document itself. Forinstance, both the filters and the actual signature must be stored within the XMLdocument.

Signing is handled by an external engine. The XML DSig rules are followed todetermine exactly what should be signed (for instance, all elements on page oneand two of the form) and then a signature engine, such as Generic RSA, MicrosoftCryptoAPI or Netscape Security Services, is used to create the actual signature.Once created, that signature is then stored in the document in the way outlined bythe XML DSig standard.

There are four main sections to an XML DSig:v SignedInfo – contains the filter information such as canonicalization method,

signature algorithm and references describing what form sections are includedor excluded from the signature.

v SignatureValue – contains the signature hash for signed portions of the form.The SignatureValue remains empty until the form is signed.

v KeyInfo – contains information about the signing certificate. The KeyInforemains empty until the form is signed.

v Object – contains additional signature metadata, storing information such astimestamp and signature format.

Creating an XML DSig:

The XML DSig created and described below is a very basic model that is bound toa button and signs the entire form. This is only one of many possible digitalsignatures.

To create an XML DSig, first create an instance that contains the signatureinformation. This instance will contain information on the canonicalization andsignature method algorithms. The code below shows where an XML DSig instanceis located on a form.

XFDL Version 7.7 603

Page 610: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Note: Currently, XML DSig only supports a DigestMethod Algorithm of sha1.<global sid="global">

<xforms:models><xforms:model>

<xforms:instance id="GeneratedInstance" xmlns=""><generated>

<PAGE1><BUTTON1>

<ds:Signature><ds:SignedInfo>

<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">

</ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org

/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod>

References, digest and filters

XML DSig requires references, digest and filters to determine what is signed andwhat is omitted from the signature. Below is an example of the standard filtercreated in every form. The Subtract filter is used to exclude the instance containingthe signature. The signature cannot sign itself or it would break.

<signedinfo><ds:Reference>

<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2002/06/

xmldsig-filter2"><dsxp:XPath Filter="subtract">/xfdl:XFDL/xfdl:globalpage/xfdl:

global/xfdl:xformsmodels/xforms:model/xforms:instance[@id="GeneratedInstance"]/generated/PAGE1/BUTTON1/ds:Signature

</dsxp:XPath></ds:Transform>

</ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig

#sha1"></ds:DigestMethod><ds:DigestValue></ds:DigestValue

</ds:Reference><ds:Reference URI="">

<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-

filter2"><dsxp:XPath Filter="intersect">here()/ancestor::ds:

Signature[1]/ds:Object[sigmeta:metadata]</dsxp:XPath></ds:Transform>

</ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig

#sha1"/><ds:DigestValue></ds:DigestValue>

</ds:Reference></ds:SignedInfo>

Each reference contains a DigestValue field. The DigestValue stores a hash of thereference to ensure the reference isn’t altered after signing. A URI reference isautomatically added by the API to each digital signature. For more information onreferences, see: http://www.w3.org/TR/xmldsig-filter2/#sec-Examples.

There are three types of signatures filters used to include or exclude informationfrom a signature:v Subtract – defines exactly which node/nodes the signature omits.

604 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 611: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

v Intersect – keeps specified nodes and discards everything else from thesignature.

v Union – retrieves specified node/nodes that were previously filtered out byeither the Subtract or Intersect filters.

These filters are also used to create partial signatures, where you want to sign onlya portion of the form. For example, the code below shows the Subtract filtersexcluding the instances for SIGNATURE, FIELD4, and CHECK1....<ds:Reference>

<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">

<dsxp:XPath Filter="subtract">/xfdl:XFDL/xfdl:globalpage/xfdl:global/xfdl:xformsmodels/xforms:model/

xforms:instance[@id="GeneratedInstance"]/generated/PAGE1/BUTTON1/ds:Signature

</dsxp:XPath><dsxp:XPath Filter="subtract">

/xfdl:XFDL/xfdl:globalpage/xfdl:global/xfdl:xformsmodels/xforms:model/xforms:instance[@id="GeneratedInstance"]/generated/PAGE1/FIELD4

</dsxp:XPath><dsxp:XPath Filter="subtract">

/xfdl:XFDL/xfdl:globalpage/xfdl:global/xfdl:xformsmodels/xforms:model/xforms:instance[@id="GeneratedInstance"]/generated/PAGE1/CHECK1

</dsxp:XPath></ds:Transform>

</ds:Transforms></ds:Reference>...

Note: It is best to have as much information in the form covered by the signatureas possible. For this reason, it is better to use the Subtract filter to remove specificitems from the signature.

SignatureValue

The SignatureValue is inserted into the XML DSig to register a hash for the signedportions of the form. Until the form is signed, the SignatureValue remains blank.<ds:SignatureValue></ds:SignatureValue>

KeyInfo

The information in the KeyInfo tags is added to the signature after the form issigned. This section contains hash information about the signing certificate.<ds:KeyInfo></ds:KeyInfo>

Object

The Object section contains any additional metadata you’d like the signature tocontain. This includes time stamps, signature format, and how the form wassigned. For example, the meta data will state date and time of when the form wassigned by the user. The code below shows metadata containing the timestamp....

<ds:Object><sigmeta:metadata>

<sigmeta:timestamp><sigmeta:signtime></sigmeta:signtime><sigmeta:dst></sigmeta:dst>

XFDL Version 7.7 605

Page 612: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<sigmeta:date></sigmeta:date></sigmeta:timestamp><sigmeta:signformat>application/signature+xml;engine="Generic RSA"</sigmeta:signformat>

</sigmeta:metadata></ds:Object>

...

Creating an XForms signature button:

Once the XML DSig is created, the signature instance must be bound something forit to work. For this example, the signature is bound to a XForms button.

The button has an XForms trigger that references ds:SignatureValue. The signformatof application/signature+xml specifies that this signature is an XML DSig.

<button sid="BUTTON1"><xforms:trigger ref="instance('GeneratedInstance')/PAGE1/BUTTON1/ds:Signature

/ds:SignatureValue"><xforms:label>Click to Sign</xforms:label>

</xforms:trigger><value compute="signer == 'INVALID' ? invalid() : signer"></value><type>signature</type><signer></signer><signformat>application/signature+xml;engine="Generic RSA"</signformat>

</button>

Putting it all together:

The example below shows an XML DSig Generic RSA signature and XFormsbutton in a form.<xforms:instance id="GeneratedInstance" xmlns="">

<generated><PAGE1>

<BUTTON1><ds:Signature>

<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/

REC-xml-c14n-20010315"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig

#rsa-sha1"></ds:SignatureMethod><ds:Reference>

<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-

filter2"><dsxp:XPath Filter="subtract">

/xfdl:XFDL/xfdl:globalpage/xfdl:global/xfdl:xformsmodels/xforms:model/xforms:instance

[@id="GeneratedInstance"]/generated/PAGE1/BUTTON1/ds:Signature

</dsxp:XPath></ds:Transform>

</ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/

xmldsig#sha1"></ds:DigestMethod><ds:DigestValue></ds:DigestValue>

</ds:Reference><ds:Reference URI="">

<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2002/06/

xmldsig-filter2"><dsxp:XPath Filter="intersect">here()/ancestor::ds:

Signature[1]/ds:

606 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 613: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Object[sigmeta:metadata]</dsxp:XPath></ds:Transform>

</ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/

xmldsig#sha1"/><ds:DigestValue></ds:DigestValue>

</ds:Reference></ds:SignedInfo>

<ds:SignatureValue></ds:SignatureValue><ds:Object>

<sigmeta:metadata><sigmeta:timestamp>

<sigmeta:signtime></sigmeta:signtime><sigmeta:dst></sigmeta:dst><sigmeta:date></sigmeta:date>

</sigmeta:timestamp><sigmeta:signformat>application/signature+xml;

engine="GenericRSA"</sigmeta:signformat>

</sigmeta:metadata></ds:Object>

</ds:Signature></BUTTON1>

</PAGE1></generated>

</xforms:instance>...<button sid="BUTTON1">

<xforms:trigger ref="instance('GeneratedInstance')/PAGE1/BUTTON1/ds:Signature/ds:SignatureValue">

<xforms:label>Click to Sign</xforms:label></xforms:trigger><itemlocation>

<below>FIELD3</below><width>246</width>

</itemlocation><value compute="signer == 'INVALID' ? invalid() : signer"></value><type>signature</type><signer></signer><signformat>application/signature+xml;engine="GenericRSA"</signformat>

</button>

XFDL Version 7.7 607

Page 614: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Available options for digital signature buttonsThe following table lists all of the options that apply to digital signature buttons

Table 293. digital signature button options

Option Behavior

signature Sets the name (sid) that is used for the signature item when it iscreated during signing.

signatureimage Sets the name (sid) that is used for the data item that stores thesignature’s image. Used only with Silanis signatures.

signdatagroups Sets which datagroups will be included or excluded from thesignature.

signer Records the identity of the person who signed the form.

signformat Sets the details of the signature, including the MIME type toencode it, the signature engine to create it, and special settings forthe signature engine.

signgroups Sets which groups will be included or excluded from thesignature.

signinstance Sets which XForms instance data will be included or excludedfrom the signature.

signitemrefs Sets specific items that will be included or excluded from thesignature.

signitems Sets which items will be included or excluded from the signature.

signnamespaces Sets which namespace elements and attributes will be included orexcluded from the signature.

signoptionrefs Sets specific options that will be included or excluded from thesignature.

signoptions Sets which options will be included or excluded from thesignature.

signpagerefs Sets specific pages that will be included or excluded from thesignature.

Information on specific signature buttons can be found within this manual.

Quick reference tablesThe following section provides you with easy to use reference and cross referencetables.

Table of items and form and page globalsThe table of items and globals lists the available options for each item type.

Item Available Options

action activated; active; data; datagroup; delay; itemnext; itemprevious;printsettings; saveformat; transmitdatagroups; transmitformat;transmitgroups; transmititemrefs; transmititems; transmitnamespaces;transmitoptionrefs; transmitoptions; transmitpagerefs; type; url

box bgcolor; border; fontinfo; itemlocation; itemnext; itemprevious;printbgcolor; printvisible; size; visible; xformsenabled;

608 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 615: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Item Available Options

button activated; active; bgcolor; border; coordinates; data; datagroup;enclosuresettings; focused; fontcolor; fontinfo; format; help; image;imagemode; itemlocation; itemnext; itemprevious; justify; keypress;mouseover; next; previous; printbgcolor; printfontcolor; printsettings;printvisible; saveformat; signature; signatureimage; signdatagroups; signer;signformat; signgroups; signitemrefs; signitems; signnamespaces;signoptionrefs; signoptions; signpagerefs; size; transmitdatagroups;transmitformat; transmitgroups; transmititemrefs; transmititems;transmitnamespaces; transmitoptionrefs; transmitoptions; transmitpagerefs;type; url; value; visible; xformsenabled; xformsreadonly; xformsrequired;xformsvalid; xforms:output; xforms:submit; xforms:trigger; xforms:upload

cell activated; active; data; datagroup; enclosuresettings; group; itemnext;itemprevious; label; printsettings; saveformat; transmitdatagroups;transmitformat; transmitgroups; transmititemrefs; transmititems;transmitnamespaces; transmitoptionrefs; transmitoptions; transmitpagerefs;type; url; value

check active; bgcolor; focused; fontcolor; fontinfo; help; itemlocation; itemnext;itemprevious; keypress; label; labelbgcolor; labelborder; labelfontcolor;labelfontinfo; mouseover; next; previous; printbgcolor; printfontcolor;printlabelbgcolor; printlabelfontcolor; printvisible; readonly; size;suppresslabel; value; visible; xformsenabled; xformsreadonly;xformsrequired; xformsvalid; xforms:secret

checkgroup acclabel; active; bgcolor; border; focused; format; help; itemlocation;itemnext; itemprevious; label; labelbgcolor; labelborder; labelfontcolor;labelfontinfo; mouseover; next; previous; printbgcolor; printlabelbgcolor;printlabelfontcolor; printvisible; readonly; suppresslabel; value; visible;xformsenabled; xformsreadonly; xformsrequired; xformsvalid;xforms:select; xforms:select1

combobox activated; active; bgcolor; border; focused; fontcolor; fontinfo; format;group; help; itemlocation; itemnext; itemprevious; justify; keypress; label;labelbgcolor; labelborder; labelfontcolor; labelfontinfo; mouseover; next;previous; printbgcolor; printlabelbgcolor; printfontcolor;printlabelfontcolor; printvisible; readonly; size; suppresslabel; value;visible; xformsenabled; xformsreadonly; xformsrequired; xformsvalid;xforms:input; xforms:secret; xforms:select1

data datagroup; filename; filesize; itemnext; itemprevious; mimedata; mimetype

field active; bgcolor; border; focused; fontcolor; fontinfo; format; help;itemlocation; itemnext; itemprevious; justify; keypress; label; labelbgcolor;labelborder; labelfontcolor; labelfontinfo; mouseover; next; previous;printbgcolor; printlabelbgcolor; printfontcolor; printlabelfontcolor;printvisible; readonly; scrollhoriz; scrollvert; size; suppresslabel; value;visible; writeonly; xformsenabled; xformsreadonly; xformsrequired;xformsvalid; xforms:input; xforms:secret; xforms:textarea

help active; itemnext; itemprevious; value

label active; bgcolor; border; fontcolor; fontinfo; format; help; image;imagemode; itemlocation; itemnext; itemprevious; justify; printbgcolor;printfontcolor; printvisible; size; value; visible; xformsenabled;xformsreadonly; xformsrequired; xformsvalid; xforms:output

line fontcolor; fontinfo; itemlocation; itemnext; itemprevious; printfontcolor;printvisible; size; thickness; visible; xformsenabled;

XFDL Version 7.7 609

Page 616: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Item Available Options

list active; bgcolor; border; focused; fontcolor; fontinfo; format; group; help;itemlocation; itemnext; itemprevious; keypress; label; labelbgcolor;labelborder; labelfontcolor; labelfontinfo; mouseover; next; previous;printbgcolor; printlabelbgcolor; printfontcolor; printlabelfontcolor;printvisible; readonly; size; suppresslabel; value; visible; xformsenabled;xformsreadonly; xformsrequired; xformsvalid; xforms:secret; xforms:select1

pane active; border; bgcolor; first; focused; itemlocation; itemnext; itemprevious;label; labelbgcolor; lablefontcolor; labelfontinfo; last; next; previous;printbgcolor; printlabelbgcolor; printlabelfontcolor; printvisible;suppresslabel; visible; xformsenabled; xformsreadonly; xformsrequired;xformsvalid; xforms:group; xforms:switch

popup activated; active; bgcolor; border; focused; fontcolor; fontinfo; format;group; help; itemlocation; itemnext; itemprevious; justify; keypress; label;mouseover; next; previous; printbgcolor; printfontcolor; printvisible;readonly; size; suppresslabel; value; visible; xformsenabled;xformsreadonly; xformsrequired; xformsvalid; xforms:secret; xforms:select1

radio active; bgcolor; focused; fontcolor; fontinfo; group; help; itemlocation;itemnext; itemprevious; keypress; label; labelbgcolor; labelborder;labelfontcolor; labelfontinfo; mouseover; next; previous; printbgcolor;printlabelbgcolor; printfontcolor; printlabelfontcolor; printvisible; readonly;size; suppresslabel; value; visible; xformsenabled;

radiogroup acclabel; active; bgcolor; border; focused; format; help; itemlocation;itemnext; itemprevious; label; labelbgcolor; labelborder; labelfontcolor;labelfontinfo; mouseover; next; previous; printbgcolor; printlabelbgcolor;printlabelfontcolor; printvisible; readonly; suppresslabel; value; visible;xformsenabled; xformsreadonly; xformsrequired; xformsvalid;xforms:select1

signature colorinfo; fullname; layoutinfo; itemnext; itemprevious; mimedata;signature; signdatagroups; signer; signformat; signitems; signitemrefs;signgroups; signnamespaces; signoptions; signoptionrefs; signpagerefs

slider acclabel; active; bgcolor; border; focused; fontcolor; fontinfo; format; help;itemlocation; itemnext; itemprevious; label; labelbgcolor; labelborder;labelfontcolor; labelfontinfo; next; previous; printbgcolor; printfontcolor;printlabelcolor; printlabelfontcolor; printvisible; readonly; size;suppresslabel; value; visible; xformsenabled; xformsreadonly;xformsrequired; xformsvalid; xforms:range

spacer fontinfo; itemlocation; itemnext; itemprevious; label; size; xformsenabled;

table active; bgcolor; border; first; focused; itemlocation; itemnext; itemprevious;last; next; previous; printbgcolor; printvisible; visible; xformsenabled;xformsreadonly; xformsrequired; xformsvalid; xforms:repeat

toolbar bgcolor; itemnext; itemprevious; mouseover

page global activated; bgcolor; border; enclosuresettings; focused; fontcolor; fontinfo;itemfirst; itemlast; keypress; label; mouseover; next; pagefirst; pageid;pagelast; pagenext; pageprevious; printbgcolor; printfontcolor;printsettings; saveformat; transmitformat; ufv_settings

form global activated; bgcolor; dirtyflag; enclosuresettings; focused; fontcolor; fontinfo;formid; history; keypress; printbgcolor; printfontcolor; printing;printsettings; requirements; saveformat; transmitformat; triggeritem;ufv_settings; version; webservices

610 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 617: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table of options

The following table list the details for the available options:

Option Details

acclabel <acclabel>message</acclabel>

Default: n/a

Items: button; check; checkgroup; combobox; field; list; popup; radio;radiogroup; slider

activated <activated>on|maybe|off</activated>

Default: off

Items: action; button; cell; combobox; popup; page global; formglobal

active <active>on|off</active>

Default: on

Items: action; button; cell; check; checkgroup; combobox; field; help;label; list; popup; radio; radiogroup; sliderNote: To prevent user input in a field, set the readonly option to on.

bgcolor <bgcolor>color</bgcolor>

Default:

v for form – white

v for page – the form bgcolor setting or default

v for button – gray

v for check, field, list, popup, radio – white

v for label, table, and pane – transparent

v all other items – the background color of the page

Items: box; button; check; checkgroup; combobox; field; label; list;popup; radio; radiogroup; slider; toolbar; page global; form global

border <border>on|off</border>

Default:

v for label — off

v for all other items — on

Items: box; button; checkgroup; combobox; field; label; list; pane;popup; radiogroup; slider; table

colorinfo <colorinfo><color_name1>color</color_name1>...<color_namen>color</color_namen></colorinfo>

Default: none

Items: signature

XFDL Version 7.7 611

Page 618: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

coordinates <coordinates><x>X_coordinate</x><y>Y_coordinate</y>

</coordinates>

Default: none

Items: button

cursortype <cursortype>hand</cursortype>

Default: none

Items: button

data <data>data_item</data>

Default: arrow

Items: button

datagroup <datagroup><datagroupref>datagroup_reference</datagroupref><datagroupref>datagroup reference</datagroupref>

</datagroup>

Default: none

Items: action; button; cell; data

delay <delay><type>repeat|once</type><interval>interval</interval>

</delay>

Default: once with an interval of 0 seconds

Items: action

direction <direction>ltr|rtl</direction>

Default: Per parent’s orientation. If not set, the direction defaults to ltr(Left-To-Right).

Items: button; check; combobox; field; label; list; popup; radio

dirtyflag <dirtyflag>on|off</dirtyflag>

Default: none

Items: form global

display <display>on|off</display>

Default: on

Items: box; button; check; combobox; field; help; label; line; list;popup; radio; signature; slider; table; toolbar

612 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 619: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

enclosuresettings <enclosuresettings><maxsize>maxsize</maxsize><totalsize>totalsize<totalsize><mediatypes>mediatype<mediatypes><uniquenames>name<uniquenames>

</enclosuresettings>

Default: no limits

Items: button of type enclose; cell of type enclose; page global; formglobal

excludedmetadata <excludedmetadata><servernotarizations>

<notarization>Notarization</notarization>...<notarization>Notarization</notarization>

</servernotarizations></excludedmetadata>

Default: none

Items: signature

filename <filename>file name</filename>

Default: none

Items: data

filesize <filesize>file size in kilobytes</filesize>

Default: none

Items: data

first <first>item reference</first>

Default: none

Items: table

focused <focused>on|off</focused>

Default: off

Items: button; check; checkgroup; combobox; field; list; popup; radio;radiogroup; slider; page global; form global

focuseditem <focuseditem>sid</focuseditem>

Default: n/a

Items: page global

fontcolor <fontcolor>color</fontcolor>

Default:

v for check and radio – red

v for all other items, the fontcolor set in the page or form global, orblack if no preference set

Items: button; check; combobox; field; label; line; list; popup; radio;slider; page global; form global

XFDL Version 7.7 613

Page 620: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

fontinfo <fontinfo><fontname>font name</fontname><size>point size</size><effect>effect1</effect>...<effect>effectn</effect>

</fontinfo>

* effects are optional

Default: the fontinfo set in page or form global, or Helvetica 8 plainif no characteristics set

Items: box; button; check; combobox; field; label; line; list; popup;radio; slider; spacer; page global; form global

format <format><dataype>data type</datatype><presentation>presentation settings</presentation><constraints>constraint settings</constraints>

</format>

* presentation and constraint settings are optional

Default:

v for data type – ASCII string

v for presentation settings – depends on data type

v for constraint settings – depends on data type

Items: button; checkgroup; combobox; field; label; list; popup;radiogroup; slider

formid <formid><title>string</title><serialnumber>string</serialnumber><version>AA.Bb.cc</version>

</formid>

* format and check flags are optional, and multiple flags are valid

Default: none

Items: form global

formid <fullname>name</fullname>

Default: none

Items: signature

group <group>group name|group reference</group>

Default: none

Items: cell; combobox; list; popup; radio

help <help>item reference</help>

Default: none

Items: button; check; checkgroup; combobox; field; label; list; popup;radio; radiogroup; slider

614 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 621: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

history <history><editors>

<editor version="version_number"1minversion="minimum_version"1>editor

</editor>...<editor version="version_number"n

minversion="minimum_version"n>editor</editor>

</editors></history>

Default:

v For forms created or edited using Lotus Forms Designer – IBMLotus Forms Designer

v For forms created or edited using Lotus Forms Turbo – IBM LotusForms Composer

Items: form global

image <image>item reference</image>

Default: none

Items: button; label

imagemode <imagemode>clip|resize|scale</imagemode>

Default: resize

Items: button; label

itemfirst <itemfirst>item reference</itemfirst>

Default: none

Items: page global

itemlocation <itemlocation><x>x-coordinate</x><y>y-coordinate</y>

</itemlocation>

* this is for absolute positioning. Refer to the itemlocation entry forexamples of relative and offset positioning, or extent sizing.

Default:

v for the first item — the top left corner of the form

v for all other items — vertically below the previously created itemand horizontally at the left margin

Items: box; button; check; checkgroup; combobox; field; label; line;list; popup; radio; radiogroup; slider; spacer

itemlast <itemlast>item reference</itemlast>

Default: none

Items: page global

XFDL Version 7.7 615

Page 622: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

itemnext <itemnext>item reference</itemnext>

Default: none

Items: action; box; button; cell; check; checkgroup; combobox; data;field; help; label; line; list; popup; radio; radiogroup; signature; slider;spacer; toolbar

itemprevious <itemprevious>item reference</itemprevious>

Default: none

Items: action; box; button; cell; check; checkgroup; combobox; data;field; help; label; line; list; popup; radio; radiogroup; signature; slider;spacer; toolbar

justify <justify>left|right|center|lead|trail</justify>

Default: left

Items: button; combobox; field; label; popup

keypress <keypress>key pressed</keypress>

Default: none

Items: button; check; combobox; field; list; popup; radio; page global;form global

label <label>label text</label>

Default: none

Items: cell; check; checkgroup; combobox; field; list; pane; popup;radio; radiogroup; slider; spacer; page global; form global

labelbgcolor <labelbgcolor>color</labelbgcolor>

Default: transparent

Items: check; checkgroup; combobox; field; list; pane; radio;radiogroup; slider

labelborder <labelborder>on|off</labelborder>

Default: off

Items: check; checkgroup; combobox; field; list; radio; radiogroup;slider

labelfontcolor <labelfontcolor>color name</labelfontcolor>

Default: the item’s labelfontcolor setting, or the global fontcolorsetting or default

Items: check; checkgroup; combobox; field; list; pane; radio;radiogroup; slider

616 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 623: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

labelfontinfo <labelfontinfo><fontname>font name</fontname><size>point size</size><effect>effect1</effect>...<effect>effectn</effect>

</labelfontinfo>

* effects are optional

Default: Helvetica, 8, plain

Items: check; checkgroup; combobox; field; list; pane; radio;radiogroup; slider

last <last>item reference</last>

Default: none

Items: table

layoutflow <check sid="CHECK1"><xforms:input ref=""><xforms:label></xforms:label>

</xforms:input><itemlocation><x>110</x><y>331</y>

</itemlocation><layoutflow>block</layoutflow>

</check>

Default:

v The default block flow (vertical positioning) is applied to table,pane, and the contents of checkgroup, and radiogroup.

v The default inline flow (horizontal positioning) is applied to allother items.

v The default for all items previous to XFDL 7.1 is block.

item: noted above.

layoutinfo <layoutinfo><pagehashes>

<pagehash><pageref>page sid1</pageref><hash>pagehash1</hash>

</pagehash>...<pagehash>

<pageref>page sidn</pageref><hash>pagehashn</hash>

</pagehash></pagehashes>

</layoutinfo>

Default: none.

Items: signature

linespacing <linespacing>offset</linespacing>

Default: 0

Items: button, label, spacer

XFDL Version 7.7 617

Page 624: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

mimedata <mimedata encoding="format">data</mimedata>

Default: none

Items: data, signature

mimetype <mimetype>MIME type</mimetype>

Default: none

Items: data

mouseover <mouseover>on|off</mouseover>

Default: off

Items: button; check; combobox; field; list; popup; radio; toolbar;page global

next <next>item reference</next>

Default:

v when the form opens – the first non-toolbar item in the form’sdescription that users can modify

v when tabbing to subsequent items – the next item in the form’sdescription that users can modify

v when tabbing from the last item – the first item in the form’sdescription that users can modify (can be a toolbar item)

Items: button; combobox; check; checkgroup; field; list; popup; radio;radiogroup; slider; page global

numbershaping <numbershaping>numeral type<numbershaping>

Default: Per parent or contextual if not set in parent.

Items: button; check; checkgroup; combobox; field; label; list; pane;popup; radio; radiogroup; slider; table; toolbar

orderingscheme <orderingscheme>storage method<orderingscheme>

Default: Per parent, or logical if not set in parent.

Items: button; check; checkgroup; combobox; field; label; list; pane;popup; radio; radiogroup; slider; table; toolbar

orientation <orientation>direction</orientation>

Default: based on the orientation of the immediate parent. If not set,or no parent, Right-To-Left (rtl) for bidirectional locales, Left-To-Right(ltr) for other locales. If no locale specified, Left-To-Right (ltr).

Items: button; check; checkgroup; combobox; field; global; formglobal; label; list; popup; radio; radiogroup; pane; slider; table;toolbar

padding <padding>number</padding>

Default: positive integers 3 through 0 inclusive.

Items: pane

618 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 625: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

pagefirst <pagefirst>page reference</pagefirst>

Default: none

Items: page global

pageid <pageid><serialnumber>string</serialnumber>

</pageid>

Default: none

Items: form global

pagelast <pagelast>page reference</pagelast>

Default: none

Items: page global

pagenext <pagenext>page reference</pagenext>

Default: none

Items: page global

pageprevious <pageprevious>page reference</pageprevious>

Default: none

Items: page global

previous <previous>item_reference</previous>

Default: the previous item in the form description

Items: button; combobox; check; checkgroup; field; list; pane; popup;radio; radiogroup; slider; table

printbgcolor <printbgcolor>color</printbgcolor>

Default:

v for form – white

v for page – the form setting or default

v for items – the specified or default item bgcolor

Items: box; button; check; checkgroup; combobox; field; label; list;popup; radio; radiogroup; slider; page global; form global

printfontcolor <printfontcolor>color</printfontcolor>

Default:

v for button, combobox, field, label, line, list, popup: the fontcolorsetting or default for the item

v for radio, check: red

Items: button; check; combobox; field; label; line; list; popup; radio;slider

XFDL Version 7.7 619

Page 626: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

printing <printing>on|off</printing>

Default: off

Items: form global

printlabelbgcolor <printlabelbgcolor>color</printlabelbgcolor>

Default: the item’s specified or default labelbgcolor

Items: check; checkgroup; combobox; field; list; pane; radio;radiogroup; slider

printlabelfontcolor <printlabelfontcolor>color</printlabelfontcolor>

Default: the item’s specified or default labelfontcolor

Items: check; checkgroup; combobox; field; list; pane; radio;radiogroup; slider; page global; form global

printsettings <printsettings><pages>page list</pages><dailog>dialog settings</dialog><border>on|off</border><singlelinefieldsaslines>on|off</singlelinefieldsaslines><scroll barsonfields>on|off</scroll barsonfields><radioswithoutvalues>on|off</radioswithoutvalues><radiosaschecks>on|off</radiosaschecks><pagelayout>layout setting</pagelayout>

</printsettings>

Default: the page list defaults to include all pages in the form, thedialog defaults to on, has the following settings:

v orientation – portrait

v copies – 1

v printpages active – on

v printpages choices – all

v border – off

v singlelinefieldsaslines, scroll barsonfields, radioswithoutvalues,radiosaschecks, pagelayout – as set in form rendering software.

Items: action; button; cell; page global; form global

printvisible <printvisible>on|off</printvisible>

Default: defaults to the visible setting for the item

Items: box; button; check; checkgroup; combobox; field; label; line;list; popup; radio; radiogroup; slider

readonly <readonly>on|off</readonly>

Default: off

Items: check; checkgroup; combobox; field; list; popup; radio;radiogroup; slider

620 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 627: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

requirements <requirements><requirement>requirement settings</requirement><detected>off</detected>

<requirements>

Default: none

Items: form global

rowpadding <rowpadding>number</rowpadding>

Default: 1

Items: table

rtf <rtf>rich text string</rtf>

Default: a default rich text string is created using the value, fontinfo,fontcolor, justify, and bgcolor options

Items: field

saveformat <saveformat>mimetype</saveformat>

Default: none

Items: action; button; cell; form global; page global

scrollhoriz <scrollhoriz>never|always|wordwrap</scrollhoriz>

Default: never

Items: field

scrollvert <scrollvert>never|always|fixed</scrollvert>

Default: never

Items: field

signature <signature>string</signature>

Default: none

Items: button; signature

signatureimage <signatureimage>data item reference</signatureimage>

Default: none

Items: button

signdatagroups <signdatagroups><filter>keep|omit</filter><datagroupref>datagroup reference</datagroupref><datagroupref>datagroup reference</datagroupref>

</signdatagroups>

Default: keep

Items: button; signature

XFDL Version 7.7 621

Page 628: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

signdetails <signdetails><dialogcolumns>

<property>attribute1</property><property>attributen</property>

</dialogcolumns><filteridentity>

<filter><tag>attribute1</tag><value>value1</value>

</filter><filter>

<tag>attributen</tag><value>valuen</value>

</filter></filteridentity>

</signdetails>

Default: all certificates are available, and the owner’s common nameand email address is shown.

Items: button; signature

signer <signer>string</signer>

Default: none

Items: button; signature

signformat <signformat>MIME type; engine="signature engine"; verifier;cval; parameters

</signformat>

Default: XFDL MIME type; Generic RSA signature engine; Basicverifier; do not sign current values

Items: button; signature

signgroups <signgroups><filter>keep|omit</filter><groupref>group reference1</groupref>...<groupref>group referencen</groupref>

</signgroups>

Default: keep

Items: button; signature

signinstance <signinstance><filter>instance filter</filter><dataref1>

<model>model ID</model><ref>XPath</ref>

</dataref>...<datarefn>

...</dataref>

</signinstance>

Default: keep

Items: button; signature

622 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 629: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

signitems <signitems><filter>keep|omit</filter><itemtype>item type1</itemtype>...<itemtype>item typen</itemtype>

</signitems>

Default: keep

Items: button; signature

signitemrefs <signitemrefs><filter>keep|omit</filter><itemref>item reference1</itemref>...<itemref>item referencen</itemref>

</signitemrefs>

Default: keep

Items: button; signature

signnamespaces <signnamespaces><filter>keep|omit</filter><uri>namespace URI1</uri>...<uri>namespace URIn</uri>

</signnamespaces>

Default: keep

Items: button; signature

signoptionrefs <signoptionrefs><filter>keep|omit</filter><optionref>option reference1</optionref>...<optionref>option referencen</optionref>

</signoptionrefs>

Default: keep

Items: button; signature

signoptions <signoptions><filter>keep|omit</filter><optiontype>option type1</optiontype>...<optiontype>option typen</optiontype>

</signoptions>

Default: keep

Items: button; signature

signpagerefs <signpagerefs><filter>keep|omit</filter><pageref>page reference1</pageref>...<pageref>page referencen</pageref>

</signpagerefs>

Default: keep

Items: button; signature

XFDL Version 7.7 623

Page 630: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

size <size><width>width</width><height>height</height>

</size>

* the unit of measurement is characters.

Default: see “Default sizes” on page 637

Items: box; button; check; combobox; field; label; line; list; popup;radio; slider; spacer

suppresslabel <suppresslabel>on|off</suppresslabel>

Default: off

Items: check, checkgroup, combobox, field, list, popup, radio,radiogroup, and slider

texttype <texttype>text/plain|text/rtf<texttype>

Default: text/plain

Items: field

thickness <thickness>thickness</thickness>

Default: 1 pixel

Items: line

transmitdatagroups <transmitdatagroups><filter>keep|omit</filter><datagroupref>datagroup identifier1</datagroupref>...<datagroupref>datagroup identifiern</datagroupref>

</transmitdatagroups>

Default: keep

Items: action; button; cell

transmitformat <transmitformat>MIME type</transmitformat>

Default: application/vnd.xfdl

Items: action; button; cell; form global; page global

transmitgroups <transmitgroups><filter>keep|omit</filter><groupref>group identifier1</groupref>...<groupref>group identifiern</groupref>

</transmitgroups>

Default: keep

Items: action; button; cell

624 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 631: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

transmititemrefs <transmititemrefs><filter>keep|omit</filter><itemref>item identifier1</itemref>...<itemref>item identifiern</itemref>

</transmititemrefs>

Default: keep

Items: action; button; cell

transmititems <transmititems><filter>keep|omit</filter><itemtype>item type1</itemtype>...<itemtype>item typen</itemtype>

</transmititems>

Default: keep

Items: action; button; cell

transmitnamespaces <transmitnamespaces><filter>keep|omit</filter><uri>namespace URI1</uri>...<uri>namespace URIn</uri>

</transmitnamespaces>

Default: keep

Items: action; button; cell

transmitoptionrefs <transmitoptionrefs><filter>keep|omit</filter><optionref>option identifier1</optionref>...<optionref>option identifiern</optionref>

</transmitoptionrefs>

Default: keep

Items: action; button; cell

transmitoptions <transmitoptions><filter>keep|omit</filter>

<optiontype>option type1</optiontype>...<optiontype>option typen</optiontype>

</transmitoptions>

Default: keep

Items: action; button; cell

transmitpagerefs <transmitpagerefs><filter>keep|omit</filter><pageref>page identifier1</pageref>...<pageref>page identifiern</pageref>

</transmitpagerefs>

Default: keep

Items: action; button; cell

XFDL Version 7.7 625

Page 632: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

triggeritem <triggeritem>item reference</triggeritem>

Default: the item reference of the item that triggered the submit ordone

Items: form global

type <type>action type</type>

Default: select

Items: action; button; cell

url <url>URL|item reference</url>

Default: none

Items: action; button; cell

value <value>setting</value>

Default: depends on item

Items: button; cell; check; checkgroup; combobox; field; help; label;list; popup; radio; radiogroup; slider

visible <visible>on|off</visible>

Default: on

Items: box; button; check; checkgroup; combobox; field; label; line;list; popup; radio; radiogroup; slider

webservices <webservices><wsdl:name>name of webservice</wsdl>

</webservices>

Default: none

Items: form global

writeonly <writeonly>on|off</writeonly>

Default: off

Items: field

xformsenabled <xformsenabled>on|off</xformsenabled>

Default: off

Items: button; check; checkgroup; combobox; field; label; list; pane;popup; radiogroup; slider; table. If the XFDL presentation item iscontained by an xforms:group, xforms:switch, or xforms:repeat, thenxformsenabled also applies to: box; line; radio; spacer.

626 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 633: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

xformsmodels <xformsmodels><xforms:model id="name1">

<xforms:instance id="name1">instance1

</xforms:instance>...<xforms:instance id="namen">

instancen</xforms:instance>

</xforms:model>...<xforms:model id="namen">

...</xforms:model><xforms:bind property setting1></xforms:bind>...<xforms:bind property settingn></xforms:bind>

</xformsmodels>

Default: none

Items: form global

xformsreadonly <xformsreadonly>on|off</xformsreadonly>

Default: off

Items: button, check, combobox, field, label, list, popup, table, pane,checkgroup, radiogroup, and slider

xformsrequired <xformsrequired>on|off</xformsrequired>

Default: off

Items: button, check, combobox, field, label, list, popup, table, pane,checkgroup, radiogroup, and slider

xformsvalid <xformsvalid>on|off</xformsvalid>

Default: on

Items: button, check, combobox, field, label, list, popup, table, pane,checkgroup, radiogroup, and slider

xforms:group <xforms:group model="model ID" ref="XPath">...items in group...

</xforms:group>

Default: none

Items: pane

xforms:input <xforms:input model="model ID" ref="XPath"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:input>

Default: none

Items: combobox; check; field

XFDL Version 7.7 627

Page 634: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

xforms:output <xforms:output model="model ID" ref="XPath"mediatype="MIME type">Alert SettingHint SettingHelp Setting

</xforms:output>

Default: none

Items: label

xforms:range <xforms:range single node binding start="start"end="end" step="step"><xforms:label>label text</xforms:label>

</xforms:range>

Default: none

Items: slider

xforms:repeat <xforms:repeat id="name" model="model ID"nodeset="XPath" startindex="index">

...XFDL items...</xforms:repeat>

Default: none

Items: field

xforms:secret <xforms:secret model="model ID" ref="XPath"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:secret>

Default: none

Items: field

628 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 635: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

xforms:select <xforms:select model="model ID"ref="XPath to element" appearance="full"><xforms:label>label text</xforms:label><xforms:item1>

<xforms:label>label for choice</xforms:label><xforms:value>value for choice</xforms:value>

</xforms:item1>...<xforms:itemn>

...</xforms:itemn>Alert SettingHint SettingHelp Setting

</xforms:select>OR

<xforms:select model="model ID"ref="XPath to element" appearance="full"><xforms:label>label text</xforms:label><xforms:itemset nodeset="XPath to choices">

<xforms:label ref="XPath to label text"/><xforms:value ref="."></xforms:value>

</xforms:itemset>Alert SettingHint SettingHelp Setting

</xforms:select>

Default: none

Items: checkgroup

XFDL Version 7.7 629

Page 636: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

xforms:select1 <xforms:select1 model="model ID"ref="XPath to element" appearance="type"selection="input"><xforms:label>label text</xforms:label><xforms:item1>

<xforms:label>label for choice</xforms:label><xforms:value>value for choice</xforms:value>

</xforms:item1>...<xforms:itemn>

...<xforms:itemn>Alert SettingHint SettingHelp Setting

</xforms:select>OR

<xforms:select1 model="model ID"ref="XPath to element" appearance="type"setting="input"><xforms:label>label text</xforms:label><xforms:itemset nodeset="XPath to choices">

<xforms:label ref="XPath to label text"/><xforms:value ref="."></xforms:value>

</xforms:itemset>Alert SettingHint SettingHelp Setting

</xforms:select>

Default: none

Items: checkgroup, combobox, list, popup, radiogroup

xforms:submit <xforms:submit submission="ID"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:submit>

Default: none

Items: action; button

xforms:switch <switch id="name" ref="XPath"><xforms:case1 id="name" selection="boolean"

...XFDL items...</xforms:case1>...<xforms:casen id="name" selection="boolean"

...XFDL items...</xforms:casen>

</switch>

Default: none

Items: pane

630 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 637: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Option Details

xforms:textarea <xforms:textarea model="model ID" ref="XPath"><xforms:label>label text</xforms:label>Alert SettingHint SettingHelp Setting

</xforms:textarea>

Default: none

Items: field

xforms:trigger <xforms:trigger model="model ID" ref="XPath"><xforms:label>label text</xforms:label>XForms ActionAlert SettingHint SettingHelp Setting

</xforms:trigger>

Default: none

Items: action; button

xforms:upload <xforms:upload model="model ID" ref="upload XPath"mediatype="MIME type"><xforms:label>label text</xforms:label><xforms:mediatype ref="mediatype XPath"/><xforms:filename ref="filename XPath"/>Alert SettingHint SettingHelp Setting

</xforms:upload>

Default: none

Items: button

XFDL Version 7.7 631

Page 638: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Cross reference table for items and options

acti

on

bo

x

bu

tto

n

cell

chec

k

chec

kg

rou

p

com

bo

bo

x

dat

a

fiel

d

hel

p

lab

el

lin

e

list

pan

e

po

pu

p

rad

io

rad

iog

rou

p

sig

nat

ure

slid

er

spac

er

tab

le

too

lbar

pag

eg

lob

al

form

glo

bal

(glo

bal

pag

e)

acclabel v v v v v v v v v v

activated v v v v v v v

active v v v v v v v v v v v v v v v v

bgcolor v v v v v v v v v v v v v v v v v

border v v v v v v v v v v v v v v

colorinfo v

coordinates v

cursortype v

data v v v

datagroup v v v v

delay v

dirtyflag v

display v v v v v v v v v v v v v v v

enclosuresettings v v v v

excludedmetadata

v

filename v

filesize v

first v v

focused v v v v v v v v v v v v v v

focuseditem v

fontcolor v v v v v v v v v v v v

fontinfo v v v v v v v v v v v v v v

format v v v v v v v v v

formid v

fullname v

group v v v v v

help v v v v v v v v v v v

history v

image v v

imagemode v v

itemfirst v

itemlast v

itemlocation v v v v v v v v v v v v v v v v

632 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 639: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

acti

on

bo

x

bu

tto

n

cell

chec

k

chec

kg

rou

p

com

bo

bo

x

dat

a

fiel

d

hel

p

lab

el

lin

e

list

pan

e

po

pu

p

rad

io

rad

iog

rou

p

sig

nat

ure

slid

er

spac

er

tab

le

too

lbar

pag

eg

lob

al

form

glo

bal

(glo

bal

pag

e)

itemnext v v v v v v v v v v v v v v v v v v v v v v

itemprevious v v v v v v v v v v v v v v v v v v v v v v

justify v v v v v

keypress v v v v v v v v v

label v v v v v v v v v v v v v v

labelbgcolor v v v v v v v v v

labelborder v v v v v v v v

labelfontcolor v v v v v v v v v

labelfontinfo v v v v v v v v v

last v v

layoutflow v v v v v v v v v v v v v v v v v v

layoutinfo v

linespacing v v v

mimedata v v

mimetype v

mouseover v v v2v v v v v v

2v v

next v v v v v v v v v v v v v

padding v

orientation v v v v v v v v v v

pagefirst v

pageid v

pagelast v

pagenext v

pageprevious v

previous v v v v v v v v v v v v v

printbgcolor v v v v v v v v v v v v v v v v

printfontcolor v v v v v v v v v v v v

printing v

printlabelbgcolor

v v v v v v v v v

printlabelfontcolor

v v v v v v v v v

printsettings v v v v v

printvisible v v v v v v v v v v v v v v v

readonly v v v v v v v v v

requirements v

XFDL Version 7.7 633

Page 640: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

acti

on

bo

x

bu

tto

n

cell

chec

k

chec

kg

rou

p

com

bo

bo

x

dat

a

fiel

d

hel

p

lab

el

lin

e

list

pan

e

po

pu

p

rad

io

rad

iog

rou

p

sig

nat

ure

slid

er

spac

er

tab

le

too

lbar

pag

eg

lob

al

form

glo

bal

(glo

bal

pag

e)

rowpadding v

rtf v

saveformat v v v v v

scrollhoriz v

scrollvert v

signature v v

signatureimage

v

signdatagroups

v v

signdetails v v

signer v v

signformat v v

signgroups v v

signinstance v v

signitemrefs v v

signitems v v

signnamespaces

v v

signoptionrefs v v

signoptions v v

signpagerefs v v

size v v v v v v v v v v v v

suppresslabel v v v v v v v v v v v v

texttype v

thickness v

transmitdatagroups

v v v

transmitformat

v v v v v

transmitgroups

v v v

transmititemrefs

v v v

transmititems v v v

transmitnamespaces

v v v

634 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 641: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

acti

on

bo

x

bu

tto

n

cell

chec

k

chec

kg

rou

p

com

bo

bo

x

dat

a

fiel

d

hel

p

lab

el

lin

e

list

pan

e

po

pu

p

rad

io

rad

iog

rou

p

sig

nat

ure

slid

er

spac

er

tab

le

too

lbar

pag

eg

lob

al

form

glo

bal

(glo

bal

pag

e)

transmitoptionrefs

v v v

transmitoptions

v v v

transmitpagerefs

v v v

triggeritem v

type v v v

ufv_settings v v

url v v v

value v v v v v v v v v v v v v

visible v v v v v v v v v v v v v v v

webservices v

writeonly v

xformsenabled v v v v v v v v v v v v

xformsreadonly v v v v v v v v v v v v

xformsrequired v v v v v v v v v v v v

xformsvalid v v v v v v v v v v v v

xformsmodels v

xforms:group v

xforms:input v v v

xforms:output v1

v

xforms:range v

xforms:repeat v

xforms:secret v

xforms:select v v

xforms: select1 v v v v v

xforms:submit v v

xforms:switch v

xforms:textarea

v

xforms:trigger v v

xforms:upload v

1xforms:output cannot be the immediate child of a button; however, it can be adescendent through the xforms:trigger, xforms:submit, or xforms:upload options.

XFDL Version 7.7 635

Page 642: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

2For checkgroup and radiogroup, the mouseover option is active for each item inthe group, not for the group as a whole. This means that you can use the<xforms:extension> element to make changes to individual items in the group. Formore information, see “checkgroup” on page 59 and “radiogroup” on page 65.

Destroy Function Quick Reference

x indicates that the specified node can be deleted with the destroy function.

page is in full usepage is in partialuse page is not in use

action x x

array elements

box x x x

button x x x

cell x x x

check x x x

combobox x x x

data x x x

field x x x

form global (globalpage)

form

help

label x x

line x x x

list x x x

non-XFDL namespace x x x

options*

page x

page global x

popup x x x

radio x x x

signature

spacer x x x

toolbar x x

XML data model x x x

* options include: standard options, event options, and relative options

636 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 643: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Default sizes

The following table shows the default basic item and bounding box sizes:

Item Default Item Size Bounding Box Size

box width: 1 character

height: 1 character

Smaller than 1 not allowed in eitherdimension

Same as default item size

button width: width of text

height: height of text (text is the valueoption)

or size of embedded image if it exists

Same as default item size

check width: 1 character

height: 1 character

width: larger of 1 character orlabel width

height: label height plus 1character

checkgroup width: width checkgroup contents plus 6pixels (for default locations, this is thewidth of the widest check label, plus thewidth of the check box, plus 6 pixels)

height: the height of the checkgroupcontents plus 6 pixels (for defaultlocations, this is 1 character for eachcheck in the group, plus 5 pixelsbetween each check, plus 6 pixels)

Same as default item size

combobox width: larger of label width and widestcell 3

height: 1 character

Same as default item size 2

field width: 30 characters

height: 1 character

width: larger of item width andlabel width 2

height: height of item plus heightof label 2

label width: 1 character if label empty,otherwise label width

height: 1 character if label empty,otherwise label height

or size of embedded image if it exists

Same as default item size

line width: 30 character

height: 1 pixel

One dimension must be 0 1

Same as default item size

list width: larger of label width and widestcell 3

height: number of cells in list

width: larger of item width andwidest cell 2

height: height of item plus heightof label

XFDL Version 7.7 637

Page 644: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Item Default Item Size Bounding Box Size

pane width: the width of the pane contents,plus 6 pixels

height: the height of the pane contents,plus 6 pixels

Same as default item size

popup width: larger of label width and widestcell 3

height: 1 character

Same as default item size 2

radio width: 1 character

height: 1 character

width: larger of 1 character orlabel width

height: label height plus 1character

radiogroup width: width radiogroup contents plus 6pixels (for default locations, this is thewidth of the widest radio label, plus thewidth of the radio button, plus 6 pixels)

height: the height of the radiogroupcontents plus 6 pixels (for defaultlocations, this is 1 character for eachradio in the group, plus 5 pixels betweeneach radio, plus 6 pixels)

Same as default item size

slider width: 20 characters

height: 3 characters

spacer width: 1 character if label empty,otherwise label width

height: 1 character if label empty,otherwise label height

(label is invisible)

Same as default item size

table width: the width of the table contentsplus 6 pixels

height: the height of the table contents,plus 1 pixel for each relevant row, plus 6pixels

Same as default item size

Usage Details1. For line items, either height or width must be set to zero. The thickness option

specifies the thickness (in pixels) of the line in the dimension containing zero(0).

2. This includes a scroll bar if one appears.3. The cell’s width comes from the cell’s value option setting.

Order of precedence of filtersSignature and transmission filters are applied with an order of precedence. Thisprevents potential filter conflicts, in which one filter might stipulate that you omitan item while another filter might stipulate that you keep an item.

638 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 645: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

When using signatures, note that the mimedata option is always omitted in thefollowing scenarios, regardless of the signature filters in use:v The mimedata option in a signature item is always omitted from the signature

that item represents.v The mimedata option in a data item that stores a signature image (see the

signatureimage option) is always omitted from the signature that imagerepresents.

Filters are applied in the following order:

Table 294. order_of_precedence_for_filters parameters

FilterBehavior If keepflag is used

Behavior If omit flagis used Usage Details

1. Filter namespaces,based ontransmitnamespacesor signnamespacessetting.

Keeps only elementsand attributes in thenamespacesindicated; throwsothers out.

Omits only elementsand attributes in thenamespacesindicated; throwsthem out.

An element is kept ifany of its childrenare kept, even if it isin the wrongnamespace.

2. Filter types ofitems, based ontransmititems orsignitems setting.

Keeps only thosetypes indicated;throws others out,including theiroptions.

Omits only thosetypes indicated;throws them out,including theiroptions.

3. Filter types ofoptions based ontransmitoptions andsignoptions setting.

In the items thatremain, keeps alloption typesindicated; throwsothers out.

In the items thatremain, omits alloption typesindicated.

4. Filter specificpages based ontransmitpagerefs orsignpagerefs settings.

Keeps the pageswhose tags arespecified. Settings intransmitnamespaces,transmititems, andtransmitoptions arerespected.

Omits the pageswhose tags arespecified. Overridessettings intransmitnamespaces,transmititems, andtransmitoptions.

The page does notentirely disappearfrom the source code;the page tags stillexist.

5. Filter groups ofitems based ontransmitdatagroupsand transmitgroups,or signdatagroupsand signgroupssettings.

Keeps those itemswhose tags arespecified, even if theitems are of a typethat should not bekept according to atransmitnamespacesor transmititemssetting.

Omits those itemswhose tags arespecified, even if theitems are of a typethat should be keptaccording to atransmitnamespacesor transmititemssetting.

This option’s settingsoverride those intransmitpagerefs andsignpagerefs.

6. Filter specific itemsbased ontransmititemrefs orsignitemrefs settings.

Keeps the itemswhose tags arespecified; overridesprevious settings ifnecessary. Settings intransmitoptions andsignoptions arerespected.

Omits the itemsspecified; overridesthe previous settingsif necessary.

This option’s settingsoverride those intransmitnamespaces,transmititems,transmitgroups,transmitpagerefs andtransmitdatagroupsor signitems,signgroups,signpagerefs andsigndatagroups.

XFDL Version 7.7 639

Page 646: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Table 294. order_of_precedence_for_filters parameters (continued)

FilterBehavior If keepflag is used

Behavior If omit flagis used Usage Details

7. Filter specificoptions based ontransmitoptionrefsand signoptionrefssettings.

Regardless of allother settings above,keeps the specificoption instancesreferred to; does notkeep any otheroptions; in the caseof items that will beomitted except for asingle option, theitem will be kept,with its original sid,and only the oneoption.

Omits the optionsspecified; overridesthe previous settingsif necessary.

This option’s settingsoverride all otherfilters, includingtransmitnamespaces,transmititems,transmitdatagroups,transmitgroups,transmititemrefs,transmitpagerefs,transmitoptions orsignitems,signdatagroups,signgroups,signitemrefs,signpagerefs, andsignoptions.

8. Filter based onsigninstance settings.

Regardless of allother settings, keepsthe data elementsindicated.

Regardless of allother settings, omitsthe data elementsindicated.

This option’s settingsoverride all otherfilters.

Example

This example uses the transmit-family of options. The order of precedence wouldbe the same for the sign-family of options.

<page sid="Page1"><global sid="global"></global><button sid="submitButton">

<value>Filter Submission</value><type>done</type><url>http://www.server.dmn/cgi-bin/processForm</url><transmitnamespaces>

<filter>omit</filter><uri>http://www.ibm.com/xmlns/prod/XFDL/Custom</uri>

</transmitnamespaces><transmititems>

<filter>omit</filter><itemtype>data</itemtype>

</transmititems><transmitdatagroups>

<filter>keep</filter><datagroupref>enclosures</datagroupref><datagroupref>related</datagroupref>

</transmitdatagroups><transmititemrefs>

<filter>omit</filter><itemref>Page1.data2</itemref>

</transmititemrefs><transmitoptions>

<filter>omit</filter><optiontype>filename</optiontype>

</transmitoptions></button><button sid="encloseButton">

<image>encloseImageData</image><type>enclose</type><datagroup>

<datagroupref>enclosures</datagroupref>

640 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 647: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<datagroupref>related</datagroupref></datagroup>

</button><data sid="data1">

<custom:id>324</custom:id><datagroup>

<datagroupref>enclosures</datagroupref></datagroup><filename>jobdescr.frm</filename><mimedata encoding="base64-gzip">dfksdfsdfhsdhs</mimedata>

</data><data sid="data2">

<datagroup><datagroupref>related</datagroupref>

</datagroup><filename>resume.doc</filename><mimedata encoding="base64-gzip">dfhsjdfsjhfjs</mimedata>

</data><data sid="encloseImageData">

<filename>c:\images\enclose.jpg</filename><mimedata encoding="base64-gzip">

aswWWW8MjfbyhsUELKKEFir8dfdUUUmnskshie3mkjkkeiIIUIUOlfRlgdsoepgejgjj1sd/3/6nnII/fjkess9Wfgjgkggkllgakkk2kl

</mimedata></data>

</page>

As a result of the filtering, the following would happen (see result formdescription below):v The custom ″id″ option would be stripped from the ″data1″ item, as a result of

the transmitnamespaces setting.v The ″encloseImageData″ data item would be stripped from the form, as a result

of the transmititems setting.v The ″data1″ data item would remain in the form, as a result of the

transmitdatagroups setting, but would not contain the custom ″id″ option.v The ″data2″ data item would be stripped from the form, as a result of the

transmititemrefs setting.v The filename option would be stripped from ″data1″, as a result of the

transmitoptions setting.

The form description that would be received once filtering was applied would looklike this:

<page sid="page1"><global sid="global"></global><button sid="submitButton">

<value>Filter Submission</value><type>done</type><url>http://www.server.dmn/cgi-bin/processForm</url><transmitnamespaces>

<filter>omit</filter><uri>http://www.ibm.com/xmlns/prod/XFDL/Custom</uri>

</transmitnamespaces><transmititems>

<filter>omit</filter><itemtype>data</itemtype>

</transmititems><transmitdatagroups>

<filter>keep</filter><datagroupref>enclosures</datagroupref><datagroupref>related</datagroupref>

</transmitdatagroups><transmititemrefs>

XFDL Version 7.7 641

Page 648: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

<filter>omit</filter><itemref>page1.data2</itemref>

</transmititemrefs><transmitoptions>

<filter>omit</filter><optiontype>filename</optiontype>

</transmitoptions></button><button sid="encloseButton">

<image>encloseImageData</image><type>enclose</type><datagroup>

<datagroupref>enclosures</datagroupref><datagroupref>related</datagroupref>

</datagroup></button><data sid="data1">

<datagroup><datagroupref>enclosures</datagroupref>

</datagroup><mimedata encoding="base64-gzip">dfksdfsdfhsdhs</mimedata>

</data></page>

Color table

You can specify a color using either the color’s name, its RGB triplet, or the hexvalue for the color. Each value in the RGB triplet is a number from 0 to 255inclusive, representing the amount of primary color (red, green or blue) required toproduce the secondary color. Zero represents the least amount of a color and 255represents the greatest amount of a color.

For example, the statement:<bgcolor>255,255,255</bgcolor>

is equivalent to:<bgcolor>white</bgcolor>

The following pages list the names and RGB triplet values for the available colors.

Note: The transparent color has no RGB equivalent.

RGB Color Name

240 248 255 alice blue

240 248 255 aliceblue

250 235 215 antique white

250 235 215 antiquewhite

255 239 219 antiquewhite1

238 223 204 antiquewhite2

205 192 176 antiquewhite3

139 131 120 antiquewhite4

127 255 212 aquamarine

127 255 212 aquamarine1

118 238 198 aquamarine2

102 205 170 aquamarine3

642 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 649: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

69 139 116 aquamarine4

240 255 255 azure

240 255 255 azure1

224 238 238 azure2

193 205 205 azure3

131 139 139 azure4

245 245 220 beige

255 228 196 bisque

255 228 196 bisque1

238 213 183 bisque2

205 183 158 bisque3

139 125 107 bisque4

0 0 0 black

255 235 205 blanched almond

255 235 205 blanchedalmond

0 0 255 blue

138 43 226 blue violet

0 0 255 blue1

0 0 238 blue2

0 0 205 blue3

0 0 139 blue4

138 43 226 blueviolet

165 42 42 brown

255 64 64 brown1

238 59 59 brown2

205 51 51 brown3

139 35 35 brown4

222 184 135 burlywood

255 211 155 burlywood1

238 197 145 burlywood2

205 170 125 burlywood3

139 115 85 burlywood4

95 158 160 cadet blue

95 158 160 cadetblue

152 245 255 cadetblue1

142 229 238 cadetblue2

122 197 205 cadetblue3

83 134 139 cadetblue4

127 255 0 chartreuse

127 255 0 chartreuse1

118 238 0 chartreuse2

XFDL Version 7.7 643

Page 650: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

102 205 0 chartreuse3

69 139 0 chartreuse4

210 105 30 chocolate

255 127 36 chocolate1

238 118 33 chocolate2

205 102 29 chocolate3

139 69 19 chocolate4

255 127 80 coral

255 114 86 coral1

238 106 80 coral2

205 91 69 coral3

139 62 47 coral4

100 149 237 cornflower blue

100 149 237 cornflowerblue

255 248 220 cornsilk

255 248 220 cornsilk1

238 232 205 cornsilk2

205 200 177 cornsilk3

139 136 120 cornsilk4

0 255 255 cyan

0 255 255 cyan1

0 238 238 cyan2

0 205 205 cyan3

0 139 139 cyan4

184 134 11 dark goldenrod

0 100 0 dark green

189 183 107 dark khaki

85 107 47 dark olive green

255 140 0 dark orange

153 50 204 dark orchid

233 150 122 dark salmon

143 188 143 dark sea green

72 61 139 dark slate blue

47 79 79 dark slate gray

47 79 79 dark slate grey

0 206 209 dark turquoise

148 0 211 dark violet

184 134 11 darkgoldenrod

255 185 15 darkgoldenrod1

238 173 14 darkgoldenrod2

205 149 12 darkgoldenrod3

644 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 651: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

139 101 8 darkgoldenrod4

0 100 0 darkgreen

189 183 107 darkkhaki

85 107 47 darkolivegreen

202 255 112 darkolivegreen1

188 238 104 darkolivegreen2

162 205 90 darkolivegreen3

110 139 61 darkolivegreen4

255 140 0 darkorange

255 127 0 darkorange1

238 118 0 darkorange2

205 102 0 darkorange3

139 69 0 darkorange4

153 50 204 darkorchid

191 62 255 darkorchid1

178 58 238 darkorchid2

154 50 205 darkorchid3

104 34 139 darkorchid4

233 150 122 darksalmon

143 188 143 darkseagreen

193 255 193 darkseagreen1

180 238 180 darkseagreen2

155 205 155 darkseagreen3

105 139 105 darkseagreen4

72 61 139 darkslateblue

47 79 79 darkslategray

151 255 255 darkslategray1

141 238 238 darkslategray2

121 205 205 darkslategray3

82 139 139 darkslategray4

47 79 79 darkslategrey

0 206 209 darkturquoise

148 0 211 darkviolet

255 20 147 deep pink

0 191 255 deep sky blue

255 20 147 deeppink

255 20 147 deeppink1

238 18 137 deeppink2

205 16 118 deeppink3

139 10 80 deeppink4

0 191 255 deepskyblue

XFDL Version 7.7 645

Page 652: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

0 191 255 deepskyblue1

0 178 238 deepskyblue2

0 154 205 deepskyblue3

0 104 139 deepskyblue4

105 105 105 dim gray

105 105 105 dim grey

105 105 105 dimgray

105 105 105 dimgrey

30 144 255 dodger blue

30 144 255 dodgerblue

30 144 255 dodgerblue1

28 134 238 dodgerblue2

24 116 205 dodgerblue3

16 78 139 dodgerblue4

178 34 34 firebrick

255 48 48 firebrick1

238 44 44 firebrick2

205 38 38 firebrick3

139 26 26 firebrick4

255 250 240 floral white

255 250 240 floralwhite

34 139 34 forest green

34 139 34 forestgreen

220 220 220 gainsboro

248 248 255 ghost white

248 248 255 ghostwhite

255 215 0 gold

255 215 0 gold1

238 201 0 gold2

205 173 0 gold3

139 117 0 gold4

218 165 32 goldenrod

255 193 37 goldenrod1

238 180 34 goldenrod2

205 155 29 goldenrod3

139 105 20 goldenrod4

192 192 192 gray

0 0 0 gray0

3 3 3 gray1

26 26 6 gray10

255 255 255 gray100

646 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 653: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

28 28 28 gray11

31 31 31 gray12

33 33 33 gray13

36 36 36 gray14

38 38 38 gray15

41 41 41 gray16

43 43 43 gray17

46 46 46 gray18

48 48 48 gray19

5 5 5 gray2

51 51 51 gray20

54 54 54 gray21

56 56 56 gray22

59 59 59 gray23

61 61 61 gray24

64 64 64 gray25

66 66 66 gray26

69 69 69 gray27

71 71 71 gray28

74 74 74 gray29

8 8 8 gray3

77 77 77 gray30

79 79 79 gray31

82 82 82 gray32

84 84 84 gray33

87 87 87 gray34

89 89 89 gray35

92 92 92 gray36

94 94 94 gray37

97 97 97 gray38

99 99 99 gray39

10 10 10 gray4

102 102 102 gray40

105 105 105 gray41

107 107 107 gray42

110 110 110 gray43

112 112 112 gray44

115 115 115 gray45

117 117 117 gray46

120 120 120 gray47

122 122 122 gray48

XFDL Version 7.7 647

Page 654: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

125 125 125 gray49

13 13 13 gray5

127 127 127 gray50

130 130 130 gray51

133 133 133 gray52

135 135 135 gray53

138 138 138 gray54

140 140 140 gray55

143 143 143 gray56

145 145 145 gray57

148 148 148 gray58

150 150 150 gray59

15 15 15 gray6

153 153 153 gray60

156 156 156 gray61

158 158 158 gray62

161 161 161 gray63

163 163 163 gray64

166 166 166 gray65

168 168 168 gray66

171 171 171 gray67

173 173 173 gray68

176 176 176 gray69

18 18 18 gray7

179 179 179 gray70

181 181 181 gray71

184 184 184 gray72

186 186 186 gray73

189 189 189 gray74

191 191 191 gray75

194 194 194 gray76

196 196 196 gray77

199 199 199 gray78

201 201 201 gray79

20 20 20 gray8

204 204 204 gray80

207 207 207 gray81

209 209 209 gray82

212 212 212 gray83

214 214 214 gray84

217 217 217 gray85

648 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 655: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

219 219 219 gray86

222 222 222 gray87

224 224 224 gray88

227 227 227 gray89

23 23 23 gray9

229 229 229 gray90

232 232 232 gray91

235 235 235 gray92

237 237 237 gray93

240 240 240 gray94

242 242 242 gray95

245 245 245 gray96

247 247 247 gray97

250 250 250 gray98

252 252 252 gray99

0 255 0 green

173 255 47 green yellow

0 255 0 green1

0 238 0 green2

0 205 0 green3

0 139 0 green4

173 255 47 greenyellow

192 192 192 grey

0 0 0 grey0

3 3 3 grey1

26 26 26 grey10

255 255 255 grey100

28 28 28 grey11

31 31 31 grey12

33 33 33 grey13

36 36 36 grey14

38 38 38 grey15

41 41 41 grey16

43 43 43 grey17

46 46 46 grey18

48 48 48 grey19

5 5 5 grey2

51 51 51 grey20

54 54 54 grey21

56 56 56 grey22

59 59 59 grey23

XFDL Version 7.7 649

Page 656: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

61 61 61 grey24

64 64 64 grey25

66 66 66 grey26

69 69 69 grey27

71 71 71 grey28

74 74 74 grey29

8 8 8 grey3

77 77 77 grey30

79 79 79 grey31

82 82 82 grey32

84 84 84 grey33

87 87 87 grey34

89 89 89 grey35

92 92 92 grey36

94 94 94 grey37

97 97 97 grey38

99 99 99 grey39

10 10 10 grey4

102 102 102 grey40

105 105 105 grey41

107 107 107 grey42

110 110 110 grey43

112 112 112 grey44

115 115 115 grey45

117 117 117 grey46

120 120 120 grey47

122 122 122 grey48

125 125 125 grey49

13 13 13 grey5

127 127 127 grey50

130 130 130 grey51

133 133 133 grey52

135 135 135 grey53

138 138 138 grey54

140 140 140 grey55

143 143 143 grey56

145 145 145 grey57

148 148 148 grey58

150 150 150 grey59

15 15 15 grey6

153 153 153 grey60

650 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 657: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

156 156 156 grey61

158 158 158 grey62

161 161 161 grey63

163 163 163 grey64

166 166 166 grey65

168 168 168 grey66

171 171 171 grey67

173 173 173 grey68

176 176 176 grey69

18 18 18 grey7

179 179 179 grey70

181 181 181 grey71

184 184 184 grey72

186 186 186 grey73

189 189 189 grey74

191 191 191 grey75

194 194 194 grey76

196 196 196 grey77

199 199 199 grey78

201 201 201 grey79

20 20 20 grey8

204 204 204 grey80

207 207 207 grey81

209 209 209 grey82

212 212 212 grey83

214 214 214 grey84

217 217 217 grey85

219 219 219 grey86

222 222 222 grey87

224 224 224 grey88

227 227 227 grey89

23 23 23 grey9

229 229 229 grey90

232 232 232 grey91

235 235 235 grey92

237 237 237 grey93

240 240 240 grey94

242 242 242 grey95

245 245 245 grey96

247 247 247 grey97

250 250 250 grey98

XFDL Version 7.7 651

Page 658: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

252 252 252 grey99

240 255 240 honeydew

240 255 240 honeydew1

224 238 224 honeydew2

193 205 193 honeydew3

131 139 131 honeydew4

255 105 180 hot pink

255 105 180 hotpink

255 110 180 hotpink1

238 106 167 hotpink2

205 96 144 hotpink3

139 58 98 hotpink4

205 92 92 indian red

205 92 92 indianred

255 106 106 indianred1

238 99 99 indianred2

205 85 85 indianred3

139 58 58 indianred4

255 255 240 ivory

255 255 240 ivory1

238 238 224 ivory2

205 205 193 ivory3

139 139 131 ivory4

240 230 140 khaki

255 246 143 khaki1

238 230 133 khaki2

205 198 115 khaki3

139 134 78 khaki4

230 230 250 lavender

255 240 245 lavender blush

255 240 245 lavenderblush

255 240 245 lavenderblush1

238 224 229 lavenderblush2

205 193 197 lavenderblush3

139 131 134 lavenderblush4

124 252 0 lawn green

124 252 0 lawngreen

255 250 205 lemon chiffon

255 250 205 lemonchiffon

255 250 205 lemonchiffon1

238 233 191 lemonchiffon2

652 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 659: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

205 201 165 lemonchiffon3

139 137 112 lemonchiffon4

173 216 230 light blue

240 128 128 light coral

224 255 255 light cyan

238 221 130 light goldenrod

250 250 210 light goldenrod yellow

211 211 211 light gray

211 211 211 light grey

255 182 193 light pink

255 160 122 light salmon

32 178 170 light sea green

135 206 250 light sky blue

132 112 255 light slate blue

119 136 153 light slate gray

119 136 153 light slate grey

176 196 222 light steel blue

255 255 224 light yellow

173 216 230 lightblue

191 239 255 lightblue1

178 223 238 lightblue2

154 192 205 lightblue3

104 131 139 lightblue4

240 128 128 lightcoral

224 255 255 lightcyan

224 255 255 lightcyan1

209 238 238 lightcyan2

180 205 205 lightcyan3

122 139 139 lightcyan4

238 221 130 lightgoldenrod

255 236 139 lightgoldenrod1

238 220 130 lightgoldenrod2

205 190 112 lightgoldenrod3

139 129 76 lightgoldenrod4

250 250 210 lightgoldenrod yellow

211 211 211 lightgray

211 211 211 lightgrey

255 182 193 lightpink

255 174 185 lightpink1

238 162 173 lightpink2

205 140 149 lightpink3

XFDL Version 7.7 653

Page 660: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

139 95 101 lightpink4

255 160 122 lightsalmon

255 160 122 lightsalmon1

238 149 114 lightsalmon2

205 129 98 lightsalmon3

139 87 66 lightsalmon4

32 178 170 lightseagreen

135 206 250 lightskyblue

176 226 255 lightskyblue1

164 211 238 lightskyblue2

141 182 205 lightskyblue3

96 123 139 lightskyblue4

132 112 255 lightslateblue

119 136 153 lightslategray

119 136 153 lightslategrey

176 196 222 lightsteelblue

202 225 255 lightsteelblue1

188 210 238 lightsteelblue2

162 181 205 lightsteelblue3

110 123 139 lightsteelblue4

255 255 224 lightyellow

255 255 224 lightyellow1

238 238 209 lightyellow2

205 205 180 lightyellow3

139 139 122 lightyellow4

50 205 50 lime green

50 205 50 limegreen

250 240 230 linen

255 0 255 magenta

255 0 255 magenta1

238 0 238 magenta2

205 0 205 magenta3

139 0 139 magenta4

176 48 96 maroon

255 52 179 maroon1

238 48 167 maroon2

205 41 144 maroon3

139 28 98 maroon4

102 205 170 medium aquamarine

0 0 205 medium blue

186 85 211 medium orchid

654 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 661: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

147 112 219 medium purple

60 179 113 medium sea green

123 104 238 medium slate blue

0 250 154 medium spring green

72 209 204 medium turquoise

199 21 133 medium violet red

102 205 170 medium aquamarine

0 0 205 mediumblue

186 85 211 mediumorchid

224 102 255 mediumorchid1

209 95 238 mediumorchid2

180 82 205 mediumorchid3

122 55 139 mediumorchid4

147 112 219 mediumpurple

171 130 255 mediumpurple1

159 121 238 mediumpurple2

137 104 205 mediumpurple3

93 71 139 mediumpurple4

60 179 113 mediumseagreen

123 104 238 mediumslateblue

0 250 154 mediumspring green

72 209 204 mediumturquoise

199 21 133 mediumvioletted

25 25 112 midnight blue

25 25 112 midnightblue

245 255 250 mint cream

245 255 250 mintcream

255 228 225 misty rose

255 228 225 mistyrose

255 228 225 mistyrose1

238 213 210 mistyrose2

205 183 181 mistyrose3

139 125 123 mistyrose4

255 228 181 moccasin

255 222 173 navajo white

255 222 173 navajowhite

255 222 173 navajowhite1

238 207 161 navajowhite2

205 179 139 navajowhite3

139 121 94 navajowhite4

0 0 128 navy

XFDL Version 7.7 655

Page 662: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

0 0 128 navy blue

0 0 128 navyblue

253 245 230 old lace

253 245 230 oldlace

107 142 35 olive drab

107 142 35 olivedrab

192 255 62 olivedrab1

179 238 58 olivedrab2

154 205 50 olivedrab3

105 139 34 olivedrab4

255 165 0 orange

255 69 0 orange red

255 165 0 orange1

238 154 0 orange2

205 133 0 orange3

139 90 0 orange4

255 69 0 orangered

255 69 0 orangered1

238 64 0 orangered2

205 55 0 orangered3

139 37 0 orangered4

218 112 214 orchid

255 131 250 orchid1

238 122 233 orchid2

205 105 201 orchid3

139 71 137 orchid4

238 232 170 pale goldenrod

152 251 152 pale green

175 238 238 pale turquoise

219 112 147 pale violet red

238 232 170 palegoldenrod

152 251 152 palegreen

154 255 154 palegreen1

144 238 144 palegreen2

124 205 124 palegreen3

84 139 84 palegreen4

175 238 238 paleturquoise

187 255 255 paleturquoise1

174 238 238 paleturquoise2

150 205 205 paleturquoise3

102 139 139 paleturquoise4

656 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 663: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

219 112 147 palevioletred

255 130 171 palevoletred1

238 121 159 palevioletred2

205 104 137 palevioletred3

139 71 93 palevioletred4

255 239 213 papaya whip

255 239 213 papayawhip

255 218 185 peach puff

255 218 185 peachpuff

255 218 185 peachpuff1

238 203 173 peachpuff2

205 175 149 peachpuff3

139 119 101 peachpuff4

205 133 63 peru

255 192 203 pink

255 181 197 pink1

238 169 184 pink2

205 145 158 pink3

139 99 108 pink4

221 160 221 plum

255 187 255 plum1

238 174 238 plum2

205 150 205 plum3

139 102 139 plum4

176 224 230 powder blue

176 224 230 powderblue

160 32 240 purple

155 48 255 purple1

145 44 238 purple2

125 38 205 purple3

85 26 139 purple4

255 0 0 red

255 0 0 red1

238 0 0 red2

205 0 0 red3

139 0 0 red4

188 143 143 rosy brown

188 143 143 rosybrown

255 193 193 rosybrown1

238 180 180 rosybrown2

205 155 155 rosybrown3

XFDL Version 7.7 657

Page 664: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

139 105 105 rosybrown4

65 105 225 royal blue

65 105 225 royalblue

72 118 255 royalblue1

67 110 238 royalblue2

58 95 205 royalblue3

39 64 139 royalblue4

139 69 19 saddle brown

139 69 19 saddlebrown

250 128 114 salmon

255 140 105 salmon1

238 130 98 salmon2

205 112 84 salmon3

139 76 57 salmon4

244 164 96 sandy brown

244 164 96 sandybrown

46 139 87 sea green

46 139 87 seagreen

84 255 159 seagreen1

78 238 148 seagreen2

67 205 128 seagreen3

46 139 87 seagreen4

255 245 238 seashell

255 245 238 seashell1

238 229 222 seashell2

205 197 191 seashell3

139 134 130 seashell4

160 82 45 sienna

255 130 71 sienna1

238 121 66 sienna2

205 104 57 sienna3

139 71 38 sienna4

135 206 235 sky blue

135 206 235 skyblue

135 206 255 skyblue1

126 192 238 skyblue2

108 166 205 skyblue3

74 112 139 skyblue4

106 90 205 slate blue

112 128 144 slate gray

112 128 144 slate grey

658 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 665: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

106 90 205 slateblue

131 111 255 slateblue1

122 103 238 slateblue2

105 89 205 slateblue3

71 60 139 slateblue4

112 128 144 slategray

198 226 255 slategray1

185 211 238 slategray2

159 182 205 slategray3

108 123 139 slategray4

112 128 144 slategrey

255 250 250 snow

255 250 250 snow1

238 233 233 snow2

205 201 201 snow3

139 137 137 snow4

0 255 127 spring green

0 255 127 springgreen

0 255 127 springgreen1

0 238 118 springgreen2

0 205 102 springgreen3

0 139 69 springgreen4

70 130 180 steel blue

70 130 180 steelblue

99 184 255 steelblue1

92 172 238 steelblue2

79 148 205 steelblue3

54 100 139 steelblue4

210 180 140 tan

255 165 79 tan1

238 154 73 tan2

205 133 63 tan3

139 90 43 tan4

216 191 216 thistle

255 225 255 thistle1

238 210 238 thistle2

205 181 205 thistle3

139 123 139 thistle4

255 99 71 tomato

255 99 71 tomato1

238 92 66 tomato2

XFDL Version 7.7 659

Page 666: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

RGB Color Name

205 79 57 tomato3

139 54 38 tomato4

64 224 208 turquoise

0 245 255 turquoise1

0 229 238 turquoise2

0 197 205 turquoise3

0 134 139 turquoise4

238 130 238 violet

208 32 144 violet red

208 32 144 violetred

255 62 150 violetred1

238 58 140 violetred2

205 50 120 violetred3

139 34 82 violetred4

245 222 179 wheat

255 231 186 wheat1

238 216 174 wheat2

205 186 150 wheat3

139 126 102 wheat4

255 255 255 white

245 245 245 white smoke

245 245 245 WhiteSmoke

255 255 0 yellow

154 205 50 yellow green

255 255 0 yellow1

238 238 0 yellow2

205 205 0 yellow3

139 139 0 yellow4

154 205 50 yellowgreen

The XFDL compute systemAn XFDL compute is an expression that controls the character content of anelement at or below the element depth of an XFDL option.

XFDL computes can be defined for custom options that are not in the XFDLnamespace (a common practice used for computing intermediate results), but insuch cases, the attribute must be properly namespace qualified (e.g. usexfdl:compute where the namespace prefix ’xfdl’ is associated with the XFDLnamespace URI). The XFDL compute expression appears in a compute attribute.This section defines the infix notation for XFDL compute expressions.

Most XFDL processors only need to preserve the compute as character data, butsome applications must parse the text of computes and construct expression tree

660 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 667: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

data structures to represent all computes in a form. This is necessary if theapplication must change the content of options or suboptions that are referred toby a compute. This section describes the syntax and operation of computes.

White space in computesXFDL computes automatically support the notion of free form text found in mostprogramming languages. With the exception of the contents of quoted strings (see“Quoted strings” on page 664) and both static and dynamic references (see “XFDLreferences to elements” on page 665), unlimited white space is permitted. AddingS? before and after every lexical token in every BNF rule in this section wouldunnecessarily obfuscate the presentation of what is essentially the standard BNFfor mathematical and conditional expressions. Therefore, it is stated once here forthe reader that all white space appearing outside of quoted strings and otherlexical tokens is ignored.

While white space is formally ignored, there do arise cases in which it is necessaryto use white space to properly communicate the expression. These situations arisebecause lexical analyzers are ’greedy’ in the sense that they will match as much ofa substring to the current token as possible. For example, in the Boolean test a==band c==d, the spaces before and after the keyword ’and’ are required because theelement reference token that matches ’a’, ’b’, ’c’ and ’d’ also matches ’band’, ’andc’and ’bandc’.

The XFDL compute is a normal XML attribute and is therefore subject to all of thenormal XML processing rules associated with attributes of the default type(CDATA). This includes white space normalization as well as entity and characterreference resolution. An XML parser is expected to convert each tab or newlinecharacter into a space, so these characters should be avoided when text editing.XML processors capable of serialization are expected to encode tabs and new linesin attribute values as character references since the attribute value normalizationon input implies that these characters would not be in the attribute value if theywere not encoded as character references in the input. In raw XML text, a new lineis encoded as &#xA; which a subsequent XML parser will decode into a new linecharacter in the attribute value.

Multiline computesDue to XML attribute value normalization, linefeeds are converted to spaces.Therefore, normal XML processing turns a multiline compute that has beencarefully laid out by its author into a single line compute. To alleviate thisproblem, form authors are encouraged to put the character reference &#xA; at theend of each line of a multiline compute attribute.

A normal XML processor that reads &#xA; followed by a new-line character willtranslate the value to a real new-line followed by a space. The serializationalgorithm of an XML processor will then output the reference &#xA; for the realnew-line followed by a space. A subsequent parse by an XML processor willproduce a real new-line followed by a space. Therefore, it is recommended thatXFDL processors (which uses a normal XML processor for parsing input) serializea real new-line followed by a space as the reference &#xA; followed by a new-line,which this restores the multi-line appearance of computes. This behavior must notbe performed when serializing the XML for a digital signature.

Structure of mathematical and conditional expressionsAn XFDL compute can be either a mathematical or conditional expression.

XFDL Version 7.7 661

Page 668: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

A conditional expression has three parts separated by the ternary ?: operator. Thefirst part is a Decision, which yields a Boolean result. The consequences for a trueand false boolean result recurse to the definition of Compute, permitting arbitrarynesting of decision logic.

[49] Compute ::= Expr | Decision '?' Compute ':' Compute

The decision logic can apply logical-or (|| or ’or’), logical-and (&& or ’and’), andlogical negation (!) to the results of logical comparisons. The logical operators areleft associative, and the comparison operators cannot be chained (e.g. a < b < c isillegal). The order of operations gives greatest precedence to negation, thenlogical-and, and least precedence to logical-or. To override this, parentheses can beused (e.g., the parentheses in (a<b || c<d) && e!=f cause the logical-or to occurfirst, and no parentheses are required if the logical-and should be performed first).

[50] Decision ::= Decision ('||' | 'or') AndDecision | AndDecision

[51] AndDecision ::= AndDecision ('&&' | 'and') NotDecision | NotDecision

[52] NotDecision ::= '!' Comparison | Comparison

[53] Comparison ::= '(' Decision ')' | Expr ('<' | '>' | '<=' | '>=' | '==' |'!=') Expr

A mathematical expression, denoted Expr, can include addition, subtraction, stringconcatenation (+.), multiplication, division, integer modulus, unary minus, andexponentiation. All mathematical operators are left associative except unary minusand exponentiation. Further, proper order of operations is observed. Parenthesescan be used to override the order of operations as shown in the non-terminalsymbol named Value (defined later).

[54] Expr ::= Expr '+' Term | Expr '-' Term | Expr '+.' Term | Term

[55] Term ::= Term '*' NFactor | Term '/' NFactor | Term '%' NFactor | NFactor

[56] Nfactor ::= Factor | '-' Factor

[57] Factor ::= Value '^' NFactor | Value

Table of operators

The following table details the operators permitted in XFDL:

Type of Operator Symbol Operation

Additive +

- (minus)

+.

addition

subtraction

concatenation

Multiplicative *

/

%

multiplication

division

modulus (returns remainder)

Exponentiation ^ exponential

662 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 669: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Type of Operator Symbol Operation

Relational >

<

<=

>=

==

!=

greater than

less than

less than or equal to

greater than or equal to

equal to

not equal to

Logical &&

and

||

or

!Note: The reserved words’and’ and ’or’ are casesensitive. Always uselower case.

AND

AND

OR

OR

NOT

units ( ... )x brackets used to enclosemathematical units. For example,

x * (y + z)

Unary Minus - (minus) take negative

Decision x?y:z assign the value of expression y tothe result if expression x evaluates totrue. Otherwise, assign the value ofexpression z to the result.

Assignment = assign right operand to left operand

Membership . (dot)

[ ]

->

structure membership

array membership

indirect membership

Precedence of operations

Operations are evaluated in the following order:v membershipv exponentiationv multiplicative and unary minusv additivev relationalv logical NOTv logical ANDv logical ORv conditional

XFDL Version 7.7 663

Page 670: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Decision operations and namespace qualificationBoth decision operations and namespace use the colon (:) character as a token. Insome cases, this makes it difficult to determine which colon is the decisionoperator token and which colon is the namespace token. For example, consider thefollowing expression:

x ? custom:y : z

This is a variation on the common ″if x then y, else z″ expression. In thisexpression, the y statement is intended to be in the ″custom″ namespace. However,as it is currently written the expression does not clearly define which colonrepresents namespace and which colon represents the end of the y statement.

In cases such as these, parentheses should enclose the y statement of theexpression, thereby providing a clear indication of where the y statement ends. Forexample:

x ? (custom:y) : z

Illegal characters in XML attributesSome special characters are not permitted in XML attribute values.

Note that the ampersand (&) and less-than (<) characters are not permitted in XMLattribute values. Since XFDL computes appear in a compute attribute, these mustbe escaped with character or entity references (e.g. the entity references &amp; forthe ampersand and &lt; for the less-than character). Hence, the less-than-or-equalsymbol (<=) could be encoded as ’ &lt;=’.

Definition of valueA value can be any of:v a compute in parentheses, which provides an override for the order of

operations.v a quoted string (see “Quoted strings”).v an XFDL reference to an element whose text data should be obtained when the

compute is evaluated (see “XFDL references to elements” on page 665).v the result of a function call (Section 3.8 Function Call Syntax).

[58] Value ::= '(' Compute ')' | qstring | XFDLReference | FunctionCall

Quoted stringsA quoted string is used to express a literal value in XFDL. The language rules forcomputes permit the recognition of a quoted string token using the italicized tokenname qstring. White space before the open quote and after the close quote isignored. Because XML allows attribute values to be either singly or doubly quoted,the XFDL compute expression syntax allows both single and double quotes so thatthe XFDL author can avoid the use of entity references. Within an XFDL quotedstring, any character is allowed except for the type of quote mark used to start thequoted string. Quoted strings can also be of arbitrary length in XFDL. To increasehuman readability, XFDL supports multiline string continuation. If the nextnon-white space character appearing after a closing quote is an open quote, thenthe closing quote, white space, and open quote are discarded from the inputstream.

[59] qstring ::= (('"' [^"]* '"') | (''' [^']* '''))+

664 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 671: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

A literal must be quoted regardless of its type (i.e. character strings, numericvalues, dates and so forth must all be quoted). However, the quoted string is in theXFDL compute attribute value, which is a quoted string in XML. Therefore, ifdouble quotes are used to surround the compute expression, then literals musteither be expressed with single quotes or by using character or entity references fordouble quotes (e.g. the entity reference &quot;). Likewise, if the compute attributeis surrounded by single quotes, then either double quotes must be used for thequoted strings or character or entity references (such as &apos;) must be used toexpress quoted strings.

Occasionally a literal value simply must include the type of quote mark used tosurround the literal. In such cases, the XFDL author can either use entity referencesto surround the literal value or use backslash (\) escaping. For example, \’ can beused to place a single quote in an XFDL quoted string that is surrounded by singlequotes.

Backslash escaping is also supported for several other characters. The escapesequences \n and \t result in a new line and a tab, respectively, in the quotedstring content. Since the backslash is the escaping character, it must also beescaped to be inserted into the string content (e.g., \\).

Note that since a quoted string is meant to be interpreted by the XFDL computeexpression parser rather than the XML processor, it is recommended that backslashescaping be used rather than XML character and entity references. However, it issafe to use the XML mechanisms except for encoding a new-line in a quoted string.The special processing performed by XFDL processors to preserve the text layoutof multiline computes may conflict with the use of an XML character reference fora new-line if it is followed by a space (please see “Multiline computes” on page661). While correct processing will still result due to attribute value normalizationon the next parse, the text layout and surface string of the XFDL will be changed.

XFDL references to elementsThe simple character content of options and suboptions are obtained as theoperands of XFDL compute expressions using XFDL references. XFDL referencessupport forward and backward referencing. An XFDL reference can refer to anyoption or array element with simple character content.

The element containing the desired character content is identified using scopeidentifiers to negotiate a path through the parse tree. To traverse through the pageand item levels and identify an option, the well-known ’dot’ membership operatoris used. The well-known square-bracket array notation can then be used to accesssuboptions to arbitrary element depth. For example, Page2.Field2.value would accessthe option with tag name <value> in the <field> element having a sid of Field2 inthe <page> having a sid of Page2.

Because each XFDL element’s scope identifier (sid) is used to uniquely identify anelement only within the surrounding parent element, XFDL can support relativereferencing. For example, in an element identified as Field1, if a computationincludes the reference Field2.value, this means that the character data of the valueoption in the item Field2 on the same page will be obtained. If Field2 is on aseparate page, say Page2, then a compute in Field1 can still access its value usingthe fully-qualified reference Page2.Field2.value.

The context for interpreting a reference is also decided based on the form of thereference itself in combination with its location in the form. For example, in the

XFDL Version 7.7 665

Page 672: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XFDL below, the reference Bill.value appears in a compute that is attached to agrand-child suboption of the format option. However, the name after the rightmost’dot’ operator always refers to an option, and the name before the rightmost dotalways refers to an item. Since the page is not specified, it is determined to be thepage containing the reference.

<page sid= "CreditCardApp"><field sid="Bill">

<label>Your monthly bill is:</label><value>700</value><readonly>on</readonly>

</field><field sid="MinPayment">

<label>Enter payment amount:</label><value></value><format>

<datatype>currency</datatype><range>

<min compute="Bill.value * '0.05'">35</min><max compute="Bill.value">700</max>

</range></format>

</field></page>

XFDL references can also grow arbitrarily below the option level using the arraynotation, allowing access to unbounded array element depth within any option. Ifan array element is not named, then the zero-based numeric position of the arrayelement is used in the square brackets. If the array element is named, then thescope identifier can be used in the square brackets. For example, given the formatoption of the XFDL above, the reference format[0] yields dollar and the referenceformat[range][1] yields 700. If a suboption is named, the numeric position can stillbe used, e.g. format[1][1] also yields 700.

The above description covers static references. The XFDL referencing model alsosupports dynamic references. The left associative ’arrow’ operator (->), also knownas the indirect membership operator, expects to receive a static or dynamicreference as a left operand. The run-time value of the static or dynamic referencemust conform to the syntax of the ItemRef non-terminal. The right operand of theindirect membership operator is an option reference. At run-time, the left operandis evaluated, yielding a static item reference to an XML element representing anXFDL item. This run-time item reference is combined with the right operand of theindirect membership operator to yield an option or array element whose simpledata is the result of the evaluation.

The simplest example of a dynamic reference is retrieving the text of the selectedcell in an XFDL list box or popup, as is discussed in “Details on XFDL items” onpage 29, because the value option of a list or popup is equal to the item referenceof the selected cell item. Thus, given an example popup that offers a selection ofdays of the week, the text for the day of week selected by the user is obtained byPopup_DayOfWeek.value->value.

An option reference can simply refer to element tag names in the XFDL namespacewithout any namespace qualification. A namespace qualified scope identifier (thenon-terminal NSsid below) must be used if the element being referenced is not inthe XFDL namespace. In order to reference element in the empty namespace, XFDLsupports the predeclared prefix null. For example, to reference an element E whichhas an empty namespace URI, use the reference null:E.

666 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 673: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Below are the syntax rules for an XFDL reference. Note that unlike most othersyntax rules for XFDL expressions, intervening white space is not allowed in anXFDL reference. An XFDL reference is treated as a single lexical token.

[60] XFDLReference ::= StaticRef | StaticRef '->' DynamicRef

[61] StaticRef ::= ItemRef '.' OptionRef | OptionRef

[62] ItemRef ::= ((sid '.')? sid '.')? sid

[63] DynamicRef ::= DynamicRef '->' OptionRef | OptionRef

[64] OptionRef ::= NSsid ('[' (Digit+ | NSsid) ']')*

[65] NSsid ::= sid | (Letter (Letter | Digit | '_')*) ':' sid

Referencing the XFDL versionSince the XFDL version is represented by the XFDL namespace URI declaration inthe root XFDL node, the normal page.item.option notation cannot reference theversion number directly. However, as a convenience, it is allowable to refer theXFDL version as a global form option, as follows:

global.global.version

XFDL processors are expected to recognize this notation.

Function call syntaxFunction calls run code that may be external to the XFDL form definition.

A set of predefined functions (called system functions) for doing standardmathematical operations, string manipulations, and so on, is given in “Details onXForms items” on page 58. The LibName allows functions to be grouped intoseparate namespaces, but the predefined system functions do not require aLibName. The names of the system functions are considered reserved words andshould not be used as function names in other function libraries.

[66] FunctionCall := (LibName '.')? FunctionName '(' (Compute (','Compute)*)? ')'

[67] LibName ::= sid

[68] FunctionName ::= sid

Representing and running XFDL computesThis section describes how XFDL computes are represented and run, includingdependencies, references and limitations.

IntroductionThe XFDL compute engine implements a ’declarative’ computation system. Thebehavior of the algorithm is similar to that of a spreadsheet. Complicating factorsfor XFDL include dynamic references and side effect functions such as set(). Whena form is first started, many nodes with computed values may need to beevaluated to find current display values. After the form is started, any specificchange to a given node should result in updates to computationally dependentnodes. Further, the process is recursive in that when a computationally dependentnode is updated, then it may have further computationally dependent nodes thatmust be queued for update.

XFDL Version 7.7 667

Page 674: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The XFDL specification provides an abstract version of the desired algorithm, butdoes not place specific constraints on the data structure used to represent thecompute system.

Cached dependency listsOn form startup, the compute system associates with each form node F a list ofother form nodes that are computationally dependent on F.

A node is dependent on F if a reference to F appears in the node’s compute. Figure1 expresses the XFDL compute engine algorithm based on utilizing thesedependency lists. The dependency lists are viewed as a directed graph, or digraph,of computational dependencies.

Each form node will have several flags associated with it: Visited, OnStack,Processed, Processing, and UsedToDeref. The Visited flag is require by depth firstsearch. The OnStack flag prevents duplicate entries on the stack, which preventscircular referencing. The Processed flag is used in conjunction with OnStack toallow a form node to stay on the stack but not be processed again when the formnode’s dependencies have all been processed. The pProcessing flag is used whenXFDLRunComputes() is called recursively from within the eval() function (sideeffect functions such as set() call UFLSetLiteral(), so the compute system is calledrecursively during their evaluation). The Processing flag tells XFDLRunComputes()to terminate, returning control to eval(). The UsedToDeref flag indicates whether agiven form node’s literal value is being used by any compute in the form todereference another form node (explained in the next section). If this flag is set,then changing the node’s literal will cause a change to the dependencies in theform.

The dependency lists referred to in Figure 1 are constructed at build time. For eachcompute CI, the function CreateRefList() traverses the compute parse tree for allreferences to existing nodes. For each reference in CI to a form node FR, the formnode FP (the parent node containing CI) is added to the dependency list of FR,except when FP is equal to FR (this exception allows support for self-referentialcomputes as discussed below). Thus, when a node FR changes, the new algorithmhas a prebuilt list of dependent computes that must be re-evaluated.

The outermost loop of the new algorithm runs until it reaches quiescent state (inother words, it achieves closure on the change to element E). When E is null, thenew algorithm pushes all computes for reevaluation. The inner loops of theoriginal algorithm in Figure 1 were mainly designed to find which computes werepertinent (in other words, which ones needed to be re-evaluated). In the newalgorithm, the new pertinent vertices of a changed vertex FP are immediatelyknown due to the precomputation of the dependency lists.

The implied behavior of the outermost loop is that it should terminate if there is acircular reference other than a self-reference. By omitting a node from its owndependency list, self-referential computes do not become circular references.However, circular references involving more than one node can be expressed usingstatic references (for example, A=B, B=C, C=A), dynamic references, or evenindirect referencing via XFDL function calls (for example, the assignment X =A+set(″A″, A+ ″1″)). To prevent circular referencing, the algorithm uses aChangeStack rather than a ChangeList (queue), and it uses the flags OnStack andProcessed to implement a depth first search, which is an algorithm that findscycles in a search space. Push() will not push a node already on the stack.

668 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 675: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Note, however, that we do not generate an error when a duplicate is found on thechange stack. This is because the loop initialization pushes all computes when E isnull. Thus, there are valid cases where we want to ignore the duplication withoutgenerating an error. Reporting true circular references can be done using a depthfirst search at design time with the compute system turned off.

Topological sortingWhen a node E changes, the function ProcessLiteralChange() does not simply pushthe elements in its dependency list, which would make XFDLRunComputes asimple depth first search of a digraph. Instead, it calls DFSPush(), which exploresthe computational dependencies of E using a depth first search. In other words, Eis treated as the root of a depth first search tree of computational dependencies.DFSPush() does not push E until it has visited all of E’s descendants (post-ordervisitation of the DFS tree). This has the effect of placing the dependencies in alinear order on the change stack (linear ordering in a directed acyclic graph is

RunXFDLComputes(F (form), C (computes), E (a changed element or null)) ::=If E is not null, then ProcessLiteralChange(F, E)Else For each c ∈ C, ParentFormNode(c).Visited = 0

For each c ∈ C,If not ParentFormNode(c).Visited,

DFSPush(F, ParentFormNode(c))For each c ∈ C, ParentFormNode(c).Visited = 0

While not Empty(F.ChangeStack) and not TopStack(F.ChangeStack).processing DoFP = TopStack(F.ChangeStack)If FP.Processed, then Pop(F.ChangeStack);else FP.processing = on

Literal = eval(ChildComputeNode(FP), F.ChangeStack)If cval(FP) ≠ Literal, then

cval(FP) = LiteralProcessLiteralChange(F, FP)

FP.processing = offFP.Processed = on

ProcessLiteralChange(F, E) ::=If E.UsedToDeref, then

ProcessDependencyChanges(F, E)DFSPush(F, E)For each entry e of F.ChangeStack from top to bottom,

If e.Visited, then e.Visited = 0Else break loop

F.TotalChangeList = F.TotalChangeList � EDFSPush(F, E) ::=E.visited = 1For each f ∈ DependencyList(E)

If not f.Visited and not f.OnStackDFSPushComputes(F, f)

Push(F.ChangeStack, E)ProcessDependencyChanges(F, E) ::=For each f ∈ DerefSubset(DependencyList(E)),

NewRefList = CreateRefList(f, F)For each r ∈ (f.RefList � NewRefList) - (f.RefList � NewRefList)

If r ∈ f.RefList, thenDependencyList(r) = DependencyList(r) - f

ElseDependencyList(r) = DependencyList(r) + f

f.RefList = NewRefListPop(S) ::= f = S.Pop(); f.OnStack = f.Processed = offPush(S, f) ::= if not f.OnStack, then

S.Push(f);f.OnStack=on;f.Processed=off

Figure 3. Algorithm Sketch for XFDL Compute Engine

XFDL Version 7.7 669

Page 676: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

called topological sorting). Since an element E appears on the stack above itsdescendants, it is re-evaluated before its descendants. Since E’s descendants aredependent on E, evaluating E before its descendants ensures that E will have thecorrect value before its descendants are evaluated.

Because the dependency graph is directed, it is still possible for a depth first searchto take exponential time because it must explore a subtree rooted at r for eachparent of r. The directed graph can be acyclic even though the correspondingundirected graph has cycles. If those cycles have a repeated structure (such asmight be found in a form with many rows of identical construction), the work oneach row can be constant but the work of a row may occur once for each change tothe preceding row. If each row requires at least two units of work, then thecomputation is exponential in the number of rows.

Handling dynamic ReferencesA dynamic reference is a compute that includes the use of the arrow operator toobtain a value by dereferencing other values in the form.

Dynamic references imply changes to the dependency lists during run-time. Anumber of enhancements are required to solve this problem efficiently.

The dependency list of each form node will be segregated into normaldependencies and dereference dependencies. The form node’s UsedToDeref flagwill be set if and only if its dependency list contains dereference dependencies.After changing the literal value of a form node whose UsedToDeref flag is set,certain dependencies will need to be re-evaluated (described below).

For each form node f containing a compute, we store a ReferenceList containing allform nodes referred to within the compute. Again, the list will be segregated intonormal and dereference references. All subreferences in a dynamic reference exceptfor the rightmost reference are classified as dereference dependencies. For example,in a compute containing popup.value->value, if the popup’s value is ″cell1″, thenthe literal of popup.value is dereferenced, but cell1.value is not. This distinction isimportant because a change to popup.value will cause dependency changeswhereas changing cell1.value will not.

Actually, the reference list of each compute must already be built as part of settingup the dependency lists. The reference lists are required since, for each form nodeFP in f.ReferenceList, we must add f to FP.DependencyList. Now we are simplydeciding to retain the list for use in solving problems introduced by dynamicreferences. So, while building dependency lists, if FP is classified as a dereferencein f.ReferenceList, then f will be classified added a dereference dependency inFP.DependencyList.

The ProcessDependencyChanges() function mentioned in Figure 1 can thenrebuild the dependency lists efficiently. When processing a stack entry FP, if theUsedToDeref flag is set, then some dependency lists may need to be changed. Aform node f is considered to be in the ’dereference’ portion of FP.DependencyList.Begin by creating a new reference list for f. Any form node FP in f.ReferenceList butnot in the new reference list implies the removal of the dependency entry f fromFP.DependencyList. Any form node FP not in f. ReferenceList but in the newreference list implies the addition of the dependency entry f to FP.DependencyList.Finally, the new reference list is assigned to f.ReferenceList.

Note that most of the dependency changes involve the addition and deletion of’normal’ references and dependencies. For example, given a form node f with a

670 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 677: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

compute of popup.value->value, if popup.value were to change from ″cell1″ to″cell2″, then the ’normal’ entry of ″cell1″ in the

Note: f.ReferenceList would be deleted, and a ’normal’ entry of ″cell2″ would beadded. Furthermore, the normal dependency on f would be removed from incell1.DependencyList and added to cell2.DependencyList. It is possible thatreference list and dependency list entries of type ’dereference’ can also bemodified. An example would be a double dereference; in other words, the changeof x.value in a form containing the compute x.value->value->value. Thus, an entryf in FP.DependencyList is a dereference if changing node FP implies the need torebuild f.ReferenceList (which in turn implies changes to other dependency lists,possibly including FP.DependencyList).

The statements above assert that the algorithm will only rebuild the references listsof nodes marked as ’dereference’ dependencies in FP.DependencyList. Due to thehigh cost of calling UFLDereference(), the algorithm should not rebuild referencelist entries that result from static references. Static reference nodes aredistinguished from dynamic reference nodes in the compute tree. Note that theleftmost subreference of a dynamic reference is also static, so it will also not berecomputed. Instead, the value in the reference cache will be used (see section“Reference caching”).

Reference cachingWhen a compute is parsed into a parse tree of compute nodes, the nodesrepresenting static references currently cache the results of UFLDereference() sothat future evaluations of the compute can proceed without a costly search of theform.

Although the ReferenceList of each node contains all references, these cachedreferences are stored in compute nodes for instantaneous access by eval().

In the current API, caching of dynamic references was not performed because theimplementation had no way of knowing whether a change occurred that wouldaffect the validity of the cached value. The algorithm is able to cache dynamicreferences. When the ReferenceList of a given form node is reconstructed, thedynamic references in the compute node associated with that form node will alsobe re-evaluated and re-cached.

Note that dynamic references call UFLDereference() once for the leftmostsubreference plus once per arrow in the dynamic reference. The reference cachewill cache the last UFLDereference() as this is the final results required by theeval() function. However, the first UFLDereference() on the leftmost subreferencewill also be cached. The leftmost subreference is static, so storing it can be used tooptimize the process of resolving dependency changes (see “Handling dynamicReferences” on page 670).

Re-entrancyXFDLRunComputes() is no longer shown as returning a value. This is because thereturned change list, formerly denoted Z, is actually a property of the form F andis now denoted F.TotalChangeList. This member is initialized to emptiness whenthe form is first created. It is updated by running computes, but it is onlyreinitialized to emptiness when an application takes ownership of the list from theform. This allows an application to make numerous changes to the form beforeusing the F.TotalChangeList to update structures external to the form (such as adatabase or a corresponding GUI).

XFDL Version 7.7 671

Page 678: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

The change list itself is now also a property of the form, denoted F.ChangeStack,and it also is initialized to emptiness during form creation. Notice that it is notinitialized to emptiness at the start of run computes. This is done to supportre-entrancy. If the call to eval() runs a side effect function that in turn callsUFLSetLiteral(), then XFDLRunComputes() will be reinvoked. The new functioninstance will continue attempting to process the same change stack. Since thechange stack forbids duplicates, XFDLRunComputes() cannot recurse indefinitelyon a form of bounded size (side-effect functions such as duplicate() can create newpieces of form with each run, so if the duplicate() duplicates itself, an infinite loopcan occur). When the instance of XFDLRunComputes() that was called recursivelyencounters a stack entry marked ’processing’, this indicates that it is time to returnback to eval(), which ultimately returns to the previous instance ofXFDLRunComputes().

Duplicate entries on the total change listThe algorithm in Figure 1 explicitly shows how it uses the OnStack and Processedflags of each form node to prevent duplicate entries in the change stack. Thealgorithm also uses the set union operator to indicate that duplicates will not beallowed on the TotalChangeList. This is done using another flag, OnChangeList,which is cleared on form node creation. An attempt to add a form node to theTotalChangeList is preceded by a test of this flag. If it is set, then the form node isalready on the change list and will not be added again. If the flag is clear, then theform node will be added to the TotalChangeList, then its OnChangeList flag willbe set.

When the API function UFLGetChangeList() is called, the OnChangeList flags ofeach element in the TotalChangeList must be cleared before passing ownership ofthe TotalChangeList from the form to the API caller.

Missing ReferencesIf an XFDL reference refers to a non-existent element or an element with arraycontent, then the reference simply resolves to the empty string. If a dynamicsubreference (i.e. the left operand of the dereference operator) refers to anon-existent element, then the containing compute is disabled. If the desired formnode is created later, the compute is immediately re-activated.

Handling of element deletionIf an element contains a compute and you want to delete the element, you need toremove any dependencies associated with the compute.

When an element is deleted, it may contain a compute. The XFDL processor mustremove dependency list entries associated with the elements referenced by thecompute expression being destroyed. Moreover, references to the element beingdeleted may appear on change lists and reference caches in the compute system.These must be removed as well. If a compute refers to an element that is beingdeleted, then the compute will be handled according to the rules for missingreferences (see the previous section for how these are handled).

LimitationsIt is possible to create cases in which the algorithm halts a sequence ofcomputations that do not technically form circular logic, especially when side effectfunctions such as set() are used. In other words, the case would halt by itself if thealgorithm would allow duplicates on the change stack. However, there is adifference between circular logic and circular references. According to the XFDL

672 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 679: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

specification, circular referencing is forbidden (except for self references), and thecompute system simply does not continue evaluation of a node C that is alreadyon the stack.

A second limitation, also involving side effect functions, can actually cause aninfinite loop in the algorithm. The problem occurs when a side effect functioncreates a new portion of the form. If the new portion of the form containscomputations that cause the continued recursive creation of new portions of theform, then each new portion of form has elements that are distinct from allprevious elements and hence do not technically even cause a circular reference. Adepth first search halts on any form of finite size, but if computations result inunbounded form growth, then it is correct behavior for a depth first search to runindefinitely exploring the new regions of the form.

A third limitation is that a given compute may still be fired more than once. This isnot the result of circular reference in the dependency digraph but rather that thesame descendant is reachable along multiple paths (the undirected graphcorresponding to the dependency digraph has cycles, but the digraph contains noway to get from the descendant back to the ancestor). In other words, a node r hasmultiple parents because a depth first search of a digraph can yield multiple DFStrees each containing r with one of its parents.

To solve this problem with static references only, a linear ordering could be createdfor the directed acyclic graph of dependencies, and the edges of each node couldbe resorted (in linear total time) so that the push order would respect the linearordering. However, this approach is impractical for XFDL. Due to dynamicreferencing, the linear ordering would need to be maintained dynamically.Furthermore, dynamic changes to the linear ordering would cause dynamicchanges to the order of elements in the change stack. More advanced methodscould be developed to account for this, but the problem expands when the implicitdependencies introduced by side effect functions are taken into account. Althoughthe compute system could run faster by running less computes, the cost ofoperations necessary to account for dynamic references is prohibitive, andimplementing the method would not be worth the trouble due to the inability toachieve correctness with side effect functions. Thus, the linear ordering imposed byDFSPush() is temporal, and changes to nodes used in dynamic references mayinvalidate the order such that extra computes will sometimes run more than once.Those who wish to prevent functions such as viewer.messageBox from runningmore than once must still resort to protecting these computes with conditionallogic and the toggle() function.

XForms and XFDL computesXForms provides its own methods to compute values for data that is in theXForms model. However, in some cases it may be either preferable or necessary touse XFDL computes. For example, XFDL computes are required to make changesto the presentation layer that are not related to data, such as color changes and soon.

In general, using XForms computes to manipulate data and XFDL computes tomanipulate the presentation layer will create a clean separation of duties thatcreates few conflicts. However, be aware that when a form is first loaded, theXForms engine overwrites all value and rtf options that are linked to the model bya single node binding. This means that any XFDL computes on those options willbe removed from the form.

XFDL Version 7.7 673

Page 680: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

674 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 681: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Notices

This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document inother countries. Consult your local IBM representative for information on theproducts and services currently available in your area. Any reference to an IBMproduct, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product,program, or service that does not infringe any IBM intellectual property right maybe used instead. However, it is the user’s responsibility to evaluate and verify theoperation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matterdescribed in this document. The furnishing of this document does not grant youany license to these patents. You can send license inquiries, in writing, to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.

For license inquiries regarding double-byte (DBCS) information, contact the IBMIntellectual Property Department in your country or send inquiries, in writing, to:

IBM World Trade Asia CorporationLicensing2-31 Roppongi 3-chome, Minato-kuTokyo 106-0032, Japan

The following paragraph does not apply to the United Kingdom or any othercountry where such provisions are inconsistent with local law: INTERNATIONALBUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION ″AS IS″WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFNON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULARPURPOSE. Some states do not allow disclaimer of express or implied warranties incertain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors.Changes are periodically made to the information herein; these changes will beincorporated in new editions of the publication. IBM may make improvementsand/or changes in the product(s) and/or the program(s) described in thispublication at any time without notice.

Any references in this information to non-IBM Web sites are provided forconvenience only and do not in any manner serve as an endorsement of those Websites. The materials at those Web sites are not part of the materials for this IBMproduct and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way itbelieves appropriate without incurring any obligation to you.

© Copyright IBM Corp. 2003, 2009 675

Page 682: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Licensees of this program who wish to have information about it for the purposeof enabling: (i) the exchange of information between independently createdprograms and other programs (including this one) and (ii) the mutual use of theinformation which has been exchanged, should contact:

IBM CorporationOffice 4360One Rogers StreetCambridge, MA 02142U.S.A.

Such information may be available, subject to appropriate terms and conditions,including in some cases, payment of a fee.

The licensed program described in this document and all licensed materialavailable for it are provided by IBM under terms of the IBM Customer Agreement,IBM International Program License Agreement or any equivalent agreementbetween us.

TrademarksIBM, the IBM logo, ibm.com, Lotus, and Notes are trademarks or registeredtrademarks of International Business Machines Corporation in the United States,other countries, or both. These and other IBM trademarked terms are marked ontheir first occurrence in this information with the appropriate symbol (® or ™),indicating US registered or common law trademarks owned by IBM at the timethis information was published. Such trademarks may also be registered orcommon law trademarks in other countries. A current list of IBM trademarks isavailable on the Web at http://www.ibm.com/legal/copytrade.shtml

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in theUnited States, other countries, or both.

Linux is a registered trademark of Linus Torvalds in the United States, othercountries, or both.

Microsoft and Windows are trademarks of Microsoft Corporation in the UnitedStates, other countries, or both.

UNIX is a registered trademark of The Open Group in the United States and othercountries.

Other company, product, or service names may be trademarks or service marks ofothers.

676 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 683: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Index

Special characters- (minus) operator 663-> operator 663! operator 662, 663!= operator 663? : operator 662, 663. (dot) operator 663.messageBox function 495(...)

brackets 663\[ \] operator 663\[Types\] 2\< in computes 16\< operator 663\<= operator 663> operator 663>= operator 663|| operator 662, 663& in computes 16&& operator 662, 663= operator 663== operator 663^ operator 662

Aabove modifier 145abs function 407absolute positioning 142absolute value, determining 407accessibility messages 75acclabel option 75acos function 409action item 6, 30

determining the next item on thepage 152

determining the previous item on thepage 154

determining whether an item isactivated 77

filtering submissions bydatagroup 255

filtering submissions by group 258filtering submissions by item

reference 260filtering submissions by item

type 262filtering transmissions by

datagroup 255filtering transmissions by group 258filtering transmissions by item

reference 260filtering transmissions by item

type 262filtering transmissions by

namespace 264filtering transmissions by option

reference 265filtering transmissions by option

type 267

action item (continued)filtering transmissions by page

reference 269linking data items 88linking to a data item 87setting a datagroup 88setting an action to repeat 90setting the destination URL 285setting the file format for saves 215setting the printing options 198setting the timing for an action 90setting the transmission format 257setting the type of action 271setting the type of action

triggered 272setting the url for submissions 285setting whether the item is active 79submitting XForms data 339XForms, linking to data model 342

action, registering in XForms 369actionref attribute 311actions

cancel 271cells that trigger actions 35display 271done 271enclose 271extract 271link 271pagedone 271print 271refresh 271remove 272replace 272save 272saveform 272See also XForms Actions 347select 272signature 272submit 272XForms actions, triggering 342

actions, XFormsSee XForms Actions 347

activated option 77activating items 79active option 79additive operators 662addressbook function 481after modifier 145alert

creating a message box 495alert setting, XForms 303alignment modifiers

alignb2b 146, 147alignb2c 146alignb2t 146alignc2b 146alignc2l 146alignc2r 146alignc2t 146alignhorizbetween 146

alignment modifiers (continued)alignhorizc2c 146alignl2c 146alignl2l 146alignl2r 146alignr2c 146alignr2l 146alignr2r 146alignt2b 146alignt2c 146alignt2t 146alignvertbetween 146alignvertc2c 146

anglesconverting degrees to radians 416converting radians to degrees 425determining the arc cosine 409determining the arc sine 411determining the arc tangent 412determining the cosine 415determining the sine 428determining the tangent 430

annuity function 410appearance of forms, preventing

changes 24application

determining build version of 435determining the name of 430determining version number of 432determining version of 433

application/vnd.xfdl 4, 257with compression 257

applicationName function 430applicationVersion function 432applicationVersionNum function 433applying

multiple signatures 23applysymmetricswapping function 543approving signature for no-lock scenarios

creating 601arcs

determining arc cosine 409determining arc sine 411determining arc tangent 412

Arithmetic rounding 112array elements

element names 72syntax 72

arrayselement references 665elements and options 8

arrowcursortype 86

asin function 411assignment operator 663atan function 412attachment buttons 32attachments

adding in XForms 346grouping 88See also enclosures 87

© Copyright IBM Corp. 2003, 2009 677

Page 684: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

attachments (continued)setting the datagroup 32storing data for attachments 40, 87storing the file name 101

attributesfor certificates 225getting the value of an attribute 459setting the value of 477version attribute 4

authenticated clickwrap 585signature type 585

automatic actions See action item 271available options for digital signature

buttons 608averaging numbers 549avg function 549

Bbackground color See color 80Banker’s rounding 112base, converting to base 10 443base64 encoding 173

encoding base64-gzip 173encoding binary data 17, 173

before modifier 145below modifier 145bgcolor option 80bidiordering function 532bidirectional

functions 532bidirectional language

orderingscheme option 180binary data objects 17BNF rules

for XFDL 2bold, setting for font 108boolean functions

if 547Boolean functions 545

boolean-from-string 545boolean-from-string function 545Booleans, converting to strings 545border

setting for print 197border option 82borders

setting whether a label has aborder 162

setting whether an item has aborder 82

boxdisplay 92

box item 7, 31determining the next item on the

page 152determining the previous item on the

page 154positioning the item on the form 142setting the background color 80setting the background color for

print 192setting the border 82setting the font information 108setting the size 251setting whether a box is visible when

the form is printed 202

box item (continued)setting whether the item is

visible 289brackets

mathematical units 663browser 482build

determining version of 434buildVersion function 434buildVersionNum function 435built-in labels 159

suppressing 252button

creating signature buttons 578direction 94display 92numericshaping 179orderingscheme 180orientation 181setting button text for signatures 580

button item 7, 32adding accessibility messages 75attaching a file in XForms 346attachments 32capturing the last keystroke

(hotkeys) 157controlling the display of an

image 138controlling which certificate details

the user sees 224controlling which certificates are

available to the user 224creating attachment buttons 32creating submit buttons 32detecting if a button is clicked 479detecting whether the mouse is over

the item 177determining if the item is

activated 77determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104enclosure buttons 32filtering signatures by datagroup 221filtering signatures by group 237, 239filtering signatures by instance 239filtering signatures by item

reference 241filtering signatures by item type 243filtering signatures by

namespace 245filtering signatures by option

reference 246filtering signatures by option

type 248filtering signatures by page

reference 250, 269filtering submissions by

datagroup 255filtering submissions by group 258filtering submissions by item

reference 260filtering submissions by item

type 262

button item (continued)filtering transmissions by

datagroup 255filtering transmissions by group 258filtering transmissions by item

reference 260filtering transmissions by item

type 262filtering transmissions by

namespace 264filtering transmissions by option

reference 265filtering transmissions by option

type 267filtering transmissions by page

reference 269formatting the text 110justifying text 156label, suppressing 252linking data items 88linking to a data item 87linking to a help message 135linking to a signature image 220linking to a signature item 219linking to an image 136positioning the item on the form 142recording the location of a click 85recording the signer’s identity 227setting a datagroup 88setting the background color 80setting the background color for

print 192setting the border 82setting the button’s action 271setting the destination URL 285setting the file format for saves 215setting the font color 107setting the font color for print 193setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the printing options 198setting the signature MIME type 228setting the size 251setting the space between lines of

text 172setting the text displayed 288setting the transmission format 257setting the type of action

triggered 272setting the type of signature

created 219, 230setting the url for submissions 285setting whether a button is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289signature buttons 33storing the identity of the signer 227submitting XForms data 339

button press, registering in XForms 369

678 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 685: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Ccaching references for computes 671calculate property 309calculating

item height 493X coordinate 490Y coordinate 491

calculations See computes 660calendar 38calendar, formatting 112cancel action 271case

making a string lowercase 403making a string uppercase 404toggling the active case 367

case sensitivity, setting 119case, formatting 112cases, for switches 340CDATA 16ceiling function 413cell item 35

cells that trigger actions 35dereferencing cells 36determining if the item is

activated 77determining the next item on the

page 152determining the previous item on the

page 154filtering transmissions by

datagroup 255filtering transmissions by group 258filtering transmissions by item

reference 260filtering transmissions by item

type 262filtering transmissions by

namespace 264filtering transmissions by option

reference 265filtering transmissions by option

type 267filtering transmissions by page

reference 269linking cells to other items 133linking to a data item 87linking to data items 88linking to lists 133select cells 35setting a datagroup 88setting the built-in label text 159setting the cell’s action 271setting the destination URL 285setting the file format for saves 215setting the printing options 198setting the transmission format 257setting the type of action

triggered 272setting the url for submissions 285setting the value 288setting whether the item is active 79

cellsdeselection, registering in

XForms 370selection, registering in XForms 383

centering text 156certificate tags 460

certificatesavailable attributes 225controlling which details are

shown 223filtering which certificates are

available 223setting which signature engine to

use 228change list, duplicate entries 672changes, preventing form layout

changes 24changing

default file names 499char data type 72character sets

setting the character set 108setting the character set for the label

option 164characters

dynamically changing itemheight 493

illegal 664locating in a string 399measuring item height in 487measuring item width in 489restricted 16

checkdeselection, registering in

XForms 370direction 94display 92label, suppressing 252numericshaping 179orderingscheme 180orientation 181selection, registering in XForms 383

check item 7, 37adding accessibility messages 75capturing the last keystroke

(hotkeys) 157detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104linking to a help message 135positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the check to be on or off 288setting the font characteristics for the

built-in label 164

check item (continued)setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the size 251setting whether a check is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289XForms, linking to data model 317

checkgroupnumericshaping 179orderingscheme 180orientation 181

checkgroup item 59adding accessibility messages 75choices, setting 329, 335detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110label, suppressing 252linking to a help message 135positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the check to be on or off 288setting the font characteristics for the

built-in label 164setting the font color for the built-in

label 163setting the next item in the tab

order 178setting the previous item in the tab

order 191setting whether a check is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289checklists, creating 37, 59, 65checkValidFormats function 436child nodes, counting 439

Index 679

Page 686: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

child, determining which child anelement is 468

children, counting 439choices

presenting choices 35, 37, 38, 47, 49,51, 59, 65

setting choices to select 272setting the choices for a

checkgroup 327setting the choices for an item 333

choose function 575CIC signatures 220clickwrap 585

customizing signing ceremony 590Clickwrap

signature type 585clickwrap signature

creating 589security 589

ClickWrap signatureabout 230signature engine parameters 231

Clickwrap signature tags 460clipping images 138closing a form 271color

list of colors 642setting the background color 80setting the background color for

print 192setting the font color 107setting the font color for print 193setting the label’s background

color 161setting the label’s background color

for print 195setting the label’s font color 163setting the label’s font color for

print 196color data type 72color, recording operating system

colors 83colorinfo option 83combobox

direction 94numericshaping 179orderingscheme 180orientation 181

combobox item 7, 38adding accessibility messages 75capturing the last keystroke

(hotkeys) 157choices, setting 335detecting whether the mouse is over

the item 177determining if the item is

activated 77determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110justifying text 156label, suppressing 252linking to a help message 135

combobox item (continued)linking to cells 133positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the font characteristics for the

built-in label 164setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the size 251setting whether a combobox is visible

when the form is printed 202setting whether the item is

visible 289setting which cell is selected 288XForms, linking to data model 317

comments 18compare functions 558comparing strings 398, 558compound function 414compute system 660computes

cached dependency lists 668conditional expressions 662duplicate entries on the total change

list 672handling deleted form nodes 672handling dynamic references 670ignoring white space 661limitations 672mathematical expressions 662missing references 672multiline 661re-entrancy 671reference caching 671representing computes 667restricted characters 16running computes 667setting text for signature button 580topological sorting 669XFDL 673XForms 673

computes, setting for XForms 309conditional expressions 662conditions

if statement 547constraint settings

casesensitive 119

constraint settings (continued)checks 119currency separator 119decimalseparator 119groupingseparator 120length 120mandatory 121message 121patterns 121range 121separator 119, 120template 122yearwindow 122

constraints 119settings 119

constraints, setting 309content format

syntax for options 13context sensitive help 43, 135coordinates

excluding from signature 585coordinates option 85copies, number printed 199copying form elements 447cos function 415cosine

determining the arc cosine 409determining the cosine 415

count-non-empty function 552countChildren function 439countDatagrouptems function 440countGroupedItems function 441countLines function 391countWords function 393create XForms signature button 606creating an XML digital signature 603creating file names

based on name and date 499cross-reference

items and options 608, 635CryptoAPI signature

about 230signature engine parameters 232

currency data type 111style 117

currency separator 112, 119currency symbol, showing 112currency, formatting 112current function 577current item, determining which item has

the focus 106cursor type option 86cursor, placing the 363cursortype

arrow 86hand 86

custom item 58naming conventions 58XForms, linking to data model 317,

344custom option 298

Ddaemon forms 30data item 7, 40

base64 encoding 17

680 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 687: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

data item (continued)determining the next item on the

page 152determining the previous item on the

page 154linking an image to a signature 220linking images to other items 136recording the file name of a data

object 101setting a datagroup 88setting the MIME type 176storing the data 173storing the MIME data 173

data modelformatting, preserving 112getting the value of an element 457setting a data element 474

data option 87data path

signatures 460data type

XForms, setting for 310data types 2

char 72color 72currency 111currency style 117date 111date styles 117date_time 111date_time style 117day_of_month 111day_of_month style 117day_of_week 111day_of_week style 117float 111float style 117for fields 111for options 72integer 111integer styles

style 117month 111month style 117reference strings 389setting for items 110string 72, 111styles for fields 117time 111time style 117void 111, 117year 111, 117

data, storing custom data in a form 298datagroup

counting the items 440datagroup option 32, 88

filtering signatures by datagroup 221filtering submissions by

datagroup 255date

current date, determining 560days, converting to 561, 563determining the number of seconds

difference between dates 566seconds, converting to 567

date data type 111style 117

date function 507date functions 507, 560

date 507dateToSeconds 509day 511dayOfWeek 512days-from-date 561days-to-date 563endOfMonth 513local-date 564local-dateTime 565month 516months 571now 560seconds-from-dateTime 566seconds-to-dateTime 567year 520

date patterns 123date_time

localization to time zone 111normalization to UTC 111

date_time data type 111style 117

datesconverting a date to seconds 509creating a calendar widget 38date pattern, formatting 112determining the current date 517determining the date 507determining the day 511determining the day of the week 512determining the last day of the

month 513determining the local date 564determining the month 516determining the year 520style, setting 112

dateToSeconds function 509day

determining the day 507, 511day function 511day_of_month data type 111

style 117day_of_week data type 111

style 117dayOfWeek function 512days

date, converting from 561determining the day of the week 512determining the last day of the

month 513days-from-date function 561days-to-date function 563deactivating items 79decimal function 443decimal separator 112, 119decimal-string function 554decision operators 663, 664decisions 662default file name, getting 486default page settings 28default settings

entire form 25default sizes for items 637deg2rad function 416degrees

converting degrees to radians 416

degrees (continued)converting radians to degrees 425

delay option 90deleting form elements 444deleting form nodes with computes 672dependency lists, computes 668dereferencing cells 36design goals, XFDL 1destroy function 444detach_id

calling 496detecting

value changes in a form 479determining

Viewer behavior 496determining if Help is on or off 488digital certificate tags 460digital signature buttons

available options 608digital signature tags 460digits, formatting digits shown for

fractions 112direction

item orientation 181direction option 94dirtyflag

XForms submissions 339dirtyflag option 96disabilities, recording operating system

colors for users with visionimpairments 83

display 133display action 271display elements

bgcolor 80border 82boxes 31fontcolor 107itemlocation 142justify 156label 159labelbgcolor 161labelborder 162labelfontcolor 163labelfontinfo 164spacer 56thickness 254

display option 92displaying

images 44text 44, 159

document reproducibility 18document-centric model 1, 3DOMActivate event 369done action 271duplicate function 447duplicating form elements 447duration

months, converting to 571seconds, converting to 569

duration, converting from 569dynamic references 666

in computes 670dynamically changing item height 493

Index 681

Page 688: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Ee-mail addresses 481eclipse 482edit checks

checking all formatting 436determining if a value has a valid

format 473finding invalid items 436

effects, setting for font 108electronic signature tags 460electronic signatures

creating 589security 589

elements 4deleting form elements 444deleting nodes in use 444duplicating elements 447locating 471naming elements 17preventing exploitable overlap of

signed elements 24references to 665root element 4securing signed elements 23setting the value of 474setting the value of an attribute 477

else statement 547email, setting the url for e-mail

submissions 285empty function 465enclose action 271enclosure data 40enclosures

enclosure buttons 32grouping 88setting a display action 271setting a remove action 272setting an enclose action 271setting an extract action 271setting the datagroup 32storing 87storing the file name 101

enclosuresettings option 98encoding

base64 173base64-gzip 173

endOfMonth function 513engines, signature

parameters for common engines 231setting the signature engine to

use 228entrust 585Entrust

signature type 585Entrust signature

about 230signature engine parameters 232

Entrust signatureshow to use 594

env function 482environment

browser 482eclipse 482html-object 482standalone 482

epilog, XML 18error checking 110

error message, for invalid input 121errorcolor setting 273escape sequence for labels 44event handlers 367

See also events 367events

DOMActivate 369placement in form 368syntax 367xforms-deselect 370xforms-disabled 372xforms-enabled 373xforms-invalid 374xforms-model-construct 375xforms-model-construct-done 376xforms-model-destruct 377xforms-optional 378xforms-readonly 379xforms-readwrite 380xforms-ready 381xforms-required 382xforms-select 383xforms-submit 384xforms-submit-done 385xforms-submit-error 386xforms-valid 387xforms-value-changed 388

examplesformatting 128

excludedmetadata option 100Excluding elements from signatures 585exp function 417expandb2c modifier 147expandb2t modifier 147expandl2c modifier 147expandl2l modifier 147expandl2r modifier 147expandr2c modifier 147expandr2l modifier 147expandr2r modifier 147expandt2b modifier 147expandt2c modifier 147expandt2t modifier 147exponent

calculating 576exponentiation operators 662exponents

calculating an exponential value 424calculating the exponentiation 417

Extensible Forms DescriptionLanguage 1

extensions, compatible 4extract action 271

Ffact function 418factorial, calculating 418field

direction 94display 92numericshaping 179orderingscheme 180orientation 181

field item 7, 41adding accessibility messages 75

field item (continued)capturing the last keystroke

(hotkeys) 157counting lines of text 391counting the number of words 393creating rich text fields 213, 253detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110justifying text 156label, suppressing 252linking to a help message 135positioning the item on the form 142readonly, setting to be 205setting fields to print as lines 197setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the font characteristics for the

built-in label 164setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the horizontal scrolling 217setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the size 251setting the value 288setting the vertical scrolling 218setting whether a field is visible when

the form is printed 202setting whether the item is active 79setting whether the item is

visible 289settings fields to print without scroll

bars 197writeonly, setting a field to be 325writeonly, setting to be 292XForms, linking to data model 317,

342, 344file formats, setting for saves 215file name, for enclosures 101file names

creating file names 499filename option 101fileOpen 483fileSave function 484

682 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 689: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

filteringgeneral information for filtering

signatures 21order of precedence 639signatures by datagroup 221signatures by group 237signatures by item references 241signatures by item type 243signatures by namespace 245signatures by option references 246signatures by option type 248signatures by page reference 250signatures by XForms instance 239submissions by datagroup 255submissions by group 258submissions by item reference 260submissions by item type 262submissions by option reference 265submissions by option type 267submissions by page reference 269transmissions by namespace 264triggeritem and coordinates 33which certificates are available 223

first option 102flags

for changes in form status 96float data type 111

style 117floor function 419focus

determining whether an item has thefocus 104

determining which item has thefocus 106

focus, setting the 363focused option 104focuseditem option 106folders, for enclosures 88fontcolor option 107fontinfo option 108fonts

setting font characteristics 108setting the character set 108setting the character set for the label

option 164setting the color 107setting the label option’s font 164

footerprintActualFormPage 523, 524, 525,

526, 527, 528, 529, 530, 531footers

functions 521forLoop function 451form

element definition 4form globals 25identification 499page definition 4revision number 131serial number 131title for a form 131

form globaladding a title, serial number, and

version 131capturing the last keystroke

(hotkeys) 157creating an XForms model 313

form global (continued)detecting whether the form has

changed 96determining if the form is

activated 77determining whether the form has the

focus 104determining whether the form

printing 194recording which item triggered an

event 270setting the default background color

for built-in labels 161setting the form’s background

color 80setting the form’s background color

for print 192setting the form’s border 82setting the form’s default file format

for saves 215setting the form’s default font

characteristics 108setting the form’s default font

color 107setting the form’s default font color

for print 193setting the form’s default printing

options 198setting the form’s default transmission

format 257setting the form’s requirements for

Web Services 206setting the form’s Web services 290setting the title of a form 159

form security 583format

default constraints 129default data types 129default presentations 129examples 128output, printing 197turning off grouping separator 129usage details 129usage notes 129

format option 110See Also constraint settings 110See Also presentation settings 110

format2ltr function 539format2rtl function 541formats

supported image formats 136formatString function 453formatting

checking all formatting 436data model. preserving in 112determining if a value has a valid

format 473formatting, finding invalid items 436formid option 131forms

daemon forms 30deleting form elements 444detecting a change in status 96duplicating form elements 447form names 4form structure 4locating an element 471

formulas See computes 660fractions, formatting digits shown 112fullname option 132function calls

See also WSDL functions 306functions

about function parameters 389abs 407applysymmetricswapping 543bidirectional 532checkValidFormats 436compare 558footer 521format2ltr 539format2trl 541header 521insertunicodecharacter 537local-dateTime 565math 407reference strings 389See also WSDL functions 290See also XForms functions 544shapedigits 535string 391syntax 667utility 430Xpath 544

GgenerateUniqueName function 455generating 554

random numbers 554generic RSA 585

signature engine 586signature type 585

Generic RSAXML DSig supported engines 603

Generic RSA signatureabout 230

get function 457getAttr function 459getDataByPath function 460getDefaultFilename function 486getGroupedItem function 465getHeight function 487getInstanceRef function 467getPosInSet function 500getPosition function 468getPref function 469getReference function 471getSizeOfSet function 502getting a reference to an instancel 467getWidth function 489getX function 490getY function 491global

publicdata 203settings 25

global settingsform globals 25

globalspage globals 28

graphics See images 87group option 133

filtering signatures by group 237group, creating a group for a pane 316

Index 683

Page 690: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

grouping separator 112, 120removing 129

groupscounting the items in a 441determining position in 500determining size of 502filtering submissions by group 258getting the sid of a grouped item 465grouping attachments 88grouping cells 133grouping enclosures 88grouping radio buttons 133

Hhalf_down 112half_up 112hand

cursortype 86header

printActualFormPage 523, 524, 525,526, 527, 528, 529, 530, 531

headersfuncitons 521

height, setting for items 251help

display 92setting the help mode 492

help item 43determining the next item on the

page 152determining the previous item on the

page 154linking to other items 135setting the help message 288setting whether the item is active 79

help messages 43, 135help mode 488help option 135help setting, XForms 304helpcursor setting 273hiding items 289highlighting text within a field 498hint setting, XForms 304HMAC signature tags 460HMAC-ClickWrap signature

about 230HMAC-Clickwrap signatures 100HMAC-ClickWrap signatures

signature engine parameters 231horizontal scrolling in fields 217hour function 514hours

determining r 514determining the time 519

HTML name attributes 496html-object 482

Iidentifiers, scope 17if attribute 347

attributes 347if function 547if statement 547

illegalcharacters 664

image data 40image option 136image scaling

signature button 596imagemode option 138images

controlling the display of 138displaying 44linking an image to a signature 220linking items to images 136mapping 85setting the MIME type 176storing 87supported image formats 136XForms, from data model 320

impairments, messages for sightimpairments 75

indexgetting the position index of an

element 468locating a character in a string 399locating a substring within a

string 400, 401index function 553index, determining for row in table 553index, setting for a table 364indirect references 36, 665input

capturing the last keystroke 157mandatory 110reformatting 110restricting 110

input fields 41input items

linking to XForms data model 299input, creating XForms inputs 317, 344insertunicodecharacter function 537instance

locating an 573instance function 573instances

getting a reference to an instance inthe XML data model 467

integer data type 111style 117

interest, determining compoundinterest 414

Interlink signature engineparameters 233

intersectXML DSig filters 603

invisible items 289isValidFormat function 473italics, setting for font 108item

orientation 181item details

definition 6scope identifier 17tag 17

item referencesfiltering signatures by item

references 241filtering submissions by item

reference 260

item tags, relative 140, 141, 152, 154itemfirst option 140itemlast option 141itemlocation option 142itemnext option 152itemprevious option 154items

action 6, 30box 7, 31button 7, 32cell 35check 7, 37checkgroup 59combobox 7, 38cross referenced with options 608,

635custom 58data 7, 40default sizes 637deleting form elements 444determining if item is activated 77determining if the mouse is over an

item 177determining the first item on a

page 140determining the last item on a

page 141determining the next item on the

page 152determining the previous item on the

page 154determining the tab order 178duplicating elements 447dynamically changing item

height 493field 7, 41filtering signatures by item type 243filtering submissions by item

type 262general details 29, 58help 43label 7, 44line 7, 46list 7, 47locating a form element 471making items invisible 289pane 62popup 7, 49positioning items on the form 142preventing exploitable overlaps of

signed items 24radio 8, 51radiogroup 65referencing 665setting the size of 251setting the tab order 191signature 8, 53slider 8, 68spacer 8, 56table 69toolbar 8, 57turning items off 79

Jjustify option 156justifying text 156

684 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 691: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

KKeyInfo

XML DSig 603keypress option 157keystroke, capturing the last 157

Llabel

direction 94display 92numericshaping 179orderingscheme 180orientation 181

label item 7, 44adding line breaks 44controlling the display of an

image 138determining the next item on the

page 152determining the previous item on the

page 154formatting the text 110justifying text 156label, suppressing 252linking to a help message 135linking to an image 136positioning the item on the form 142setting the background color 80setting the background color for

print 192setting the border 82setting the font color 107setting the font color for print 193setting the font information 108setting the size 251setting the space between lines of

text 172setting the text displayed 288setting whether a label is visible when

the form is printed 202setting whether the item is active 79setting whether the item is

visible 289XForms, linking to data model 320

label option 159setting a background color 161setting a font 164setting a font color 163setting whether the label has a

border 162labelbgcolor option 161labelborder option 162labelfontcolor option 163labelfontinfo option 164labels, suppressing built-in labels 252landscape printing 199language support 16last option 166layout

preventing changes 24storing the layout information 170

layoutflow option 168layoutinfo option 170leading, adjusting the space between lines

of text 172

left justify 156length

determining for strings 397length, setting limit for input 120lexical constraints in top level

structure 4line

display 92line breaks in labels 44line item 7, 46

determining the next item on thepage 152

determining the previous item on thepage 154

positioning the item on the form 142setting the font color for print 193setting the font information 108setting the line color 107setting the size 251setting the thickness 254setting whether a line is visible when

the form is printed 202setting whether the item is

visible 289lines, counting in a field 391linespacing option 172link action 271linking

input items to XForms datamodel 299

linking cells to lists 133list

direction 94numericshaping 179orderingscheme 180orientation 181

list item 7, 47adding accessibility messages 75capturing the last keystroke

(hotkeys) 157choices, setting 329, 335detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110label, suppressing 252linking to a help message 135linking to cells 133positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195

list item (continued)setting the built-in label’s font color

for print 196setting the font characteristics for the

built-in label 164setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the next item in the tab

order 178setting the size 251setting whether a list is visible when

the form is printed 202setting whether the item is active 79setting whether the item is

visible 289setting which cell is selected 288

ln function 420local-date function 564local-dateTime

functions 565locale

currency locale, formatting 112locale support 16localization to time zone

date_time 111location

locating a substring in a string 401positioning items on the form 142

log function 421logarithm

determining the logarithm 421determining the natural

logarithm 420logic 662

if statements 547logical and 662logical negation 662logical operators 663logical or 662

loop, for 451lowercase

making a string lowercase 403

Mmandatory

XForms, setting for 310mandatory input

setting 110mandatory signatures 581mandatory, setting input to be 121mandatorycolor setting 273mapping images 85matching strings 398math functions 407

abs 407acos 409annuity 410asin 411atan 412ceiling 413compound 414cos 415deg2rad 416

Index 685

Page 692: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

math functions (continued)exp 417fact 418floor 419ln 420log 421mod 422pi 423power 424rad2deg 425rand 426round 427sin 428sqrt 429tan 430

mathematical expressions 662max function 551maximum, determining from number

set 551measureHeight 493measureHeight function 493measuring

item height 487item width 489

membershiparray membership 663indirect membership 663operators 663structure membership 663

memorypageloading 186

menu setting 273message, displaying to user 356messageBox 495messages, help 43methods See functions 667Microsoft cryptoAPI

signature type 585Microsoft CryptoAPI 585

XML DSig supported engines 603MIME types 4, 176

application/vnd.xfdl 257application/vnd.xfdl with

compression 257mimedata option 173

usage 17mimetype option 176min function 550minimum, determining from number

set 550minute function 515minutes

determining the minute 515determining the time 519

MIPsSee property settings 308

mod function 422model item properties

See property settings 308model, creating an XForms model 306modifiable setting 273modifiers

above 145after 145alignb2b 146, 147alignb2c 146alignb2t 146

modifiers (continued)alignc2b 146alignc2l 146alignc2r 146alignc2t 146alignhorizbetween 146alignhorizc2c 146alignl2c 146alignl2l 146alignl2r 146alignr2c 146alignr2l 146alignr2r 146alignt2b 146alignt2c 146alignt2t 146alignvertbetween 146alignvertc2c 146before 145below 145expandb2c 147expandb2t 147expandheight 147expandl2c 147expandl2l 147expandl2r 147expandr2c 147expandr2l 147expandr2r 147expandt2b 147expandt2c 147expandt2t 147expandwidth 147offset 145position 144within 145

modulus, determining 422month

determining the month 507month data type 111

style 117month function 516months

determining the last day of 513determining the month 516duration, converting from 571

months function 571mortgage

calculating annuity 410determining compound interest 414

mouse, tracking the location of 177mouseover option 177multiline

computes 661multiple signatures

applying 23multiplicative operators 662

Nname of enclosed file 101name of signer 132names

compatible extensions 4form name 4generating unique 455

namespace 664

namespace (continued)xforms namespace 299

namespacesfiltering signatures by

namespace 245filtering transmissions by

namespace 264signature filters 22

naming elements 17NaN 544natural logarithm, determining 420negative sign, formatting 112Netscape 585

signature type 585XML DSig supported engines 603

Netscape signatureabout 230signature engine parameters 233

next option 178no-lock scenarios

creating an approving signature 601no-lock signature

creating 600sample code 602

no-lock signaturesabout 600

node-set functions 573context nodeset, determining 577instance 573

nodesdeleting form elements 444deleting nodes in use 444nodes

child 447sibling 447

non-empty, counting 552original nodes 447parent 447partial references 447

nodesetcontext, determining the 577

nodeset binding 302non-empty, counting nodes 552non-repudiation 1, 3, 170normalization to UTC

date_time 111notarizing signatures 100notation, XFDL 2now function 517, 560number functions 549

avg 549count-non-empty 552decimal-string 554index 553max 551min 550

number patterns 125numbers

formatting 112numbershaping (Arabic and

National) 179removing grouping separator 129

numbers, generating random 426numbers, rounding 112numericshaping 179

686 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 693: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

Oobject

XML DSig 603off, turning items off 79offset for space between lines of text 172offset modifier 145opening a file 483operating system environment

browser 482eclipse 482html-object 482stand-alone 482

operations, order of operations 662operations, order of precedence

operations 663operators

additive 662assignment 663brackets 663decision 663, 664exponentiation 662logical 663membership 663multiplicative 662relational 663table of operators 662unary minus 663

option referencesfiltering signatures by option

references 246filtering submissions by option

reference 265options

acclabel 75activated 77active 79bgcolor 80border 82colorinfo 83content format 13coordinates 85cross-referenced with items 608, 635curesortype 86custom 298data 87data types 72datagroup 32, 88definition 8delay 90detecting value changes 479direction 94dirtyflag option 96display 92enclosuresettings 98excludedmetadata 100filename 101filtering signatures by option

type 248filtering submissions by option

type 267first 102focused 104focuseditem 106fontcolor 107fontinfo 108format 110formid 131

options (continued)fullname 132getting the value of 457group 133help 135image 136imagemode 138itemfirst 140itemlast 141itemlocation 142itemnext 152itemprevious 154justify 156keypress 157label 159labelbgcolor 161labelborder 162labelfontcolor 163labelfontinfo 164last 166layoutflow 168layoutinfo 170linespacing 172locating a form element 471mimedata 173mimetype 176mouseover 177next 178order of precedence 72orderingscheme 180pagefirst 184pageid 185pagelast 186pagenext 189pageprevious 190previous 191printbgcolor 192printfontcolor 193printing 194printlabelbgcolor 195printlabelfontcolor 196printsettings 197quick reference table 611readonly 205requirements 206rtf 213saveformat 215scrollhoriz 217scrollvert 218See also XForms options 298setting the value 474signature 219signatureimage 220signdatagroups 221signdetails 223signer 227signformat 228signgroups 237signinstance 239signitemrefs 241signitems 243signnamespaces 245signoptionrefs 246signoptions 248signpagerefs 250size 251suppresslabel 252

options (continued)syntax 72texttype 253thickness 254transmitdatagroups 255transmitformat 257transmitgroups 258transmititemrefs 260transmititems 262transmitnamespaces 264transmitoptionrefs 265transmitoptions 267transmitpagerefs 269triggeritem 270type 271url 285value 288version, referencing 667visible 289webservices 290writeonly 292xforms:group 316xforms:input 317xforms:output 320xforms:range 322xforms:repeat 323xforms:secret 325xforms:select 327xforms:select1 333xforms:submit 339xforms:switch 340xforms:textarea 344xforms:trigger 342xforms:upload 346xformsenabled 293xformsmodels 306xformsreadonly 295xformsrequired 296xformsvalid 297

order of precedencefilters 639operations 662, 663options 72

order of precedence of signaturefilters 585

orderingscheme option 180orientation

direction 181for printing 199

originsUFDL 1XFDL 1

output format, when printing 198output, when printing 198overlapping signatures 21

Ppad function 394padding

number of pad characters,setting 112

pad character, setting 112pane 183

padding strings 394page

definition 4

Index 687

Page 694: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

page (continued)determining the first page in a

form 184determining the last page in a

form 186determining the next page in the

form 189determining the previous page in the

form 190page global 28

capturing the last keystroke(hotkeys) 157

detecting whether the mouse is overthe page 177

determining if the page isactivated 77

determining the first item on apage 140

determining the first page in aform 184

determining the last item on apage 141

determining the last page in aform 186

determining the next page in theform 189

determining the previous page in theform 190

determining whether a page has thefocus 104

determining which item has thefocus 106

setting the default background colorfor built-in labels 161

setting the first item in the taborder 178

setting the page background color 80setting the page’s background color

for print 192setting the page’s default file format

for saves 215setting the page’s default font

characteristics 108setting the page’s default font

color 107setting the page’s default font color

for print 193setting the page’s default printing

options 198setting the page’s default transmission

format 257setting the previous item in the tab

order 191setting the serial number for a

page 185setting the title of a page 159

page referencesfiltering signatures by page

reference 250filtering submissions by page

reference 269page tags, relative 184, 186, 189, 190pagedone action 271pagedonewithformaterrors setting 273pagefirst option 184pageid option 185pagelast option 186

pageloading option 186pagenext option 189pageprevious option 190pages

flipping pages 271setting which pages print 197

paging controlscreating for duplicated pages 447

paging controls See button item 32pane

first element, identifying 102last item, identifying 166numericshaping 179orderingscheme 180orientation 181padding 183

pane item 62group, setting 316label, suppressing 252setting the background color for the

built-in label 161setting the border 82setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the font characteristics for the

built-in label 164setting the font color for the built-in

label 163switch, creating 340

panels See box item 31panes, adding to a form 62parameters

about function parameters 389for common signature engines 231reference strings 389

password fields, creating 292password, creating writeonly fields 325patterns

date patterns 123number patterns 125string patterns 127

performancepageloading option 186

pi function 423pixels

calculating x coordinate 490, 491dynamically changing item

height 493measuring item height in 487measuring item width in 489

placement of items on the form 142plan text

direction option 94point size, setting 108popup

direction 94display 92label, suppressing 252numericshaping 179orderingscheme 180orientation 181

popup item 7, 49adding accessibility messages 75

popup item (continued)capturing the last keystroke

(hotkeys) 157choices, setting 335detecting whether the mouse is over

the item 177determining if the item is

activated 77determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110justifying text 156linking to a help message 135linking to cells 133positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the built-in label text 159setting the font color 107setting the font color for print 193setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the size 251setting whether a popup is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289setting which cell is selected 288

portlet_URLcalling 496

portrait printing 199position modifiers 144positioning

determining an element’s positionwithin its parent 468

items 142locating a character in a string 399

powercalculating 576

power function 424, 576precedence

for filters 639of operations 663options 72

preferences, getting the user’s Viewerpreferences 469

presentation settingscalendar 112casetype 112currency separator 112currencylocale 112decimalseparator 112fractiondigits 112groupingseparator 112keepformatindatar 112negativeindicator 112pad 112

688 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 695: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

presentation settings (continued)padcharacter 112pattern 112patternrefs 112round 112separator 112showcurrency 112significant digits 112style 112

previous option 191print action 271print PageSheet 527print settings

print date 525printActualFormPage 523printAcutalTotalFormPages 524printFormPage 526printPageSheet 527printSheet 528printTime 529printTotalFormPages 530printTotalPageSheets 531

printActualFormPage 523printActualTotalFormPages 524printbgcolor option 192printfontcolor option 193printFormPage 526printing

determining whether the form isprinting 194

output format 197setting a print action 271setting fields to print without scroll

bars 197setting radio buttons to print as check

boxes 197setting radio buttons to print without

the selected value 197setting single line fields to print as

lines 197setting the background color 192setting the font color 193setting the form to scale to the

page 198setting the form to tile across

pages 198setting the label’s background

color 195setting the label’s font color 196setting the number of copies 199setting the orientation 199setting the print format 198setting the print options 197setting whether the print dialog is

displayed 199setting whether the user can control

which pages are printed 199setting which pages are printed 199

printing option 194printlabelbgcolor option 195printlabelfontcolor option 196printsettings option 197printSheet 528printTime 529printTotalFormPages 530printTotalPageSheets 531printwithformaterrors setting 273

prolog, XML 18prompting the user 495prompting to save a form 96property function 557property settings 308

calculate 309readonly 309relevant 310required 310type 310

publicdata 203

Qqualification 664quick reference

default item sizes 637for options 611list of colors 642order of precedence for filters 639

quick reference tablesoverview 608

quoted strings 664

Rrad2deg function 425radians

converting degrees to radians 416converting radians to degrees 425

radiodeselection, registering in

XForms 370direction 94display 92label, suppressing 252numericshaping 179orderingscheme 180orientation 181selection, registering in XForms 383

radio item 8, 51adding accessibility messages 75capturing the last keystroke

(hotkeys) 157detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104grouping 133linking to a help message 135linking to cells 133positioning the item on the form 142readonly, setting to be 205setting radio buttons to print as check

boxes 197setting radio buttons to print without

the selected value 197setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161

radio item (continued)setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the font characteristics for the

built-in label 164setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the radio to be on or off 288setting the size 251setting whether a radio is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289radiogroup

numericshaping 179orderingscheme 180orientation 181

radiogroup item 65adding accessibility messages 75choices, setting 335detecting whether the mouse is over

the item 177determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110label, suppressing 252linking to a help message 135positioning the item on the form 142readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195setting the built-in label’s font color

for print 196setting the check to be on or off 288setting the font characteristics for the

built-in label 164setting the font color for the built-in

label 163setting the next item in the tab

order 178

Index 689

Page 696: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

radiogroup item (continued)setting the previous item in the tab

order 191setting whether a check is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289rand function 426random function 554random numbers 554random numbers, generating 426range, setting for input 121re-entrancy for computes 671readers, messages for screen readers 75readonly data, detecting changes 379readonly option 205readonly property 309readwrite data, detecting changes 380reference strings 389references

caching references for computes 671dereferencing cells 36dynamic 666dynamic references in computes 670element references 665filtering signatures by item

reference 241filtering signatures by option

reference 246filtering signatures by page

reference 250, 269filtering submissions by item

reference 260filtering submissions by item

type 262indirect 36missing references in computes 672referencing the XFDL version 667static references 665

references, source material 2reformatting input 110refresh action 271refresh_URL

calling 496relational operators 663relative positioning 142, 143relative tags

items 140, 141, 152, 154pages 184, 186, 189, 190

relevancy, detecting changes 372, 373relevant property 310remainder, determining 422remove action 272repeat

index, determining 553repeating an action 90replace action 272replace function 396replacing text in a field 498reproducibility of documents 18required data, detecting changes 378,

382required property 310required, setting input to be 121requirements option 206resizing images 138

restricted characters in XFDL 16restricting input 110retain_viewer

calling 496returning items with empty values 465revision, number for forms 131rich text

direction option 94rich text, creating rich text fields 213,

253right justify 156root element 4root, calculating square roots 429round function 427rounding

determining the ceiling 413determining the floor 419rounding a number 427XForms 554

rounding numbers 112row

adding from a table 353deleting from a table 350index, determining 553index, setting 364

rowpaddingtable 211

rows, repeating in a table 323RSA signature See Generic RSA

signature 230rtf option 213

Ssave action 272save prompt 96saveform action 272saveformat option 215saving a file 484saving forms 272

setting the format 215scaling images 138scaling, when printing 198schema

validating 507scope identifiers 17screen readers, messages for 75scroll bars, setting fields to print

without 197scrollfieldsonzoom setting 273scrollhoriz option 217scrollvert option 218second function 518, 569seconds 569

converting a date to seconds 509converting dates to dates 566converting seconds to a date 507date, converting from 567determining 518determining the number of seconds

difference between dates 566time, converting from 567

seconds-from-dateTime function 566seconds-to-dateTime function 567secret, creating writeonly fields 325securing signed elements 23security engine tags 460

select action 272separator, currency 112, 119separator, decimal 112, 119separator, grouping 112, 120separator, thousands 112, 120serial number

for a form 131for a page 185

set function 474setAttr function 477setDefaultFilename function 499setting

helpcursor 273mandatorycolor 273menu 273modifiable 273pagedonewithformaterrors 273printwithformaterrors 273scrollfieldsonzoom 273submitwithformaterrors 273

setting cursor in specific fieldlocation 498

settingserrorcolor 273global 25global form settings 25global page settings 28signwithformaterror 273validoverlap 273

shapedigits function 535shortcut keys, creating 157showing

images 44text 44

sid 17generating unique sids 455getting the sid of a grouped item 465

sight impairments, messages for 75signature

display 92signing portions of forms 582

signature action 272signature button

sizing 596signature engines 585signature engines, parameters for

common engines 231signature filters 582

about 583keep 583namespaces 22omit 583order of precedence 585signing portions of forms 582signitems 583

signature imagesSilanis 597storing 597

signature item 8, 53controlling which certificate details

the user sees 224controlling which certificates are

available to the user 224determining the next item on the

page 152determining the previous item on the

page 154

690 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 697: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

signature item (continued)filtering signatures by datagroup 221filtering signatures by group 237, 239filtering signatures by instance 239filtering signatures by item

reference 241filtering signatures by item type 243filtering signatures by

namespace 245filtering signatures by option

reference 246filtering signatures by option

type 248filtering signatures by page

reference 250, 269filtering transmissions by

namespace 264linking an image to a signature 220linking to a button item 219recording the identity of the

signer 132recording the signature type 219, 230recording the signer’s identity 227setting the MIME type 228storing signature notarizations 100storing the identity of the signer 227storing the layout information 170storing the layout information for the

form 170storing the MIME data 173storing the signature 173

signature option 219signature tags 460signature type

XML DSig 585signatureimage option 220signaturePad signature

about 231signature engine parameters 233

signaturesabout applying multiple

signatures 21about signatures in XFDL 21clickwrap 589ClickWrap, about 230creating approving signature for

no-lock scenarios 601CryptoAPI, about 230customizing clickwrap signing

ceremony 590displaying correct Silanis image 599document-centric model 3elements to exclude 585Entrust 594Entrust, about 230failure conditions 54filtering 54, 221, 237, 239, 241, 243,

245, 246, 248, 250, 264filtering triggeritem and

coordinates 33generic RSA 586Generic RSA, about 230getting data from 460HMAC-Clickwrap signatures 100HMAC-ClickWrap, about 230how to create 578image scaling 596

signatures (continued)linking a button to a signature

item 219linking an image to a signature 220linking to Silanis signature

image 598making signatures mandatory 581mandatory signatures 33multiple signatures 21multiple, applying 23Netscape, about 230no-lock 600non-repudiation 3notarizing signatures 100options for digital signature

buttons 608order of precedence for filters 639order of precedence of signature

filters 585overlapping signatures 21preventing exploitable overlaps of

signed items 24preventing layout changes 24sample of no-lock code 602securing signed elements 23setting a signing action 272setting button text 580setting signature type 585setting which certificate attributes are

shown 223setting which signature engine to

use 228signature buttons 33signature filters 583signature item 579signaturePad, about 231signer option 579signer’s name 132signing a form 579Silanis 596, 597Silanis engine 595Silanis, about 231sizing signature button 596storing identity of signer 227storing signature image 597storing the layout information 170what user sees when signing a

form 579SignatureValue

XML DSig 603signdatagroups 583, 585signdatagroups option 221signdetails option 223signer option 227signer’s name 132signformat option 228signgroups 583, 585signgroups option 237significant digits, setting 112signing forms 53signing portions of forms

secondary signatures 582single signatures 582

signinstance 583, 585signinstance option 239signitemrefs 583, 585signitemrefs option 241

signitems 585signitems option 243signnamespace 583signnamespaces 585signnamespaces option 245signoptionrefs 583, 585signoptionrefs option 246signoptions 583, 585signoptions option 248signpagerefs 583, 585signpagerefs option 250signwithformaterror setting 273Silanis 585

displaying the right image 599signature type 585storing signature images 597

Silanis enginesignatures 595

Silanis signatureabout 231linking to signature image 598signature engine parameters 234

sin function 428sine

determining the arc sine 411determining the sine 428

single node binding 299absolute references 299bind attribute 302inheritance 299, 302multiple models 301nesting 302ref attribute 299relevance 303

size option 251overriding with itemlocation 251

sizes, defaults for items 637slider

display 92numericshaping 179orderingscheme 180orientation 181

slider item 8, 68adding accessibility messages 75determining the next item on the

page 152determining the previous item on the

page 154determining whether the item has the

focus 104formatting the text 110label, suppressing 252linking to a help message 135positioning the item on the form 142range, setting 322readonly, setting to be 205setting the background color 80setting the background color for

print 192setting the background color for the

built-in label 161setting the border 82setting the border for the built-in

label 162setting the built-in label text 159setting the built-in label’s background

color for print 195

Index 691

Page 698: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

slider item (continued)setting the built-in label’s font color

for print 196setting the check to be on or off 288setting the font characteristics for the

built-in label 164setting the font color 107setting the font color for print 193setting the font color for the built-in

label 163setting the font information 108setting the next item in the tab

order 178setting the previous item in the tab

order 191setting the size 251setting whether a check is visible

when the form is printed 202setting whether the item is active 79setting whether the item is

visible 289Smartfill

getting user preferences 469Smartfill, XForms 311sorting, topological for computes 669source material references 2spacer item 8, 56

determining the next item on thepage 152

determining the previous item on thepage 154

positioning the item on the form 142setting the built-in label text 159setting the font characteristics 108setting the size 251setting the space between lines of

text 172spaces

removing leading and trailing whitespace from strings 405

spacing items on a form 56white space in computes 661

specifications, overlap with XFDL 2sqrt function 429square root, calculating 429stand-alone 482status, detecting a change in the forms

status 96string data type 72, 111string functions 391, 557

countLines 391countWords 393pad 394property 557replace 396strlen 397strmatch 398strpbrk 399strrstr 400strstr 401substr 402tolower 403toupper 404trim 405URLDecode 406URLEncode 407

string patterns 127

stringscomparing strings 558counting the number of lines 391counting the number of words 393decoding a URL-encoded string 406determining the length of 397encoding a URL string 407formatting using set rules 453locating a character in a string 399locating a substring within a

string 400, 401making a string lowercase 403making a string uppercase 404matching strings 398padding strings 394position of characters in strings 389quoted strings 664reference 389removing leading and trailing white

space 405replacing substrings 396retrieving a substring 402truncating strings 394validating the format of 473

strings, converting from Booleans 545strlen function 397strmatch function 398strpbrk function 399strrstr function 400strstr function 401structure of XFDL

arrays 8binary data objects 17document reproducibility 18items 6options 8restricted characters 16scope identifiers 17top level structure of XFDL forms 4

structure of XFDL formsoverview 4

submissionSee also XForms Submission 384

submissionsdetermining which item triggered a

submission 270filtering by datagroup 255filtering by group 258filtering by item reference 260filtering by item type 262filtering by option reference 265filtering by option type 267filtering by page reference 269linking to another file 271order of precedence for filters 639setting a submit action 272setting the format of a

submission 257setting the url for 285XForms submissions 339, 340

submissions, XForms 311actionref attribute 311

submitsubmitting the XForms model 362

submit action 272submitting forms 32submitwithformaterrors setting 273

substr function 402substrings

locating a substring within astring 400

replacing 396retrieving a substring 402

subtractXML DSig filters 603

supported image types 136suppresslabel option 252switch

toggling the case 367

Ttab order

changing by setting the focus 104setting for duplicated pages 447setting the next item 178setting the previous item 191

tabledisplay 92first element, identifying 102index, determining row index 553index, setting 364last item, identifying 166numericshaping 179orderingscheme 180orientation 181repeating rows 323row, adding 353row, deleting 350rowpadding 211

table item 69repeating rows of items 323setting the border 82

tablesdetermining row in a table 500determining the number of rows 502

tables, adding to a form 69tags

certificate 460distinguished name 460generating unique tags 455security engine 460signature 460

tan function 430tangent

determining the arc tangent 412determining the tangent 430

templates, setting for input 122terminology, XFDL 2ternary operator 662text

adjusting the space betweenlines 172

counting lines of text 391counting the number of words 393creating rich text fields 213, 253determining the length of a

string 397displaying 44, 159formatting using set rules 453justifying 156locating a character in 399locating a string within a

substring 401

692 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 699: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

text (continued)locating a substring within a

string 400making text lowercase 403making text uppercase 404matching strings 398padding strings 394removing leading and trailing white

space 405replacing substrings 396retrieving a substring 402truncating strings 394

texttype option 253thickness option 254thousands separator 112, 120tiling, when printing 198time

current time, determining 560determining the current time 517determining the hour 514determining the minute 515determining the number of seconds

difference between dates 566determining the second 518determining the time 519seconds, converting to 567

time data typestyle 117

time data types 111time function 519time functions 507, 560

dateToSeconds 509days-to-date 563determining the local date 564hour 514local-date 564local-dateTime 565minute 515months 571now 517, 560second 518seconds 569seconds-from-dateTime 566seconds-to-dateTime 567time 519

time zonelocalization 111

time zonesdetermining the local date and time in

the user’s time zone 565timing an action 90titles

displaying 44form titles 131

toggle function 479tolower function 403toolbar

display 92numericshaping 179orderingscheme 180orientation 181

toolbar item 8, 57detecting whether the mouse is over

the item 177determining the next item on the

page 152

toolbar item (continued)determining the previous item on the

page 154moving items to the toolbar 57setting the background color 80

toolbars, adding to a form 57Topaz signature

signature engine parameters 233topological sorting, computes 669toupper function 404trail modifier 145transmissions See submissions 270transmit

transmitting the XForms model 362transmitdatagroups option 255transmitformat option 257transmitgroups option 258transmititemrefs option 260transmititems option 262transmitnamespaces option 264transmitoptionrefs option 265transmitoptions option 267transmitpagerefs option 269triggering actions

automatically 30detecting if a value changes 479from a list 35, 38, 47, 49with a button 32

triggeritemexcluding from signature 585

triggeritem option 270trigonometry

determining the arc cosine 409determining the arc sine 411determining the arc tangent 412determining the cosine 415determining the sine 428determining the tangent 430

trim function 405truncating strings 394TTL

calling 496turning help on and off 492turning items off 79type option 271type property 310type settings 111type styles 117

UUFDL

origins 1ufv setting

helpcursor 273mandatorycolor 273menu 273modifiable 273pagedonewithformaterrors 273printwithformaterrors 273scrollfieldsonzoom 273submitwithformaterrors 273

ufv settingserrorcolor 273focusbgcolor 273focusfontcolor 273signwithformaterror 273

ufv settings (continued)validoverlap 273

ufv_settingsMenu Settings 275where and how to insert 273

unary minus operator 663underline, setting for font 108union

XML DSig filters 603universal settings

form settings 25page settings 28

updateModel function 504uploading data 346uppercase

making a string uppercase 404URL encoding

decoding a string 406encoding a string 407

url option 285URLDecode function 406URLEncode function 407user controls 32UTC

normalization 111utility

getInstanceRef 467utility 1.4 functions

getGroupedItem 465utility functions 430, 575

applicationName 430applicationVersion 432applicationVersionNum 433buildVersion 434buildVersionNum 435choose 575countChildren 439countDatagrouptems 440countGroupedItems 441current 577decimal 443destroy 444duplicate 447forLoop 451formatString 453generateUniqueName 455get 457getAttr 459getDataByPath 460getPosition 468getPref 469getReference 471isValidFormat 473power 576set 474setAttr 477toggle 479xforms.getPosInSet 500xforms.getSizeOfSet 502xforms.updateModel 504xmlmodelUpdate 505xmlmodelValidate 507

Vvalidating

the format of a string 473

Index 693

Page 700: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

validity, detecting changes 374, 387validoverlap setting 273value

detecting changes 479determining an absolute value 407returning items with empty

values 465value change, registering in XForms 388value option 288

definition 664value, setting in XForms 365version

determining build version of runningapplication 435

determining version of runningapplication 433

determining version of runningbuild 434

form version 131version attribute 4version number

determining version of runningapplication 432

version, referencing the XFDL versionoption 667

vertical scrolling in fields 218viewer package 493

addressbook 481env 482fileOpen 483fileSave 484getDefaultFilename 486getHeight 487getHelpMode 488getWidth 489getX 490getY 491messageBox 495param 496pringActualFormPage 523printActualTotalFormPages 524printDate 525printFormPage 526printPageSheet 527printSheet 528printTime 529printTotalFormPages 530printTotalPageSheets 531setCursor 498setDefaultFilename 499setHelpMode 492

Viewer, getting the user preferences 469visible option 289vision impairments

recording operating system colors 83vision impairments, messages for 75void data type 111, 117

WWeb Services

specifying requirements 206Web Services functions 290webservices option 290weeks

determining the day 512weight, setting for font 108

white spaceremoving leading and trailing white

space from strings 405white space in computes 661width

setting for items 251setting for lines 254

within modifier 145words, counting the number of 393writeonly option 292writeonly, setting an item to be 325WSDL functions 290

Xx-y coordinates 85XFDL

about signatures in XFDL 21commenting 18compute system 660computes 673design goals 1element definition 4element references 665form structure 4introduction to 1item definition 6MIME types 4notation 2overlap with other specifications 2page definition 4quoted strings 664restricted characters 16submitting forms as 257terminology 2version 4

XFDL compute systemoverview 667

XFDL, saving forms as 215XFDLID

calling 496XForms

actionsSee XForms Actions 347

computes 673conformance, determining 557event handlers

See events 367getting a reference to an instance 467getting the value of an element 457model item properties

See property settings 308model, creating 306See also XForms functions 544setting a data element 474version, determining 557xforms:group option 316xforms:input option 317xforms:output option 320xforms:repeat option 323xforms:secret option 325xforms:select option 327xforms:select1 option 333xforms:submit option 339xforms:switch option 340xforms:textarea option 344xforms:trigger option 342

XForms (continued)xforms:upload option 346

XForms Actionsfunctions, using with 349placement in a form 349syntax 347xforms:delete action 350xforms:insert action 353xforms:message action 356xforms:rebuild action 357xforms:recalculate action 358xforms:refresh action 359xforms:reset action 360xforms:revalidate action 361xforms:send action 362xforms:setfocus action 363xforms:setindex action 364xforms:setvalue action 365xforms:toggle action 367

XForms data modellinking field items to 299

XForms functions 544avg 549boolean-from-string 545choose 575compare 558count-non-empty 552current 577days-from-date 561days-to-date 563decimal-string 554empty return values 544if 547index 553instance 573max 551min 550months 571NaN 544now 560power 576property 557random 554return types 544seconds 569seconds-from-dateTime 566seconds-to-dateTime 567See also functions 544

XForms instancefiltering signatures 239

XForms instance replace 311XForms model

about 5construction complete,

registering 376construction, registering 375destruction, registering 377instance, locating an 573model item properties

See property settings 308ready, registering when 381rebuilding the model 357recalculating the model 358refreshing the model 359resetting the model 360revalidating the model 361setting a value 365

694 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 701: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

XForms model (continued)submitting the model 362updating 504

XForms options 298alert setting 303help setting 304hint setting 304metadata sub-options 303nodeset binding 302single node binding

See single node binding 299XForms Smartfill 311XForms submission

begins, registering 384complete, registering 385error, registering 386

XForms submissions 311actionref 311

xforms-deselect event 370xforms-disabled event 372xforms-enabled event 373xforms-invalid event 374xforms-model-construct event 375xforms-model-construct-done event 376xforms-model-destruct event 377xforms-optional event 378xforms-readonly event 379xforms-readwrite event 380xforms-ready event 381xforms-required event 382xforms-select event 383xforms-submit event 384xforms-submit-done event 385xforms-submit-error event 386xforms-valid event 387xforms-value-changed event 388xforms:alert 303xforms:bind 306xforms:case 340xforms:delete action 350xforms:group option 316xforms:help 304xforms:hint 304xforms:input option 317xforms:insert action 353xforms:item 327, 333xforms:itemset 327, 333xforms:message action 356xforms:output option 320xforms:range option 322xforms:rebuild action 357xforms:recalculate action 358xforms:refresh action 359xforms:repeat option 323xforms:reset action 360xforms:revalidate action 361xforms:secret option 325xforms:select option 327xforms:select1 option 333xforms:send action 362xforms:setfocus action 363xforms:setindex action 364xforms:setvalue action 365xforms:submission 306xforms:submit option 339xforms:switch option 340xforms:textarea option 344

xforms:toggle action 367xforms:trigger option 342xforms:upload option 346xforms/

labelsuppressing the label 252

xforms.getPosInSet function 500xforms.getSizeOfSet function 502xforms.updateModel function 504xformsenabled option 293xformsmodels option 306xformsreadonly option 295xformsrequired option 296xformsvalid option 297XML atrributes

illegal characters 664XML data model

getting a reference to an instance inthe XML data model 467

updating 505validating 507

XML DSig 606creating 603creating signature button 606digest 603example of signature and button 606filters 603object 603overview 603reference 603signature type 585SignatureValue 603

XML DSig filtersintersect 603subtract 603union 603

XML DSig supported enginesGeneric RSA 603Microsoft CryptoAPI 603Netscape 603

XML epilog 18XML prolog 18xml:lang

locale support attribute 16xml/

lang attribute 16xmlmodelUpdate function 505xmlmodelValidate function 507Xpath

functions 544XPath

applysymmetricswapping 543bidirectional function

(bidiordering) 532format2ltr function 539format2rtl function 541insertunicodecharacter 537nodeset, determining the context 577shapedigits 535

Yyear

determining the year 507year data type 117year data types 111year function 520

year window, setting 122years

determining the year 520

Index 695

Page 702: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

696 Lotus Forms 3.5.1: XFDL Specification Version 7.7

Page 703: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States
Page 704: Lotus Forms 3.5.1: XFDL Specification Version 7 - IBM - United States

����

Printed in USA


Recommended