I need some help with editor validation- specifically a dynamically populated select.
The select is populated by calling an endpoint in the backend (defined using RED.httpadmin...) in oneditprepare.
There is a default value returned which is a message to prompt the user to select an option.
- for a freshly dropped node, there is no existing selected value. When the editor UI comes up (on double clicking the added node), the oneditprepare function selects the first element which is the message prompt to the user. In this case the validation for the select property should flag an error- the select should have the error class (the red border) and the node should have a red error marker. When the user selects a value, it should pass validation and the error class and error marker should be removed. The backend could return a set of values which does not include the current user selected bird- in this case the UI should default the selection to the user prompt and show the error class/marker. My problem: the call to validate should happen after the call to oneditprepare but it seems to ahppen the other way around (i saw this from the console logs). Is there something I am doing wrong? Is there some way to force validate to be called again after oneditprepare?
My test project is at https://github.com/umasudhan/node-red-editor-test if anyone wants to try this out.
Thanks for your time