How to enable the dropdown menu in props section during react component build by ignition perspective SDK module?


Hello ignition experts,
I am developing modules using the ignition perspective component SDK. I need help, Please look at the image I have attached in this post. I want to enable the dropdown menu in the props section of a component that I am building now, How can I enable this option in Java files of SDK.

@PGriffith Could you help me in this case??

in your JSON you can add that in your prop like this

     "enum": {
            "type": "string",
            "enum": [
                "hand",
                "off",
                "auto"
            ],
            "description": "A pointless property to demonstrate the enum schema validator.",
            "default": "off"
        },

see the reference

2 Likes

Thank you Vaiya, JajhakAllah Khair.

Yep, enum is the type to use if you have a strict list of allowable strings. You can also use suggestions if you have a list of possible options that is not necessarily complete (e.g. a format string):

                                        "condition": {
                                            "type": "string",
                                            "suggestions": {
                                                "(empty)": "",
                                                "contains": "contains",
                                                "ends with": "ends with",
                                                "equals": "equals",
                                                "starts with": "starts with"
                                            },
                                            "default": ""
                                        },
1 Like

Thank you PGrifith for helping. Yesterday I studied the radimage.props.json file and learned more new things. and I have successfully implemented this in props section as well.

2 Likes