Tuesday, February 25, 2014

Fun with dropdown menu titles

As we were recently fixing a few issues with the Dropdown Menu control, we started thinking more seriously about the behavior of that control in Form Builder and Form Runner, and it turned out to be interesting!
The questions revolve around the special item at the top of the list, which we call the dropdown title. It is present to encourage the user to make a selection. With Orbeon Forms 4.4 and earlier, we simply had a rather imperative “[Select…]” title.
So what title should we show, and when? There are different possibilities. For example:
  • When the control value is optional, we could show a different title, because in that case we shouldn’t tell the user too imperatively to enter data.
  • We could leave a blank title in both required and optional cases.
For now we have decided to show a message in both cases, as a little bit of additional hinting shouldn’t hurt. And to be polite, we say “please”:


Encourage the user a bit
Encourage the user a bit

Here is how the dropdowns look when you open them:


Required value
Required value
Optional value
Optional value

Now when a value is required and a choice is selected, you can argue that there is no point showing “Please select:” to the user anymore, as the user shouldn’t go back to a point where no value is selected. Here we could:
  • entirely remove the title
  • show a blank title
What if you have selected a choice by mistake, and you want to go back to an empty choice to remember to make a selection at a later time? This argues in favor of leaving a blank title. But if an initial choice is provided, either by default or by loading values from a service, you probably shouldn’t be able to get to a situation where no choice is selected!
So it’s subtle and there might not be a “one size fits all” solution. For now, we have elected to blank the title when a value is selected even in the required case:


Blank title for required value
Blank title for required value

Of course, when the selection is optional, then it makes sense to have a blank title to deselect the choice.


Allow deselection
Allow deselection

In addition, we have now internationalized the title, something we had apparently overlooked for a long time (of course, Form Builder has allowed you to internationalize choices since the beginning).


Localization
Localization

We noticed that in review and PDF modes, we showed the good old “[Select…]” title in the absence of a selection, which was not very useful! It is better to show an empty field, which also allows users who print forms on paper to fill in a value:


Filled optional value in review
Filled optional value in review
Empty optional value in review
Empty optional value in review

Finally, instead of being hardcoded this is now entirely implemented in a simple XBL component which is quite easy to adapt.
These improvements will be available in Orbeon Forms 4.5.

Thursday, February 20, 2014

Form versioning

What versioning does

Form versioning is an important new feature in Orbeon Forms 4.5. In the past, Orbeon Forms was only keeping track of one form definition for every published form. This meant that if you republished a form, the previous form definition was overwritten. It also meant that when showing data, Orbeon Forms was always using the latest published version of the form definition. However, there were cases where this could lead to unexpected results, as fields might have been added or removed in the new form definition, which means that some values could either not be shown, or would be missing when using a newer version of the form definition.

Starting with Orbeon Forms 4.5, publishing a form definition doesn't overwrite any previously published one, but creates a new version. Also, Orbeon Forms now keeps track of the version of the form definition that was used when creating data, so it can use the same version in the future when that piece of data is edited, viewed, printed, etc.

This feature will be available in Orbeon Forms 4.5, and can be used with all the supported relational databases (Oracle, MySQL, and DB2). At this point, it isn't supported with the eXist database. For relational databases it uses columns that were already added in version 4.4, but were still unused at the time; so if you are upgrading from 4.4, the changes to the schema are relatively minor: there are none on DB2, and only minor DDL changes for Oracle and MySQL.

Data migration

The idea of data migration is to automatically update data created with an older version of the form definition to match the format of a newer form definition. It's obviously not something that you always want to happen, but there are cases when migrating data makes sense. For now, Orbeon Forms 4.5 doesn't do any data migration: editing, viewing, printing, etc of saved data is always done using the same version of the form definition used when that data was initially created. However we do have ideas on how to migrate data, for the cases where this would be desirable, and it might be something future versions of Orbeon Forms might do.

The summary page

The summary page for a form only uses the latest version of the form definition. In particular, this means that there will be additional columns in the table only for fields you marked as show in summary in the last version of the form definition. (Similarly, the summary page will show search fields only for fields marked as show in search in the last version.) In some case, this behavior isn't optimal, as you might have fields marked as show in summary in the last version that didn't exist in earlier versions, and vice versa, fields that were marked as show in summary in earlier versions and that aren't in the last version. A row in the summary page for data created with such an older version will show an empty cell in the corresponding column in the former case, and no data, since there is no corresponding column, in the latter case. This is something that we're planning to improve.

Tuesday, February 4, 2014

Hints for checkboxes and radio buttons

With Form Builder, form authors can provide a help message for every form field, and we recently discussed how we improved the visual appearance of help messages. For radio buttons and checkboxes, it sometimes make sense to have a message targeting a specific radio button or checkbox, as done in this fictional example:


You can now enter such a message through the dialog Form Builder already uses to provide the label and values for each checkbox or radio button. To that effect, the dialog now includes a third column Hint, as you can see in the screenshot below. Just like for the labels, you can use HTML in the hint if you check the corresponding checkbox at the top of the dialog.


This feature will be available in Orbeon Forms 4.5.