Widget not available

UI Components for JSF
Post Reply
mrluglio
Posts: 3
Joined: 18 Jul 2018, 17:49

18 Jul 2018, 18:09

Hi,
if you run this code:

Code: Select all

<p:commandButton value="test" process="@this" update="@this prova">
	<f:setPropertyActionListener value="#{not sessionScope.visibile}" target="#{sessionScope.visibile}" />
</p:commandButton>
<p:outputPanel id="prova">
	<p:inputText rendered="#{sessionScope.visibile}">
		<p:keyFilter mask="email" />
	</p:inputText>
</p:outputPanel>
all works fine.

Now, do this:

Code: Select all

<p:commandButton value="test" process="@this" update="@this prova">
	<f:setPropertyActionListener value="#{not sessionScope.visibile}" target="#{sessionScope.visibile}" />
</p:commandButton>
<p:outputPanel id="prova">
	<c:if test="#{sessionScope.visibile}">
		<p:inputText>
			<p:keyFilter mask="email" />
		</p:inputText>
	</c:if>
</p:outputPanel>
In the browser console (Chrome) you get:

core.js.xhtml?ln=primefaces&v=6.2:1 Widget not available: KeyFilter

This is because in core.js, the function named PrimeFaces.getScript sends an asynchronous request to get the keyFilter script. By changing it to make a synchronous request, it solves the problem.
In PF 6.1 the request was synchronous; in PF 6.2 it has been changed to asynchronous, generating the problem.
If I change the code to make the request synchronous again, could it cause other kinds of problems?

Thanks so much.

Max

StevenHachel
Posts: 9
Joined: 09 Dec 2015, 15:57
Location: Berlin

20 May 2019, 13:00

Hi,
As a non-paying customer you do not get much help here in the forum.
Have since the transition from Primefaces 6.1 to 6.2. the same mistake.

best regards
Steven

mrluglio
Posts: 3
Joined: 18 Jul 2018, 17:49

20 May 2019, 15:00

StevenHachel wrote:
20 May 2019, 13:00
Hi,
As a non-paying customer you do not get much help here in the forum.
Have since the transition from Primefaces 6.1 to 6.2. the same mistake.

best regards
Steven
:(

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

20 May 2019, 16:10

Can you please try it in 7.0?
If it doesn't work either, please provide a small as possible runnable xhtml+bean, so i can give it a try.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 44 guests