LogicMachine Forum
Switch widget with 0 value - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visu (https://forum.logicmachine.net/forumdisplay.php?fid=24)
+--- Thread: Switch widget with 0 value (/showthread.php?tid=6315)



Switch widget with 0 value - Frank68 - 18.02.2026

Hello

I was migrating a project to the new view, and I have a small problem. I need to set an object representation that is tied to a bit. If the bit is at 0, I shouldn't see anything; if the bit is at 1, I should see a colored rectangle. The problem is that when I use the switch widget with the value at 0, it turns blue as if it were active. It's a read-only object.

What am I doing wrong?

Thanks


RE: Switch widget with 0 value - admin - 18.02.2026

1. Set Additional CSS classes to hide-when-false
2. Add to Custom CSS:
Code:
.user-view .hide-when-false[data-value=false] {
  display: none;
}

This will completely hide the widget in user view when the value is false.


RE: Switch widget with 0 value - Frank68 - 18.02.2026

(Yesterday, 12:15)admin Wrote: 1. Set Additional CSS classes to hide-when-false
2. Add to Custom CSS:
Code:
.user-view .hide-when-false[data-value=false] {
  display: none;
}

This will completely hide the widget in user view when the value is false.

ok I add this code in custom CSS, for use this code need to wirte in appearance in additional CSS   hide-when-false  ?

Thanks


RE: Switch widget with 0 value - Daniel - 18.02.2026

Yes the additinal classes are added in widget apperance on the bottom.