Designing A Form

/Designing A Form
You are here:
< Back

Designing A Form

We assume that the reader of this document has at least basic knowledge about K2 SmartForms.

Views

Before you create a form, you’ll need to create one or more views. A view is a re-usable block of information you can place on a form. It contains controls, parameters, rules, and possibly a linked data source. A view comes in two flavors: item views and list views. Both are supported, but continue reading to check the supported features.

Item View

The layout of an item view starts with the question about the dimensions of the table you want. When displaying forms in the browser, the available screen is usually in landscape mode and you can use several columns next to each other. If you want to display this form in K2 Business Apps on a phone, you may want to limit the amount of columns.

List View

The list view forces you to link a data source, after which you can select what columns should be shown in the list. This time, you do not need to worry about the width of the screen. K2 Business Apps creates a block per row of the list view and each block shows the configured controls underneath each other.

Forms

A form is a collection of views and/or controls, accompanied by parameters and rules.

Limitations

The most important part is:
Controls are only shown if they are on a view.
We aim to support controls directly on the form, but for now they can only be used to store data. All rules for the controls will still function when placed on the form directly.

Another important one is the limitation of list views:
If a form contains a list view, only the list view – and one list view at most – will be shown.
The reason for this is usability. A form shown on a phone quickly becomes larger than the screen, thus allowing you to scroll vertically. When showing a list view, you want to be able to scroll – vertically – as well. Because we show just one list view, we use the entire screen to display it and the app only needs one vertical scrollbar. Now imagine multiple list views on a form. The app allows you to scroll the entire form up and down, but also each list list on its own. This is considered a bad user experience, hence our choice to not support it.

Screenshots

Form

Form on Android Form on iOS

View

From top to bottom:

  • View with a title that is collapsible
  • View with a title that is not collapsible
  • View without a title that is collapsible (iOS has a known bug where the collapse icon is not visible)
  • View without a title that is not collapsible. Not that the entire header is removed in this case.
Expanded

Expanded Views on Android Expanded Views on iOS

Collapsed

Collapsed Views on Android Collapsed Views on iOS

Tags:
2020-10-07T11:48:05+01:00