Tags:

LiveField

Intro

The LiveField control is essentially just a field corresponding to a field in your database, except that it's "live" because on each key stroke it updates the field triggering any other calculations such as validation or relationships based on that field, albeit without running a script or committing the record. What this means in effect is that you use it to create effects such as as-you-type validation and liveportal filtering.

Live filtering creates an as-you-type search effect using a portal. Each character entered narrows down the records that match, enabling you to type only as many characters as are needed to find a unique match. Instant feedback to users like this helps them feel in control. No script is involved and the record is not committed.

As you type validation allows you to do things like light-up (or enable) a button as soon as valid data has been entered - you see this a lot with license codes, but you can also use it for email addresses, phone numbers, passwords etc where you want to ensure the user has entered the right data. Real time feedback like this is a hundred times better for usability than post-mortem validation and the slap-in-the-face of a dialog box.

What's more, because the field is a Reactor control it can easily be hidden or disabled too - no more conditional formatting tricks, hidden tab tricks or dodgy portals surrounding the field to make it hide and show!

What you need to know


LiveField( "fieldName" {; status ; bgColor ; scriptOnLoad ; scriptParameter})


Parameters

1 fieldName Field to filter on. Must be enclosed in quotes and be the full Table Occurrence::FieldName form.
2 status
(opt)
Text or name of a field containing “enabled” (the default), “disabled”, or “hidden”, or a calc which returns one of those 3 values.
3 bgColor
(opt)
Default is white, but you can specify the color: see “Background Color” in the “Basics” section.
4 scriptOnLoad
(opt)
The name of a script to run once loaded.
5 scriptParameter
(opt)
A parameter for the script above.


Example:


LiveField ( "CONTACTS_INTERFACE::Contacts Filter Entry" ; "enabled" ; "#DFE3E9" ; "Goto LiveField" )


Additional Notes:

  1. For filtering, you need a relationship from an input "Filter Field" to the data table. To make it "live", the filter entry field is replaced with a small web viewer showing a single field. As you type, the web viewer uses the Reactor to update the actual filter field in FileMaker, thus affecting the relationship and causing the portal display to refresh.
  2. To reduce flashing on XP and Vista, the Filter Entry field is set to global storage. Because of this, you need to overlay the portal with the Filter Entry field to cause it to update correctly.
  3. The LiveField() function can be used to edit any field on the layout table, but it cannot be used for related fields.
  4. Because LiveField() updates the field as you type (but doesn't commit the record) you can perform realtime calculations such as validation calculations or conditional formatting based on the value typed so far. You can also display live feedback such as the number of matching records for the characters typed so far.
  5. Unlike ScriptTrigger techniques, no scripts are needed.

Live Validation Example:

A numeric field, NumDays, is to be validated as the user types, to be no more than 30. A calc field contains the validation test: If( Numdays ≤ 30 ; "OK" ; "TOO BIG!" ). A WebViewer is set up for the entry of NumDays: LiveField( "Home::Numdays" ). The following screenshots show the result of the user having typed 21 and 213.

Picture 16.png


Live Filter Example (play the video clip):


Table of Contents