Websydian v6.1 online documentationOnline documentation - Websydian v6.1

Problem - EventHandlerWithValidation and multiple views in WebInput

Severity High
Product Websydian
Websydian version 5.5, 4.0, 3.1
Resolved in v5.6
Plex version All
Platform All
Category Security
Problem If the EventHandlerWithValidation function is used with more than 1 view in the WebInput variable, errors in the first views are not reported if there are not any errors in the last view.
Answer The field Environment<*Validation> is set if an error is discovered in a view.

The problem is that this field is cleared after each loop over a view, so errors are only reported if there are errors in the last view that is processed.

Workaround Create a new field (ValidationFailed) that inherits from FIELDS/YesNo.

The following changes should be applied to all functions that inherit from WSYVAL/EventHandlerWithValidation. The easiest way to accomplish this is to create an abstract EventHandler function with the changes and then let all the EventHandler functions inherit from the abstract function.

Add the field ValidationFailed to the local variable WsyBase.

Insert the following code into the edit points shown below.

Pre point Start Initialize
Set Environment<*Validation> = <*Validation.*Normal>
Pre point Handle message
If Environment<*Validation> == <*Validation.*Error>
Set WsyBase<ValidationFailed> = <ValidationFailed.Yes>
Post point 0 Pre validation
Set WsyBase<ValidationFailed> = <ValidationFailed.No>
Pre Point 0 Post field_ validation
If WsyBase<ValidationFailed> == <ValidationFailed.Yes>
Set Environment<*Validation> = <*Validation.*Error>
Pre Point 0 Additional error handling
Set Environment<*Validation> = <*Validation.*Normal>