What does the property 'Visible' in Web Widgets really do?

What does the property 'Visible' in Web Widgets really do?

  
There is a common misunderstanding that, if you set a Web Widget's 'Visible' property to FALSE, the widget will be hidden but still exist in the page source code. This is, however, not the case.

If the widget's 'Visible' property evaluates to FALSE, the widget will not exist in the rendered page at all. This means that the browser will not know of its existence and, as such, no client-side operations (like JavaScript) can be performed on that widget.

If you do require the widget's HTML to be present in the page and available to JavaScript, but simply want it hidden from sight, you should leave the 'Visible' property set to TRUE and instead add (in the widget's Extended Properties dialog) the property style with Value "display:none".
The behaviour described in Miguel's post for the Visible property is extremely usefull when we want to make a button appear only to a defined profile.

Instead of using an IF widget on the screen, all we have to do is place a "CheckProfilePermission" action in the preparation of the page and then set the Visible property of the button to "CheckProfilePermission.hasPermission".

This will make the button appear only to the defined profile and avoid the proliferartion of IF widgets on the screen. You can use this feature with almost all the simple widgets in OutSystems from version 2.2.