Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ProposalField: fix validation errors
If a potential value that is not accepted by the validator of a ProposalField is passed to the field, the display text needs to change while the value stays the same. If this value comes from a selected lookupRow, the lookupRow will be set and therefore, the formatting needs to consider it. If this value comes from a touch popup, there are several things that need to be considered: * The lookupRow must not trigger any value changed logic, as setting a value that does not pass validation will reset the value to the previous one. Otherwise, if the new lookupRow is null it will set the value of the field to null and therefore the reset-logic after a failed validation resets the value to null as the former value is already lost. * The displayText needs to be set without exception, as it can differ from the value. Consider the value 'info' for which a validator adds an error status with severity info and another value 'throw' for which the validation fails. Switching between these two values will never change the value, it will always stay 'info'. But what needs to change are the displayText and the error status. Therefore, the value needs to be set again when switching from 'throw' back to 'info' as the validator needs to run in order to add the info-error status. The displayText needs to be set to support the 'info'>'throw' case as setting a value 'throw' will never change the displayText it needs to be transferred explicitly from the touch popup. * The value needs to be set without exception, even if it is identical to the current value. See example for displayText. To support the 'throw' > 'info' case from the previous example correctly for Scout Classic, an input needs to be accepted and all listeners need to be informed if the search text changed to the text of the current lookupRow. Consider the previous example and the inputs "lookup 'info'" > "lookup 'throw'" > "write 'info'". While writing 'info', the 'info' lookupRow is still present and the searchText changes from 'throw' to 'info' and therefore, the listener in the adapter needs to be triggered in order to validate 'info' again on the ui server. 369873
- Loading branch information