AjaxStatus multiple regions

UI Components for JSF
Post Reply
polandy
Posts: 1
Joined: 30 Jan 2011, 17:03

30 Jan 2011, 17:07

Hi all
I want to define multiple ajax regions, is this with primefaces possible?
For example there is an ajax status for the login, and another status for a search mask.
I'm coming from richfaces and there it is possible.
Thank you for your help
regards polandy

marcbaechinger
Posts: 25
Joined: 28 Jan 2011, 15:18

31 Jan 2011, 12:04

I don't know richfaces and i'm not sure what ajax regions are, but i know how to update multiple regions on a page with a single request with primefaces. If this is what you are looking for, fine.:

<div>
<h:panelGroup id="region-1">blablabla</h:panelGroup>
<h:panelGroup id="region-2">another blablabla</h:panelGroup>
<h:panelGroup id="region-3">the last blablabla</h:panelGroup>
</div>


<p:commandButton update="region-1 region-2 region-3" action="#{managedBean.fooAction}"/>

Note that the update attribute in the commandButton list the ids of those regions which are going to be updated

cheers
marc

robert.m
Posts: 226
Joined: 07 Dec 2010, 22:52
Location: Salzburg/Austria

31 Jan 2011, 13:42

I think what he's looking for is to define a specific region within a page and attach a <p:ajaxStatus> to it. By default, the ajaxStatus-Component is used each time an AJAX-Request is fired anywhere within the page.

This is basically something I'm looking for aswell, because the ajaxStatus-Components in my page are located within the header of <p:panel>-Components and I only want them to get displayed when the data within the specific panel is loaded.

marcbaechinger
Posts: 25
Joined: 28 Jan 2011, 15:18

31 Jan 2011, 15:31

thanks robertm for clarification but i can't help you how to do this with primefaces p:ajaxStatus .

I did something similar by leveraging the JavaScript resource of JSF 2.0. It allows to register a global callback which is called by the framework for every ajax call made. As primefaces integrates with JSF 2.0 very closely this should work fine (and also for jsf2 calls not made with primefaces):

http://my.safaribooksonline.com/book/pr ... FzZWMxMQ==

cheers
marc

robert.m
Posts: 226
Joined: 07 Dec 2010, 22:52
Location: Salzburg/Austria

31 Jan 2011, 16:52

Thanks, I'll look into that!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 53 guests