BlockUI: widgetVar is reset to null after partial updates
See original GitHub issueI am using Primefaces 11, and I am adding this components in home.xhtml page:
<p:dataTable id="dataTable" var="n" value="#{homeBean.dataMedel}" lazy="true" paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {NextPageLink} {RowsPerPageDropdown}"
sortOrder="descending" rowsPerPageTemplate="10,15,20,30,50">
<p:blockUI widgetVar="bui" block="dataTable" animate="false">
<p:graphicImage value="ajax_loader.gif"/>
</p:blockUI>
<h:selectOneMenu id="filterTopic" value="#{filterBean.topic}" label="topic" title="topic"
<p:ajax event="change" update="dataTable" onstart="PF('bui').show();" oncomplete="PF('bui').hide()"
listener="#{homeBean.onPreRender}"/>
<f:selectItems value="#{topicBean.topicList}"/>
</h:selectOneMenu>
when I select one of the items in filterTopic menu, the ajax_loader.gif should fall on the dataTable until the data is fetch from homeBean. but it`s not working and i can see in the console the following error:
Widget for var ‘bui’ not available! --> core.js.xhtml?ln=primefaces&v=11.0.0:18
home.xhtml Uncaught TypeError: Cannot read properties of null (reading ‘hide’) --> home.xhtml
also when refresh page and run PrimeFaces.widgets in browser console, result is:
bui: c {_super: undefined, cfg: {…}, id: 'form:j_id_bo', jqId: '#form\\:j_id_bo', jq: S.fn.init(1), …}
but when select one of the items in filterTopic menu, bui value set to null:
bui: null
also this code worked with primefaces 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (15 by maintainers)
Top Results From Across the Web
Primefaces BlockUI not working - Stack Overflow
In my JSF form, I am using BlockUI to show the busy status while processing. ... <p:commandButton value="Reset" update="registration:panel" ...
Read more >BlockUI - PrimeFaces Showcase
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael...
Read more >JSF primefaces update dialog not passing value to bean – iTecNote
I can add roles without a problem but when I need to delete or edit its not working due to the roleController.selectedRole being...
Read more >USER GUIDE 6.1
Defines ajax submit mode, full or partial. DIR ltr. Defines orientation, ltr or rtl. RESET_VALUES false. When enabled, ajax updated inputs are reset....
Read more >primefaces - issue #2629 - Google Code
Remove script tags of widget after init ... your changes :-) Yes, the idea is good, especially for Ajax updates to prevent "dead"...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think #5866 is related and was never solved
OK i see why its happening its because the BlockUI panel
jq
object gets created inside the panel. So when the panel is removed from the DOM so it he BlockUI Mask which causes the widget to be marked for removal.