© John Kouraklis 2016

John Kouraklis, MVVM in Delphi, 10.1007/978-1-4842-2214-0_7

7. Input Validation

John Kouraklis

(1)London, UK

The POSApp at this stage illustrates how we can use the MVVM pattern to capture user interaction. In this implementation, it doesn’t perform any checks on data entered by the users. For example, users could enter a negative number or even a character in the quantity field. This will generate an error and will block the application. This chapter explains how we can deal with this situation.

Checking Inputs

This section shows how to check the user-entered data against three validation rules: users must select an item before they press the Add button, the quantity field must not be empty, and the quantity must be a non-zero ...

Get MVVM in Delphi: Architecting and Building Model View ViewModel Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.