GraphObject.visible binding

i’m trying to hide an Adornment (context menu) by binding to a value that is a string value.
i was able to get the desired behavior by using:
$(go.Adornment, “Auto”,
new go.Binding(“visible”, “showDetails”, Boolean),…

knowing that using this methodology any value other than null or empty will be treated as true.

i have two questions w/ this:
1 - is there a better way to handle the true/false w/ string values and the binding?
2 - inside my context menu i have shapes, panels, etc…
$(go.Adornment, “Auto”,
new go.Binding(“visible”, “showDetails”, Boolean),
$(go.Shape, “RoundedRectangle”, { fill: “#F2ED84” }),//end shape
$(go.Panel, “Table”,
{ maxSize: new go.Size(175, 999),
margin: new go.Margin(3, 3, 0, 3),
defaultAlignment: go.Spot.Center },…
when i try and use the context menu, i get the following error in the JS console

Binding error: undefined target property: fill on Panel(Panel.Auto)#1140 go-debug.js (line 28)"

what can i do to not have this error?

  1. Well not quite “any value other than null or empty”, and I’m not sure what you mean by “empty”. In JavaScript “falsy” values include null, the number zero, the empty string, and the undefined value. But using Boolean should work.

  2. That Binding error is just saying that the Panel class does not define a “fill” property. Either the Binding is on the wrong object (it should be on a Shape, not a Panel) or it is binding the wrong target property name (maybe it should be “background” instead of “fill”).