Implemented in 5.0 Alpha1

Unable to locate Jira server for this macro. It may be due to Application Link configuration.

Inplace editing is a user interaction pattern that consists in letting the user edit content right where it is being presented. In Magnolia's old admin central, double clicking on nodes to rename them was already inplace editing. When rebuilding this important feature within the new UI of Magnolia 5, we took the opportunity to focus on its usability.

What was implemented

Interaction

First, in a similar fashion as in old admincentral:

conditionaction

produces

within tabledouble-clickTurns on inplace editing at pointed column

while editing

ENTERSaves changes and exits inplace editing
ESCDiscards changes and exits inplace editing
blur edit fieldSaves changes and exits inplace editing

Then, the new Vaadin trees are now fully browsable using keyboard arrows. We also added a few keyboard shortcuts to allow for better navigation between available fields, providing a natural form-alike focus cycle. Finally, cursor position is now set at the end of the edit field when turning inplace editing on.

conditionactionproduces
with row selectedENTERTurns on inplace editing on currently selected row, at first editable column
while editingTABSaves and takes inplace editing to the next editable column. If there is no further editable column, goes to the next row.
SHIFT+TABSaves and takes inplace editing to the previous editable column. If there is no such editable column, goes to the previous row.

Configuration

Not all workbench trees should be editable "in place" in Magnolia 5, so the workbench definition has to be set editable in configuration.

Editable workbench columns are configured as well through the column definitions' editable flag.

Stories

The obvious story for inplace editing is the ability for a user to change how Magnolia is configured. In Magnolia 5, this is done in the new Configuration app - a basic content app for the config workspace.

  • The user can browse the configuration tree (provided).
  • She can add or delete content nodes or properties from the action bar (provided).
  • She can rename items and edit property values straight in the tree.
  • She can do it fast - opening a dialog would be overkill for such simple data structure, and would impair productivity.
  • I mean really fast: she can edit items in large series without having to click around endlessly. 

Problems & pitfalls

Interaction

The interaction pattern was the key. The old admincentral was providing inplace editing when double-clicking on table cells representing item names, values, etc. but it was the only way to edit data. This meant that in order to add 5 new properties, i.e. name them and set their values, the user had to keep pointing and double clicking again and again for each single cell she wished to edit. This was making the task repetitive and cumbersome, forcing her to constantly switch back and forth between keyboard and mouse.

Integration

Inplace editing had to be well integrated with the Vaadin tree tables that we use in Magnolia 5. This feature was only provided half way through in the standard Vaadin components. A whole table could be made editable, using customizable edit fields, but one could not edit a single row nor a single cell at a time. Additionally, impact on performance of trees and lists regarding data access had to be measured.

 

Techniques

Our implementation of inplace editing uses Vaadin's field factory which can be plugged to tables to customize the edit control within a cell. In our field factory, we ensure edit control is generated only at given row and column indices, checking that the column is indeed editable. Listeners are also attached there to trigger saving of the edited content.

Another advantage of the field factory is to be able to keep the client light-weight when making the table editable. All non-edited cells are sent and displayed as raw text instead of having a Vaadin component for each cell - which would have caused heavy updates and poor updating/re-rendering performance.

Finally, when turning inplace editing on at a specific column, if this column has a formatter, we need to temporarily remove it to edit raw value and restore it back as soon as editing is completed.

Known issues

A bunch of known bugs are listed under the following issue:
Unable to locate Jira server for this macro. It may be due to Application Link configuration.

Broader improvements are listed in the following issue:
Unable to locate Jira server for this macro. It may be due to Application Link configuration.