Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Forms wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category All IBM Forms 4.0 documentation IBM Forms Server 4.0 API documentation Custom Search Scope...
Search
Community Articles > Best Practices for Form Design > Wizard-Style Forms Best Practices > Mirror data between pages
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Adam Kozyniak
Contribution Summary:
  • Articles authored: 115
  • Articles edited: 103
  • Comments Posted: 0

Recent articles by this author

Specify type for public data

When creating or marking data as public in the Designer, specify the data type using a Model Item Property. Example Below are some examples of Model Item Property data types: xforms:bind nodeset"instance('INSTANCE1')PAGE1ffloat" type"xsd:float" xforms:bind xforms:bind ...

Do not cross reference types when mapping data

When mapping data, do not crossreference data types. Data should be mapped type to type, for example string to string rather than string to integer.

Do not create submission or cancellation buttons for forms used in FileNet

A Lotus form imported into FileNet is submitted using the SaveLaunchComplete buttons located in the FileNet toolbar. The form itself should contain no submission or cancellation buttons. When creating a form for FileNet using the Designer, do not insert submission or cancellation buttons into ...

Toolbar differences between Lotus Forms and FileNet

When rendering forms, toolbar hotkey accessibility differs between Lotus Forms and FileNet. Lotus Forms accessibility also varies based on the browser. FileNet eForms use Java Script key listeners, which means toolbar hotkeys will always be Ctrl + Alt + key. Lotus Forms forms use the HTML based ...

Use ufv_settings to hide Lotus Forms menu

When a form is created for use in FileNet, use the ufvsettings in the Designer to turn off the menu toolbar. Forms rendered in FileNet use the FileNet toolbar to control form submission. The menu used by Lotus Forms is not required and should be turned off. Example ufvsettings menu ...

Learning Center articleMirror data between pages

Added by Adam Kozyniak | Edited by IBM contributor Neal A Timpe on March 21, 2011 | Version 11
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: compute, field, wizard-style form, XForms



"Mirroring" allows you to copy data between form items, such as two fields. This means that both items will always contain the same value. Generally, this is most useful in forms with multiple pages that use common data.

For example, you may have a form that requires the user to provide their address on page one and page three. Instead of forcing them to re-type their address on each page, you can simply set up the form to copy their address from page one to page three. This is particularly useful for wizard-style forms, as it allows you to collect user data using simple wizard-style pages, and have the corresponding sections in the final traditional-style page automatically update with this information.

Note:
When you mirror data, the user can still change the information in the item that contains the copy of the data. For example, once the user’s address was copied to page three, the user could then move on to page three and type in a completely different address. Unfortunately, doing this will destroy the compute you added to share the data from the original item to the copy. To prevent this problem, always make your mirrors read-only. This will prevent the user from changing the data and ruining your computes.

XFDL example


In XFDL, there are two ways to mirror data. The first is a simple reference, where the page, item, and option that contain the data you want to mirror are placed in a compute contained in the option you want to share the data with. For example, if you wanted to collect the value of the first name field on page 1 and copy it to the value option of the first name field on another page, you would create the following compute:

<value compute="PAGE1.first_name_field.value"></value>


The second method is dereferencing. When you dereference an item or option, you tell the compute to find the form element identified by a reference. In other words, if an option had a literal value that contained a reference, and you wanted to know what the value of the reference was, you would use a compute with a dereference to retrieve it. You would primarily use a dereference to find the value of a cell in a popup or list. For example, the value of a list depends upon which list choice the user selected. Therefore, to discover the value of a list, you must first determine which cell was selected and then determine the value of the cell.

The following code sample shows a simple compute with a dereference:

<value compute="PAGE1.occupation_list.value-value"></value>


XForms example


In XForms, you can mirror data by having two items reference the same node in the data model. For example, to copy a user’s first name from a field on page 1 to a field on page 3, both fields must contain an XPath reference to the "first_name" node. The first code sample below shows a sample XForms instance that contains a "first_name" node. The second sample shows two pages, both containing fields that reference the "first_name" node.

XForms instance that contains the "first_name" node:

<xforms:instance xmlns="" id="Name">

<full_name>                      

   <first_name></first_name>

   <last_name></last_name>

   <middle_name_1></middle_name_1>

   <middle_name_2></middle_name_2>

</full_name>

</xforms:instance>


XForms items that reference the "first_name" node:

<page sid="PAGE1">

<global sid="global">

   <label>PAGE1</label>

</global>  

<field sid="FirstName">

   <xforms:input ref="instance('Name')/first_name">

      <xforms:label>First Name</xforms:label>

   </xforms:input>

   ...other options... 

</field>

...other items... 

</page>


<page sid="PAGE2">

<global sid="global">

   <label>PAGE1</label>

</global>  

<field sid="FirstName">

   <xforms:input ref="instance('Name')/first_name">

      <xforms:label>First Name</xforms:label>

   </xforms:input>

   ...other options... 

</field>

...other items... 

</page>


Exceptions to this practice


There are no exceptions to this practice.

  • Edit
  • More Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (11)
collapsed Versions (11)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (11)Mar 21, 2011 4:40:49 PMNeal A Timpe  IBM contributor
10Dec 2, 2010 6:24:22 PMJack Mitchell  IBM contributor
9Dec 2, 2010 6:14:16 PMJack Mitchell  IBM contributor
8Apr 16, 2009 1:19:36 PMDeanna Drschiwiski  IBM contributor
7Sep 8, 2008 6:05:29 PMDeanna Drschiwiski  IBM contributor
6Jul 4, 2008 5:47:24 PMDeanna Drschiwiski  IBM contributor
5Jul 4, 2008 5:44:45 PMDeanna Drschiwiski  IBM contributor
4Jun 12, 2008 2:20:35 PMAdam Kozyniak  IBM contributor
3Jun 10, 2008 6:48:16 PMAdam Kozyniak  IBM contributor
2Jun 9, 2008 2:10:21 PMAdam Kozyniak  IBM contributor
1Jun 9, 2008 2:05:13 PMAdam Kozyniak  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use