How to use Widget_Show

How to use Widget_Show

Hi all,

I used widget_show to make a hidden button visible but it doesn't work; just before the end of an action I used it, giving it the proper id of de command button,  but the button stays hidden!

Can you attach the oml here so we can try to discover the problem?
Hi Gustavo,

Attached you'll find an oml where I have simulated the exact situation.

The "Widget_Show" and "Widget_Hide" only affect the css style "display", it either turns it to style="display: none;" (invisible but exists in the HTML of the page) or style="display: ;" (visible), on the other hand when you put the attribute "visible = false" it tells the browser not to create that button into the generated HTML and if it doesn't exist it can't be set a style via "Widget_show".

Hope it helps and doesn't increase the confusion, :)
Hermínio Mira
The Container widget has a Display property that maps to the css display property. For other widgets, you'll have to add an extended property named "style" with the value "display: none" if you want to hide it by default and still be able to use Widget_Show and Widget_Hide. We'll update the description of those two RichWidgets actions to make it more clear.

Best Regards,
Gustavo Guerra
I really have to wonder why Widget_Show and Widget_Hide are even needed in their current condition. I can just bind the Display property of a container to a boolean variable, set that value in an AJAX action, and then do AJAX refresh and it works just as well. If all widgets get the Display property, that just makes it easier.


I don't like the Display-property, because in my experience, when you set it to false, the html will not be there in the source.
This "can" be an issue sometimes.
Joost -

True! But in most cases, that is actually a benefit (reducing page size).