How do you refer to parameters with hyphens in their names?

I created a custom parameter on a Perspective view object called “selected-panel”, filled in a default value and then for testing I bound a label to the value of the parameter et voila I can see the value on my browser window.

Next I went to create a message handler on that view object so that I can update the value of that parameter from other locations. In the onMessageReceived() handler I typed in:

self.view.custom.selected-panel = payload

Which gets a red squiggly line under all of it, and the tool tip says:

can’t assign to operator

It took me a while to figure out that the hyphen was not being interpreted as a hyphen, but probably as a minus sign, which totally changes the interpretation of that line of code.

In this case I can easily remove the hyphen from the name, but what would be the proper way to accommodate names with hyphens in them?

Or is the advice simply “Don’t do that!”

Ignition 8.1.3 on Ubuntu

self.view.custom['selected-panel'] = payload

or if that doesn’t work maybe don’t do that :wink: