-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,47 @@ | ||
# Umbraco Nullable Types | ||
Property editors which enable a null value to be selected in preference to a default value. | ||
|
||
## _Nullable String_ | ||
'But strings are always nullable !' however with a textbox alone there's no way to distinguish between whitespace and null, | ||
so this data-type adds a checkbox to toggle between the textbox value and a null. | ||
|
||
The raw values are stored as json, but will also read in raw string values (as stored by the built-in textstring data-type, so can migrate away from this, but not return if item has been saved). | ||
The property-value-converter will return a string. | ||
## _Nullable Boolean_ | ||
A tri-state data-type where the default value is null. | ||
|
||
The raw values are stored as strings: "", "0" or "1", which makes it compatable with the built-in true/false data-type. | ||
The property-value-converter will return a nullable bool. | ||
|
||
### Property Editor | ||
|
||
![Property Editor Example](docs/NullableStringPropertyEditor.png) | ||
![Property Editor Example](docs/NullableBooleanPropertyEditor.png) | ||
|
||
### Property Editor Configuration | ||
|
||
![Property Editor Configuration Example](docs/NullableStringPropertyEditorConfiguration.png) | ||
![Property Editor Configuration Example](docs/NullableBooleanPropertyEditorConfiguration.png) | ||
|
||
|
||
## _Nullable Boolean_ | ||
A tri-state data-type where the default value is null. | ||
## _Nullable Integer_ | ||
Based on the built-in numeric data-type, this adds a checkbox to toggle between the integer value and a null. | ||
The property-value-converter will return a nullable integer. | ||
|
||
The raw values are stored as strings: "", "0" or "1", which makes it compatable with the built-in true/false data-type. | ||
The property-value-converter will return a nullable bool. | ||
### Property Editor | ||
|
||
![Property Editor Example](docs/NullableIntegerPropertyEditor.png) | ||
|
||
### Property Editor Configuration | ||
|
||
![Property Editor Configuration Example](docs/NullableIntegerPropertyEditorConfiguration.png) | ||
|
||
|
||
## _Nullable String_ | ||
'But strings are always nullable !' however with a textbox alone there's no way to distinguish between whitespace and null, | ||
so this data-type adds a checkbox to toggle between the textbox value and a null. | ||
|
||
The raw values are stored as json, but will also read in raw string values (as stored by the built-in textstring data-type, so can migrate away from this, but not return if item has been saved). | ||
The property-value-converter will return a string. | ||
|
||
### Property Editor | ||
|
||
![Property Editor Example](docs/NullableBooleanPropertyEditor.png) | ||
![Property Editor Example](docs/NullableStringPropertyEditor.png) | ||
|
||
### Property Editor Configuration | ||
|
||
![Property Editor Configuration Example](docs/NullableBooleanPropertyEditorConfiguration.png) | ||
![Property Editor Configuration Example](docs/NullableStringPropertyEditorConfiguration.png) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.