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

[enhancement]: JsonConfig: Value of textSendTo should be accessible via data

Open Bannsaenger opened this issue 6 months ago • 0 comments

No existing issues.

  • [X] There is no existing issue for my request.

Related problems

I need a value in the configuration dialog which is sent from the instance to controll the behaviour of some attribues (e.g. hidden, disabled etc.) In my case i get devices from my intance with a selectSendTo because they are loaded out of a json file in the lib directory and should not be hard coded in the admin jsonConfig for better later extension. I started to use a textSendTo to get the value from the instance. This textSendTo shows me the expected value which is sent back from the instance. Unfortunately this value is not accessible from other elements: Example:

"hasFeature": {
    "type": "textSendTo",
    "label": "lblHasFeature",
    "newLine": true,
    "command": "hasFeature",
    "alsoDependsOn": ["someAttrib"],
    "jsonData": "{\"selectedDevice\": \"${data.someAttrib}\"}"
},
"_tester": {
    "type": "staticText",
    "hidden": "data.hasFeature === 'yes'",
    "text": "Yes the feature is available"
}

The "hasFeature" shows the right values but the hidden JS is not working.

Description

The simplest way would be to make the value of this textSendTo accessible to JS functions via data.yxz or another way. Then you can have a element driven by the instance to control the behaviour of some elements in the config dialog. The value sould also be accessible even when the textSendTo is hidden.

Additional context

No response

Bannsaenger avatar Jul 31 '24 21:07 Bannsaenger