Built-in components and validation
In our app, we implement EditorDialog
as a key value editor. When we create or edit an item or a field, we use it to edit a pair of key-value data. EditorDialog
is built using the Bootstrap framework.
One key feature missing in EditorDialog
is that it doesn’t support data validation. Data validation includes two layers – the UI layer and logic. We can implement simple data validation logic in C#, but the UI of data validation is much more complicated. We haven’t done it in the UI layer yet. In both the Items
and ItemDetail
pages, we implemented simple data validation logic. We can review the data validation logic in the UpdateItemAsync()
method of the Items
page:
private async Task<bool> UpdateItemAsync(string key, string value) { if (listGroupItem == null) return false; if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value)) return false...