Hi folks,
To be able to finish another discussion I need to show a list of webcams in a dropdown on my dashboard.
The list of webcams is available as label-value pairs, so I pass pairs these to the UI dropdown node:
msg.options= [ {
label: "USB2.0 HD UVC Webcam",
id: "csO9c0YpAf274OuCPUA53CNE0YHlIr2yXCi+SqfBZZ8=" },
...
]
And I want to make sure that the first webcam is automatically selected in the dropdown, so I also need to pass the id as selected value:
msg.payload = "csO9c0YpAf274OuCPUA53CNE0YHlIr2yXCi+SqfBZZ8="
Which all works very well:
However the status of the dropdown node shows the id, which is not really human readable:
It would be nice if the label (instead of the id) could be displayed in the node status. But that means that the msg.payload
would also have to allow a label-value pair (beside the current option to only pass a value)!
- When only a value is passed, that value is displayed as node status (to avoid breaking existing flows).
- When label-value pair is passed, the label is displayed as node status.
Remark: have been looking at the code, but it is not really clear to me how to implement this. I assume the client (only in case it gets as input a label-value pair) also needs to send a label-value pair back to the server (as soon as another option is selected in the dropdown), so the beforeSend can show the label.
Any thoughts?
Bart