InputParameter with a list of options
Hi all!
Is there any way to show a list of options as an InputParameter?
I would like to present the user a list of strings as options. Something like a dropdown.
The closer attribute I have found is this one:
public InputParameterAttribute(string comment, int orderNumber, object[] variants)
But I have not figured out how to use it. I tried this
[InputParameter("Test", 1, new object[] { "option1", "option2", "option3" })] public string test = "option2"
but no luck...
It's weird because this
[InputParameter("Test", 1, new object[] { "option1", "option2"})] public string test = "option2"
shows a dropdown called test but with only option1 item.
Thanks!
Hi dreyes,
Thanks for using NETScript. Yes, it's possible. Please look at the code at the top of this indicator:
If you have any questions, please ask.
Thanks @Williams!
Yes, it has been really helpful.
For reference. It is an array of key - value pairs. It is not a dictionary or something similar because only basic attribute parameters types are allowed in attributes. In my case both keys and values are strings.
[InputParameter("Test", 1, new object[] { "option1", "option1", "option2", "option2"})] public string test = "option2"