Basic Customization > User Interface Customization > Presenting Information in the UI > UI Validation > Solutions > Procedures – Post-select Validation > Implementing Post-Select Validation Methods
  
Implementing Post-Select Validation Methods
There are two post-select validation methods that can be implemented in a validator – one for single-select actions and one for multi-select actions. The respective names of these methods are validateSelectedAction() and validateSelectedMultiSelectAction(). If you’re adding validation for an action that could never be a multi-select action, you only need to implement the validateSelectedAction() method. If your action could possibly be a mutli-select action, you should implement both the validateSelectedAction() method and the validateSelectedMultiSelectAction() method.
The only real distinction between the two methods is in the method signatures. validateSelectedMultiSelectAction() returns a UIValidationResultSet, whereas validateSelectedAction() returns a single result.
public class MyValidator extends DefaultUIComponentValidator{
@Override
public UIValidationResultSet performFullPreValidation()
(UIValidationKey validationKey,
UIValidationCriteria validationCriteria, Locale
locale) throws WTException {
UIValidationResultSet resultSet =
UIValidationResult.newInstance);

// perform your business logic here
// if you want to enable the action/component, do this:
// resultSet.addResult(UIValidationResult.newInstance(validationKey
UIValidationStatus.ENABLED));
// if you want to disable the action/component, do this:
// resultSet.addResult(UIValidationResult.newInstance(validationKey,
UIValidationStatus.DISABLED));
// if you want to hide the action/component, do this:
// resultSet.addResult(UIValidationResult.newInstance(validationKey
UIValidationStatus.HIDDEN));
return resultSet;
}

@Override
public UIValidationResultSet validateSelectedMultiSelectAction
() (UIValidationKey validationKey,
UIValidationCriteria validationCriteria, Locale
locale) throws WTException {
UIValidationResultSet resultSet =
UIValidationResultSet.newInstance();

// perform your business logic here
// if you want to execute the action, do this:
//
resultSet.addResult(UIValidationResult.newInstance(validationKey,
//
UIValidationStatus.PERMITTED));
// // if you want to abort the action, do this:
//
resultSet.addResult(UIValidationResult.newInstance(validationKey,
// UIValidationStatus.DENIED));
// if you want to prompt the user for confirmation, do this:
//
resultSet.addResult(UIValidationResult.newInstance(validationKey,
//
UIValidationStatus. PROMPT_FOR_CONFIRMATION));

return resultSet;
}

}