Service Studio 5.1 Help
Build a Screen Block
When designing your web
screens you can use screen blocks
in order to reuse contents that are already built and are common to several
screens. In a screen flow, the Screen
Block is created by the
Web
Block elements, according to the screen flow type.
|
How to add a Screen Block: |
|
The layout of screen blocks is designed, just like any screen, through the Web Screen Editor.
You can add the following elements to your Screen block:
Input parameters: Used to send data to the Screen block. How?
Local variables: Used when you want to create variables the scope of which is the Screen block itself. How?
Screen preparation: Used to execute an action before the rendering of the Screen block. How?
Screen actions: Used when you want to create actions that are only available inside the Screen block. How?
Screen Blocks must be self-contained, since they are evaluated independently from the screen where they are inserted. To communicate with a Screen Block, you have to define its input parameters, and instantiate them in the screen. How?
When working with web blocks
inside other web blocks, that is, a sequence of web blocks including other
web blocks (nested web blocks) be extra careful regarding the loops. A
web block loop happens in a nested web blocks scenario if, at some point,
a web block includes a prior web block. This leads to an endless include
situation because the web block build process will keep turning back.
At design time, the offending web block preview will be stopped and a
"Block loop detected in block '<block>'"
error message is displayed inside it.
What Happens when a Web Block is Found During Screen Rendering?
For each web block found during screen rendering, the following steps are followed:
The web block input parameters are set to their new arguments,
The web block preparation is executed,
The web block rendering is executed.
All the other web block context is maintained,
When an End element is used
in the screen action, the web block's current execution context is kept
the same way the screen is.
On the Flow canvas there are, however, some differences between Screen Blocks and screens:
A Screen Block cannot be used as the destination of a flow.
The only destination not allowed in a Screen Block is the current screen, due to the fact that a Screen Block depends on the screen where it is used.
See Also
About Screen Blocks | Change a Screen Block | About Caching Contents | Adding JavaScript