ioBroker.admin icon indicating copy to clipboard operation
ioBroker.admin copied to clipboard

[JSONConfig] validatorErrorText not displayed in tables

Open mcm1957 opened this issue 1 year ago • 2 comments

Describe the bug
At least in case of an table the attribute validatorErrorText ist not displayed anywhere. If the validationfucntions fails (returns false) the underline of the tablerow files swicthed to red (ok) and teh save button is disabled (ok) if validatorNoSaveOnError is true. But there's no erromessage text displayed. anywhere.

Note: No error could be detected at console window.

JSON Comnfig (extract):

                "controllers": {
                    "type": "table",
                    "newLine": true,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "label": "",
                    "showSecondAddAt": 5,
                    "items": [
                        {
                            "type": "text",
                            "attr": "ctrlId",
                            "width": "8% ",
                            "title": "lblCtrlId",
                            "tooltip": "ttCtrlId",
                            "filter": false,
                            "sort": false,
                            "default": "",
                            "validator": "data.ctrlId.match(/^[A-Za-z0-9]([A-Za-z0-9-_])*$/)",
                            "validatorErrorText": "errValCtrlId",
                            "validatorNoSaveOnError": true
                        },
<stripped>

To Reproduce
Steps to reproduce the behavior:

  1. setup a json confgi with a table and a validated element insode the table
  2. enter some data which will cause the validation to fail
  3. EXPECTED: the configured error test is displayed
  4. ACTUAL: no error text is displayed but fiels is underlined in red

Expected behavior
The configured error text should be displayed

Versions:

  • Adapter version: admin 6.4.3 (inside dev-server)

mcm1957 avatar Apr 04 '23 09:04 mcm1957

at least https://github.com/mcm1957/ioBroker.jsonconfig-demo/blob/d81aec4c2c7e8f44927aa7220a9739e36a98a288/admin/jsonConfig.json5#L763 works fine, so seems to work in general but at least not for tables.

foxriver76 avatar Jul 12 '23 06:07 foxriver76

Thats correct. It works for normal elements. But it would fine to see an error for incorrect input at tables too - if possible with acceptable effort. As a workaround I use a static error text which is visible on condition. But thats much less elegant and (without much effort) can only check the whole table - not signal the incorrect row in detail.

mcm1957 avatar Jul 12 '23 08:07 mcm1957