How to define properties fieldType with JSON type in now-ui.json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 10:01 PM
I create custom component for UI builder. This component is similar to Data Set component. Properties in now-ui.json is defined below:
"properties": [
{
"name": "list",
"label": "data",
"description": "Array list",
"readOnly": false,
"defaultValue": "[{rfcId:\"RFC-001\",subject:\"subject\",url:\"google.com\",createTime:\"2022-04-21\"}]",
"typeMetadata": {}
}
]
I just want to pass a json object to this component from UI builder like Data Set component but this config is not work.
My comonent can not recognize it is json but just string so can not binding it with a list of div I defined in ui code.
Maybe I miss filedType or something else.
Any suggest? Thanks.
- Labels:
-
UI Framework Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 10:52 PM
Hi,
Are you building JSON dynamically?
"properties": [
{
"name": "list",
"label": "data",
"description": "Array list",
"readOnly": false,
"defaultValue": [{rfcId:\"RFC-001\",subject:\"subject\",url:\"google.com\",createTime:\"2022-04-21\"}],
"typeMetadata": {}
}
]
In default value you are passing "defaultValue": "[{}]" instead pass "defaultValue": [{}].
and correct default value format is:
[{"rfcId":"RFC-001","subject":"subject","url":"google.com","createTime":"2022-04-21"}]
Please mark helpful and correct if applicable.
Thanks,
Teju D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 02:47 AM
maybe 4 years later, it's too late, but for people searching for it:
Set fieldType to "json":
{
"name": "configAria",
"label": "ARIA properties",
"fieldType": "json",
"readOnly": false,
"defaultValue": "{}",
"description": "Configures ARIA properties",
"selectable": false,
"valueType": "string",
"mandatory": false
}
thomas