K2 smartforms: Hello World

This tutorial contains step-by-step instructions to build a very simple "Hello, World" K2 smartform using K2 Designer. This tutorial is ideally suited for users who are brand new to K2 smartforms and is intended to give you a basic understanding of K2 smartforms. K2 applications typically consist of four main components: Data, Forms, Workflows and Reports, and K2 smartforms is one of the options for the Forms component of K2 Applications.

Application Design

Before we look at the design of the simple "Hello, World" Form, let's quickly review some SmartForms concepts.

SmartForms Concepts: Forms, Views, Controls, Rules

What is the difference between a Form and a View? What is a Control? What is a Rule?

Forms
A Form is essentially the "web page" that is used by end users, and users would access a Form through a URL ("web address"). Typically, a Form will contain one or more Views and Controls, and could have Rules that perform some kind of processing.

Views
Views are re-usable collections of Controls and Rules that are usually dragged onto a Form, and are usually associated with a SmartObject as the data source for the View. For example, you may have an "Employee Details" View that contains all the information about an employee in your organization. The Data for this View is provided by an "Employee" SmartObject which in turn retrieves data from the various systems that provide employee data. Once you create this "Employee Details" View, the View can be re-used in multiple Forms. This provides an easy way of dragging and dropping a section with Employee Information into any Form, and an easy way of maintaining the layout and behavior of the Employee Details View in one place, with any View changes automatically applied to all Forms where that View is used.

There are two types of Views: Item Views and List Views. Item Views contain the content from just one record. List Views contain multiple rows of content.

Controls
Controls are components like buttons, textboxes, drop-down lists, images, date pickers and so on, that are used on Views and Forms. Controls are often associated with a SmartObject property (for example, the "Name" textbox is associated with the "Employee Name" data field), but Controls do not have to be bound to Fields (for example a Button or a Label control which only shows some static text on a View).

Understanding Forms, Views and Controls

Rules
Rules are the processing logic or "programming" for smartforms. For example, the Form designer might configure a Rule that fires when a button is clicked on a Form, and then add some Actions to that rule to do something such as showing a message box and saving data. Rules consist of Events, Conditions and Actions. An Event is when something occurs (such as a button clicked), a Condition checks to see if some criteria has been met (such as required form fields have values) and an Action says do something if the event and conditions are met (such as starting a workflow and then showing a message to the user).

Design of the "Hello World" Form

The Form we will build in this tutorial allows the user to input their name, and when the user clicks a button, checks that a Name was entered and then shows a dialog box that returns the Name entered along with the current Date.

Behavior of the "Hello, World" Form

As simple as this scenario sounds, this tutorial covers some basic principles about Views, Forms Controls and Rules. By following this build guide, you will learn:

When you are ready to begin, please continue on to the "Hello, World" Build guide for the step-by-step instructions to build this SmartForm.

K2 smartforms Product Documentation: User Guide4.6.10
Video Links Learn Support
No videos found for this article
K2 on YouTube
No Additional links found for this article
No self-learning content for this article
Try some scenarios...
No relevant support links available for this article