skip autoUpdate="true" with somethig like limitRender

UI Components for JSF
eunnini
Posts: 67
Joined: 28 Jun 2011, 00:07

14 Jul 2011, 10:50

Hello,

I have a problem with p:messages with autoUpdate="true". Richfaces has a possibility to restrict autoUpdate attribute with limitRender="true". Does primefaces has some possibility

Problem:
open dialog, click on submit button and call oncomplete="dlg.hide()". But, if I have some listener inside dialog, like close dialog that calls some generic method, then p:messages component with autoUpdate="true" is called twice and message disappear (e.q. Delete successful) - The message for deletion is showing correctly, but immediately disappear because of second autoUpdate called by close dialog listener

Regards
Last edited by eunnini on 14 Jul 2011, 12:50, edited 1 time in total.
Jsf 2.2.x, Primefaces 5.1, tomcat 7

Alex
Posts: 256
Joined: 16 Dec 2010, 14:24
Location: Germany

14 Jul 2011, 11:55

we had exactly the same problem and found no solution via primefaces..

we "solved" it by creating our own listener which adds our messages to the update entities, but only when there are new messages in facescontext.
this way our messages are still alive, when closelistener is fired.
only known "bug".. when the closelistener adds a message too, the message from the actionlistener gets lost.. but we dont have this case in our application right now.
PrimeFaces 3.2
Mojarra 2.0.2
Glassfish 3.0.1

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

14 Jul 2011, 12:03

Hi,

There isn't concept of "limitRender" in PrimeFaces. I have implemented this behavior by putting a special flag in request scope. E.g. I have p:messages and p:growl and want to show sometimes only p:growl

Code: Select all

<p:growl id="growlNotification" showDetail="true" showSummary="true" rendered="#{not empty requestScope['growlOnly'] and requestScope['growlOnly'] == true}"/>
P.S. RequestContext can't help here.
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

eunnini
Posts: 67
Joined: 28 Jun 2011, 00:07

14 Jul 2011, 12:49

Thanks guys!

Alex, could you give me some code snapshot about listener that you implemented. We also do not have situation from "knowing bug" that you mention
Jsf 2.2.x, Primefaces 5.1, tomcat 7

roshan.mutha
Posts: 1
Joined: 30 Jul 2012, 09:07
Location: India (Pune)
Contact:

30 Jul 2012, 09:17

Please let me know how to use P:poll which should update only specified components and skip other autoupdate components.

I tried different workaround but did not got sucess.

In Richfaces we have limitrender.But we do not have this knid of functionality in primefaces.

If someone know any other workaround please post the message .

Thanks,
Roshan

matias-uy
Posts: 31
Joined: 27 May 2013, 00:12

10 Jul 2013, 08:32

open dialog, click on submit button and call oncomplete="dlg.hide()". But, if I have some listener inside dialog, like close dialog that calls some generic method, then p:messages component with autoUpdate="true" is called twice and message disappear (e.q. Delete successful) - The message for deletion is showing correctly, but immediately disappear because of second autoUpdate called by close dialog listener
Same problem here!
Is there any solution?

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

10 Jul 2013, 09:23

You can use rendered attribute to avoid auto updating. In my case it is poll component which is clearing messages. If poll is triggered, its client ID appears as javax.faces.source request parameter which can be used in expression language.

Code: Select all

<h:form id="myForm">

    <p:messages autoUpdate="true"
        rendered="#{param['javax.faces.source'] != 'myForm:myPoll'}" />

    <h:panelGrid id="myPanel">
        ...
        ...
        ...
    </h:panelGrid>

    <p:poll id="myPoll" autoStart="true" global="false" interval="15"
        update=":myForm:myPanel" listener="#{myBean.myListener}" />

</h:form>
Alternative solution is binding poll.

Code: Select all

<p:messages ... rendered="#{param['javax.faces.source'] != poll.clientId}" />
...
<p:poll binding="#{poll}" ... />
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

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

10 Jul 2013, 10:32

We're discussing this with Thomas, will give an update soon.

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

10 Jul 2013, 10:50

Thomas will add ignoreAutoUpdate option to ajax api of ours to ... well ignore auto updates :)

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

10 Jul 2013, 11:18

optimus.prime wrote:Thomas will add ignoreAutoUpdate option to ajax api of ours to ... well ignore auto updates :)
For all ajax based PF components :)
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests