Program flow in Softadmin®
“Menu items” are the atoms that make up a Softadmin® application. Menu items come in different types, called Components. The most commonly used components are
- “grid” for showing a list of data
- “newedit” for displaying a form for entering data
- “detail view” for displaying complex data
There are (currently) 43 different components to choose from.
A Softadmin® application consists of menu items designed to fulfill the user’s various tasks, which can be quite complex. One of the most important challenges for a Softadmin® developer is to establish a natural program flow.
Links (not to be confused with “Login links”)
There are several types of links in Softadmin®. Most link types represent clickable links or buttons (notable exceptions are miniview tabs and multipart parts). What all link types have in common is:
- A specific origin (“from - menu item”)
- A specific destination (“to - menu item”)
- A specification of its passing fields (more info below)
Passing fields
Passing fields is a collection of name/value-pairs. The passing fields collection is populated every time a link is activated. How it is populated is determined by the passing fields settings for the specific link.
As you can see, the link above is a Row link shown in menu item "Search car" going to "Edit car". The passing fields "CarId" and "ModelId" will be passed along. Type determine the source of the fields value:
- Passing field
- The value will come from a passing field that was passed along to the "from - menuitem". If no such passing field exists then it's value will be empty.
- Parameter field
- The value will come from a Parameter (user input) to the "from - menuitem". If no such parameter exists then it's value will be empty.
- Session variable
- A session variable is a special variable that is stored on the web server and is unique to the user session. Rarely used, and it's use is not recommended.
- System setting
- (Formerly known as "App variable") The system settings are managed in the admin menu group. It's use is not recommended. System settings can be read in TSQL code instead.
- Constant value
- Here you can enter a constant string. Note - this feature is kept for backward compatibility. It is not recommended practice to put arbritrary constants in the passing field mappings. If you must use this feature, try to limit the constant to "1" (true) or "0" (false), and give the field a self explaining name.
- Column
- (only available for row links) The value comes from a named column in the "from - menu item".
- SelectedItems
- (only available if the source menu item is a grid with check boxes) The value will be a comma separated list of the checked rows.
- JavaScript
Receiving passing fields
For the destination menu item to use the passing fields, they must be mapped to SQL-parameters.
Above is the edit screen for the "Edit car" menu item (somewhat scrolled down). Highlighted is the part where the SQL procedure's parameters are mapped. Note that "Passing field" is only one of several options for the source of a SQL parameter.