Block UI with global ajax status

UI Components for JSF
Post Reply
vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

07 Feb 2012, 07:03

Hi ,
I am using global ajax status in the page with model dialog . But now i upgraded to PF3.2 snapshot to use the block UI for some part of page. But it doesnt work as global ajax status comes up on any processing on that component . Is it possible to use block ui along with global status ?

Using PF3.2 snapshot , Mojarra 2.1.4 , WAS 6.1

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Feb 2012, 11:16

Post your code please.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Feb 2012, 11:18

BlockUI is component specific not global, you can attach blockUI to multiple triggers with a comma separated list of "for" values though.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Feb 2012, 11:28

Keep in mind please that some PrimeFaces components and p:ajax have the "global" attribute. Setting "global" to false will not trigger BlockUI. That's true at least for pe:blockUI in PF Extensions project. AFAIK p:blockUI should behave in the same manner.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

07 Feb 2012, 19:58

I will put this in better way :

I have global ajax status on the template which is used across screens . So every time any ajax event is fired on any component , the global status comes up to show the processing in progress which is a modal dialog which disables the entire screen . So basically i am interested to know if i can have the global status coming up only for certain components on page while for some components block UI is displayed while an action is performed on those components ?

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">

	<h:head>
		<f:facet name="first">
            <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>TraxExplorer</title>
            <f:event listener="#{user.getCss}" type="preRenderComponent" />
        </f:facet>
		<ui:insert name="head"></ui:insert>
	</h:head>
	
	<f:view locale="#{language.localeCode}"/>
	
	<f:loadBundle basename="#{user.messages}" var="msg"/>
	
	
	<h:body>
	<ui:insert name="status">
            <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>  
              
<p:dialog  widgetVar="statusDialog" header="PROCESSING...PLEASE WAIT"  modal = "true" 
        draggable="false" closable="false">  
    <p:graphicImage value="/design/ajaxloadingbar.gif" />  
</p:dialog>  
        </ui:insert>
		<ui:insert name="content"></ui:insert>
		<ui:insert name="footer"></ui:insert>
	</h:body>

</f:view>
</html>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:utils="http://java.sun.com/jsf/composite/utils/accounts"
	template="../templates/PageTemplate.xhtml">
In the above code the template has a global status indicator but i want the page which uses the template can show global status on some componet while block ui is displayed on some .

PF3.2 snapshot , Mojarra 2.1.4

vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

10 Feb 2012, 20:02

The requirement is to have both global status and block UI on same page . But for components which has block UI defined it should take preference else the global status should be displayed . I dont know if this is possible . So just trying to get opinion .

USing PF3.2 snapshot

kingdan
Posts: 44
Joined: 06 May 2011, 19:55
Location: Aracaju, Brazil

10 Feb 2012, 20:23

I'm having a similar issue.
Move Fast, Break Things!

vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

10 Feb 2012, 22:17

Also , One more issue is :

i have a datatable which updates various components on filter . But now the problem is when i use Block UI , every time an event is fired on datatable like sorting etc then also the block ui comes up which is not required . So this may be a good case when we can pass event name as well when the Block UI should come up .

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests