Wednesday, June 10, 2020

Copying and pasting across forms

You might already know that Orbeon Forms supports cut, copy, and paste operations for the following items:
  • individual form controls
  • grids of controls
  • sections and their content
The cut and paste operations can be undone and redone with the "Undo"/"Redo" icons. All of this is available with the icon buttons at the top of the toolbox.

Before Orbeon Forms 2020.1, the cut/copy/paste operations were restricted to the currently running instance of Form Builder. They did not work between different Form Builder windows or tabs, or between edition sessions of the same form.

With Orbeon Forms 2020.1, we are improving this and these operations are now available between forms belonging to the same user session. For example, the following scenarios work:
  • Copy an item, go back to the Form Builder Summary page, reopen the same form or open a different form, and paste the item just copied.
  • Open several forms with Form Builder in different tabs or windows of the same browser (and the same browser user), and copy/paste items between these forms.
This allows more sharing between forms, including reusing parts of a form in other forms, copying sections from existing forms and pasting them into section templates for further reuse, and more.

We hope you will like this enhancement! See also the documentation.

Tuesday, May 26, 2020

The new Multiple File Attachments control

Orbeon Forms so far features two types of attachment controls:
  • File Attachment
  • Image Attachment
Recently, a customer kindly sponsored a new Multiple File Attachments control.

Until now, the only way to allow the user to attach an indeterminate number of files was to create a repeated grid and place the File Attachment control in it. This works, but it requires the form author to figure out how to do it, and it is not the most user-friendly user interface for the end-user.

The new Multiple File Attachments is much simpler: as a form author, you simply add the control to the form. It is also an improvement for the end-user: not only does it look better, but it is also much easier to use.

The new Multiple File Attachments control
You can reorder the files with drag and drop, remove one of the files with the "X" button, and download back the attachments (a function you can disable if you don't want it).

While we were at it, we also added a drag and drop area. Browsers have supported drag and drop of files for a long time and it was long due in Orbeon Forms. So when on a computer you can now simply drop one or more files directly to the attachment control. Alternatively, you can use the "Select Files" button and select one or more files at a time.

We also updated the existing single File Attachment control to have the same look and feel, as it badly needed a cosmetic refresh! In fact, it's now the exact same implementation. We are renaming it the Single File Attachment control.

The updated and renamed Single File Attachment control
When using the Multiple File Attachments control, the validation constraints that exist for the Single File Attachment control apply:
  • File type: You can filter the file types, for example images, PDF files, Excel files, etc.
  • Maximum file size: Here, the file size applies to each individual file. You can also set a maximum size for the entire form as was the case before.
We hope that you will like this improvement. It will be available in the upcoming Orbeon Forms 2020.1.

Wednesday, April 29, 2020

Validating a field against existing form data

Here is a scenario that a customer asked us recently: can you validate a field to make it invalid if its value already exists in data saved in the database?

The answer is that it is possible! Here is how, assuming you have a field called "Job" in your form that you must validate this way. First, create a service like this:

  • The path `/app/form` must be adjusted to your app/form names.
  • The path, in the XML, `section/job` must be adjusted to your section name/control name.
This service will call the Orbeon Forms built-in search service, asking to retrieve specifically the value of the "job" form control.

Mark the "Job" field as searchable by selecting the "Show in search" checkbox in the Control Settings dialog, so that the field is indexed and searchable in the database.

Then create an action that calls this service upon form load:

Store the service response into a dataset called "jobs":

Finally, add a constraint to say that you don't want the value of the field to belong to that set:

And that's it! The service will run on form load, store the list of all existing job values, then validate the current job value against all the existing values.

We should note that this has limitations, in particular, if another user saves new form data in the meanwhile, then the constraint will not be synchronized. An improvement could be to re-run the service before saving.

Monday, April 13, 2020

Dynamic loading of closed sections

In many cases, Orbeon Forms users choose to deploy forms that contain multiple sections using the wizard view. With that view, each section appears one after the other, so that the user typically navigates through steps to complete the form. Orbeon Forms features several validation modes, including "free", where the user can navigate freely between wizard sections, and "strict', where the user must fully complete a section before going to the next.

To improve performance, since Orbeon Forms 2018.1, each wizard page loads dynamically. So if you have a form with 20 pages (or sections), only one of them is present in your browser at a time.

But what about forms that don't use the wizard view? In this case, form sections appear on top of each other on a single web page. If all sections are open, there is not much we can do to reduce the size of the page to show the user. But sometimes, sections or subsections are initially closed.

Form with closed sections
You can configure this behavior in Form Builder by deselecting the "Initially Open" checkbox. (You can also explicitly make the section collapsible, although the default, configured by properties, also works unless you changed those properties in properties-local.xml.)

Controlling whether a section is initially open or closed
With Orbeon Forms 2019.2, we apply the same performance optimization we did to the wizard view: all sections and subsections that are initially closed load their content dynamically (or lazily) as the user opens them. This can help page loading times and performance in the browser, as there is less HTML markup to send and process on the client, especially when there is a large number of sections.

We hope you'll like this enhancement!

Tuesday, March 31, 2020

Orbeon Forms 2019.2.2 PE

Today we released Orbeon Forms 2019.2.2 PE!

This update to Orbeon Forms 2019.2 PE contains bug-fixes and is recommended for all Orbeon Forms 2019.2 PE and 2019.2.1 PE users.

For details, see the complete release notes.

You can download the latest versions of Orbeon Forms from the downloads page.

We hope you enjoy this release!

Monday, March 9, 2020

Obtaining your data's status from JavaScript

We regularly add new APIs (application programming interfaces) to Orbeon Forms. Those fall into two categories:
  • server-side (exposed as Java or HTTP)
  • client-side (exposed as JavaScript)
The client-side API so far exposes functions as:
With Orbeon Forms 2019.2, we introduced a new JavaScript Form Runner API to indicate whether the form data is safe or not. We also call this information the data status.

By default, form data is considered safe if it's been saved to a database. This can also be controlled explicitly using the set-data-status action in a process.

If you have a custom client-side script that needs to interact with your form, knowing that the data is safe can be useful information. For example, this might allow you to allow the user to navigate away from the form or to close it.

This API consists of an easy function call. See the documentation for details.

We hope you will like this Orbeon Forms 2019.2 feature.

Monday, March 2, 2020

Orbeon Forms 2019.2.1 PE

Today we released Orbeon Forms 2019.2.1 PE!

This update to Orbeon Forms 2019.2 PE contains bug-fixes and is recommended for all Orbeon Forms 2019.2 PE users.

For details, see the complete release notes.

You can download the latest versions of Orbeon Forms from the downloads page.

We hope you enjoy this release!