When to use View Mode

View mode can be used to steer how a form will be shown depending on where in the process the form is accessed. You can use it to show, hide and lock a specific field or a set of fields in a form. 


How to use View Mode

1. First you need to define your view modes in the process. For every time you refer to the specific form you want to use the View Mode functionality for, you need to set a View Mode. Go to your process model in the modeling tool.

2. Double click on the data object and the available settings are shown. 

3. Name your mode under the section "View mode" and confirm. This is all you have to do in the process model. 


BARIUM BEST PRACTICE: Give the View Mode the name of the performer, in capital letters. This makes it easier for you as a configurator to remember and refer to the correct mode when setting up the View Mode functionality for the form. 



4. Now you have to configure the settings at the fields in the form. Go to the form template you have connected in the model, you can access it directly from the process by opening the Asset Browser, hover the form template and click on the Edit pen.



5. For each field you want to influence according to View Modes you have to define in which View Modes the field should be locked or hidden. Use the settings "lockInViewModes" and "hideInViewMode".

Simply write the name of the modes (comma-separated, and no blanks, to choose more than one View Mode). When the form is presented in its View Mode the fields will act according to your set up for each form field. 



NOTE: If you want to hide a whole "layout" part with its underlying fields you have to set the hideInViewMode for both the layout and for every object underneath it. 

TIP: Try out the settings before deploying the application by using your own account as a performer for every step. In this way you can verify that the form is behaving as you like.




Example

You have three different view modes for a support question process, one for the creation moment (CREATE), one for the review task (REVIEW) and one for the answer task (ANSWER). The form is growing as the process develop and previous data is visible but disabled for the users



The three View Modes are pointed out by the green circles, if you follow the process the first circle represent the View Mode CREATE, the second circle represent REVIEW and the last circle represent ANSWER. 


1. VIEW MODE: CREATE - The first part of the form is visible and editable for the question initiation.



2. VIEW MODE: REVIEW - The creation part of the form is visible but disabled and a new section is shown, but the whole form is still not visible.



This is shown when the process is in the "Review Question" task, because this is were the form with the REVIEW View Mode is connected.




3. VIEW MODE: ANSWER - A new section for the answer is visible and editable and the previous part is the same as in the view mode REVIEW.



This is shown when the process is in the "Answer Question" task, because this is were the form with the ANSWER View Mode is connected.