Grundlegende Anpassung > User Interface Customization > Presenting Information in the UI > UI Validation
  
UI Validation
Objective
You want to hide an action or attribute in the UI based on some context information.
You want to determine whether or not an action selected in the UI should be allowed to proceed based on some context information.
You want to determine whether or not a user can proceed to the next step in a wizard or whether the entire wizard may be submitted, based on the data entered by the user in that wizard.
Background
UI Validation is intended to simplify the experience of the Windchill end-user. There are three categories of UI Validation that will each be discussed in further detail in this document.
Pre-Validation
Post-Select-Validation
Post-Submit Validation
Pre-Validation
The first category of UI Validation is referred to as Pre-Validation. This is the category of validation that most people will first associate with UI Validation. Pre-Validation is a term that describes the process of determining whether or not a UI Component should be available in the UI. An example of Pre-Validation would be disabling the “check-in” action for an object that is not checked-out. Pre-Validation can be applied to both actions and attributes in the UI. Of the three types of UI Validation, this type is the most often-used.
Post-Select Validation
A second category of UI Validation is Post-Select Validation. Post-Select Validation is the process of determining whether or not an action should be allowed to proceed once it is selected in the UI. An example of post-select validation would be displaying an error message and not allowing the checkout to proceed if a user tries to perform a checkout on an object that is already checked out. Post-Select Validation applies only to actions.
Post-Submit Validation
The final category of UI Validation is Post-Submit Validation. This type of validation is used exclusively in wizards or other forms where users enter data. An example of Post-Submit Validation would be stopping a user from moving to the next step in a wizard because the data they’ve entered in the current step is invalid. Post-Submit Validation applies only to wizard steps and wizard submissions.
Scope/Applicability/Assumptions
Pre-Validation - Suppose you want to hide an action in the UI from users who are not members of the current container’s team.
Post-Select Validation - After a user selects an action, you want to determine whether or not the target object is in a certain lifecycle state before allowing the action to proceed.
Post-Submit Validation - After a user enters data in the first step of a wizard and tries to navigate to the next step, you want to determine whether or not the information entered on the first step is valid before allowing them to proceed.
Intended Outcome
Pre-Validation - Before the page is rendered, you are able to determine whether or not the user is a member of the current container’s team. If not, the action is not displayed on the page.
Post-Select Validation - After the user invokes the action, you are able to check the target object’s lifecycle state. If the state is not the state you require, you can display a message to the user, and the action is not performed.
Post-Submit Validation - When the user clicks “next” on the wizard, you get the data entered in the current step and are able to determine whether or not it is adequate to allow the user to proceed to the next step. If the data is inadequate or invalid, you can display a message to the user and not allow them to proceed to the next step.
Solutions
Procedure – Pre-Validation
Procedures – Post-select Validation
Procedures – Post-Submit Validation
Miscellaneous Tips, Tricks, and Things to Avoid
Presenting Information in the UI