Page 1 of 1

Widget for var 'XXX' not available!

Posted: 15 Feb 2019, 23:15
by frioux
Any workaround for this so it don't break everything?

https://github.com/primefaces/primefaces/issues/3425

Primefaces 6.2

Re: Widget for var 'XXX' not available!

Posted: 16 Feb 2019, 13:57
by kukeltje
What is wrong with all the alternatives ('workarounds') mentioned in the link posted by Thomas Andraschko in the issue? Several are posted there.

Re: Widget for var 'XXX' not available!

Posted: 18 Feb 2019, 16:08
by frioux
Okay, I tried this one:

#mask {
position: fixed;
left:0; right:0; top:0; bottom:0;
}
with z-indez too, but it remove the windows scrollbar?

Answer by Oswaldo Acauan have compatibility issues with IE.

Answer by Zathrus Writer do not work on all click.

I will check the answer of jbkkd and Akshay Khandelwal.

But how I go to reactivate all the click and where I hook that? I was hoping someone faced this issue and had the best answer, this seem major.

Re: Widget for var 'XXX' not available!

Posted: 18 Feb 2019, 16:41
by frioux
See my other post "Problem in Chrome". This seem to be the main problem.

Re: Widget for var 'XXX' not available!

Posted: 18 Feb 2019, 20:15
by frioux
Wrapping all call to widget var with "if ( jQuery.isReady )" seem a decent workaround.

Re: Widget for var 'XXX' not available!

Posted: 19 Feb 2019, 14:39
by Melloware
There seems to be better global solutions than wrapping eveyr component with is Jquery.Ready. https://stackoverflow.com/questions/193 ... fore-ready

Re: Widget for var 'XXX' not available!

Posted: 19 Feb 2019, 15:08
by Melloware
A trick that might be more global is to do the following. use CSS to hide the page and then display it once the document is ready and thus your buttons will be ready.

CSS:

Code: Select all

html {
	/** https://stackoverflow.com/questions/9550760/hide-page-until-everything-is-loaded-advanced/9551066 */
	visibility: hidden;
}
Then add this script in your layout template so it happens on every page.

Code: Select all

<script>
$(document).ready(function() {
            document.getElementsByTagName("html")[0].style.visibility = "visible";
});
</script>
This works for me.

Re: Widget for var 'XXX' not available!

Posted: 20 Feb 2019, 19:34
by frioux
Thanks you, this is a really nice solution. I plugged it on my content container only since my header work fine. I even seem to see an improvement in rendering time. I have solutions, I will see what I will do, probably this. I can produce edge case that will probably not happen in prod where a page can take 5 sec to render in Chrome and it's a bit weird to see nothing for that long, strange that firefox display it nearly instantaneously but Chrome struggle that much.

Re: Widget for var 'XXX' not available!

Posted: 20 Feb 2019, 19:45
by Melloware
No problem. I really like this trick because it actually speeds up the display time rather than the browser rendering and snapping the UI it just paints the screen once the display is actually ready.

As for why something takes 5 seconds in Chrome and 1 in Firefox it could be a certain piece of JavaScript. I have seen in the past where one browser for one particular function is way slower than the others. Typically that is IE though. :D

Re: Widget for var 'XXX' not available!

Posted: 11 Mar 2019, 11:53
by Robert09
You can't proceed like this because the click is first catched by the link before it is forwarded to the enclosing elements.