3.7 How to specify form
Print
Modified on: Tue, 18 Jun, 2024 at 3:26 AM
TABLE OF CONTENTS
1. External Select
Picture 52
type - ext-select
url - ULR for the REST GET request, where result should be JSON array
labelField - selector for the name
valueField - selector for the value
placeholder - localized placeholder name via map structure
Form playground example: |
{ "schema":{ "type":"object", "properties":{ "extSelect":{ "type":"string" } } }, "form":[ { "key":"extSelect", "title":"", "type": "ext-select", "url": "/entity/api/xm-entities?typeKey=LOT.CAR&page=0&size=100&sort=id,asc", "labelField": "name", "valueField": "key", "placeholder": { "en": "Select car" } } ] } |
Result data example: |
{ "extSelect": "a255cc76-e0b8-a8ec-c9b8-f8ecb9687bd9" } |
2. External Textarea
Picture 53
type - ext-texarea
height - sets the height of the textarea. The height does not include padding, borders, or margins; it sets the height of the area inside the padding, border, and margin of the textarea.
Form playground example: |
{ "schema":{ "type":"object", "properties":{ "extTextarea":{ "type":"string" } } }, "form":[ { "key":"extTextarea", "title":"", "type":"ext-textarea", "height": "150px" } ] } |
Result data example: |
{ "extTextarea": "Why do we use it?\nIt is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English." } |
3. Current location
Picture 54
Form playground example: |
{ "schema": { "type": "object", "properties": { "currentLocation": { "type": "string" } } }, "form":[ { "key": "currentLocation", "title": "", "type": "current-location", "isShowCoordinates": true, "isShowMap": true } ] } |
Result data example: |
{ "currentLocation": "50.3728383,30.4265232" } |
Picture 55
Form playground example: |
{ "schema":{ "type":"object", "properties":{ "name":{ "type":"array", "items":{ "type":"object", "properties":{ "languageKey":{ "type":"string" }, "name":{ "type":"string" } } } } } }, "form":[ { "key":"name", "title":"", "type":"multilingual-input" } ], "data":{ "name":[ { "languageKey":"en", "name":"English" } ] } } |
Result data example: |
{ "name": [ { "languageKey": "en", "name": "English" } ] } |
Did you find it helpful?
Yes
No
Send feedback Sorry we couldn't be helpful. Help us improve this article with your feedback.