Welcome to MSDN Blogs Sign in | Join | Help

Digression: the types of fields

Groove Forms forms are constructed by laying out fields on a page.  Actually, fields are just about the only things on the page (apart from field-groups and tab-groups, which we'll get to some time later).  So a "field", in the form designer, encompasses several things which you might not usually consider as data entry or data definition -- buttons, for example.

That's why the list of field types in the "Create New Field" dialog is quite so long.

Let's break down that list and look at each type of field in turn.  First the usual suspects: fields for entering data in a form.

Data entry fields

Text: a single-line text box.  There's no real limit on the size of text you can enter in one of these (but it's always entered on a single line); optionally, you can specify a maximum length, which restricts users from entering text beyond that limit, as well as other types of input validation.  When displayed on a form, the field actually has two parts: the input box, and a label beside it (to the left, or to the right, or above it).

Multi-line Text: a multiple-line text box.  You can specify the width and height.  Like all text fields, the amount of text Groove can store in a multi-line field is effectively unlimited.  You can also specify validation in the same way as a text field:  to ensure that the text contains a particular string, or doesn't, or is a valid email address or ZIP, and so on -- quite a long list of options.  (It's also possible to write code for extra validation).

Number: a single-line entry to hold a number.  It looks just like a text field, but doesn't allow non-numeric values.  Number fields can define a precision (the number of digits after the decimal point), and can restrict input to numbers in a particular range.  Now, numbers are stored differently from text in the Groove records' data; for example, you can build a view which adds up the total of a number field across several records -- can't do that with text.  Internally, numbers are double-precision floating point values.

Unformatted Number: like a number field, but doesn't format the number with the user's locale's numeric formatting -- separating thousands with commas, or whatever.  (You can't change the type of a field after you create it, so it's unfortunate that display formatting isn't just a property on a regular numeric field.  Oh well.)

Currency: like a number field, but displays using a currency format.

Password: a text field where the input only displays as dots to hide your secret.  (The data you enter in a password field is NOT encrypted in any special way.  Which is to say, it's encrypted multiple times with astounding confidentiality strength before being stored in Groove or transmitted to other members of the workspace, just like all data in a Groove workspace; and when the data arrives on another member's machine, after they handshake to verify that it wasn't spoofed or manipulated in transit and that the information originated from exactly who you claim to be, it's decrypted with a stunningly deep reverse of the original encryption algorithm, so that the other members can look at it if they want to).

Date: a date (with no time portion; just the date).  In the form, date fields show a calendar button beside the date input box;  pressing this button opens a calendar (defaulting to today's date if the field is empty).  You can design the field to have an initial value (a particular date, or "today", "tomorrow"), choose the date format, and validate that the date lies within a particular range.  (Again, it's possible to add code for more particular validation).

Date Time: a date and time.  The calendar picker popup for a date/time field includes a time picker too.

Option Buttons, aka Radio Buttons.  The field includes a list of options;  for each option, you can specify the "display value" (which appears beside the selection button in the list) and also a "stored value" (which is saved into the record when that option is chosen). 

The options needn't be hard-coded; they can come from a lookup (ie. pulling data from a set of records in Groove).  Since we haven't yet created any records in the contacts-form example I'm building, we'll cover lookups another time.

Check Box: just one checkbox.

Drop-down List: what it says.  Options are defined the same way as for Option Buttons fields and List Box fields.  Optionally, you can have the drop-down list include a blank value; otherwise, it'll default to the first option.  And that "+" button is another option, allowing users to add their own values to the list (pressing it opens a little custom entry dialog).

 

List Box: a list box.  Specify the options, and the size of the listbox, and whether to allow multiple selections.

 

Other types of data

All the standard field types above should be fairly familiar.  If you're looking closely, you might notice that they're implemented with HTML;  the form, it turns out, is actually a web page inside of the Groove forms tool (which is the basis for the custom scripting we'll get into later).  But there are some types of fields which go way beyond HTML's usual capabilities, allowing the form to become more dynamic.  These fields are:

Rich Text.  A proper rich-text entry field, with text and paragraph formatting.  In the example pictured here, I set some default contents for the richtext field, and also turned the background blue.  The toolbar is optional; right-clicking pops up a formatting menu.

The richtext field, like the other fields, has an optional field label beside it; and you can specify the width and height.  One thing you can't easily do is specify validation of the contents, though.

It even has a built-in spell-checker; press F7.

Attachments: a place to attach one or more files of any type.

 

Contact: a field which contains a real, "live", groovey contact.  This is very special, actually; maybe we'll use one of these in the contact-form example.  If there's a Groove contact in the field it will display online awareness, and you can right-click to send instant message, add to your personal contact list, invite to a workspace, and so on.

Non-Data Fields

Finally, the oddments and assortments.  These fields appear on a form, but there's no data stored in them.  (When I first started using Forms, I immediately wanted to add a button onto a form, and have some JavaScript run when the button was clicked.  Turns out this is really easy, but it took me a while to realize how:  the secret is that buttons are fields.  And newlines are fields too.  Now isn't that cute?).

I'm all out of screenshots for this lot.  Their look-and-feel is defined mostly by the stylesheet used on the form anyway;  stylesheets are another important thing on the "later" list.

Form Heading: a heading for the form.  You usually never have more than one of these per form.

Section Heading: another piece of heading text, usually big and bold.

Static Text: just a random piece of text; for an extra label, for example.  The default formatting is different from a section heading or a form heading.

Horizontal Line: a rule across the form (or across part of the form).

New Line: a line-break on the form.

Image: a picture (not editable by the user).  Use an image field to put your logo on a form, for example.

Script Button: a button, with some script attached; when you press the button it runs the script.   The script has access to everything in the current state of the form, and the record underneath the form;  forms scripting is quite powerful (and really not difficult, but we'll get to the details soon),

 

Published Friday, July 22, 2005 8:26 AM by hpyle
Filed under:

Comments

# Furthur!

Friday, September 09, 2005 3:39 PM by hughpyle
Here's a recap and subject-index of the story so far.

Getting started with Groove Forms; the component...

# Furthur!

Friday, September 09, 2005 3:40 PM by hughpyle
Here's a recap and subject-index of the story so far.

Getting started with Groove Forms; the component...
Anonymous comments are disabled
 
Page view tracker