update="@all" not updating browser DOM

Components, Ajax Framework, Utilities and More.
User avatar
optimus.prime
Prime
Posts: 17717
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Mar 2012, 10:51

update="@all" is supported in PrimeFaces 3.2, BalusC convinced me to add it.

http://code.google.com/p/primefaces/iss ... il?id=3643

http://balusc.blogspot.com/2012/03/full ... ndler.html

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

04 Mar 2012, 12:34

Nice to see support of @all.

BalusC wrote:
In case of successful requests, it does indeed not make any sense. You would as good just send a normal/synchronous request instead of an ajax/asynchronous request. But in case of failed requests it would have been very useful. Of course, you could send a redirect instead by ExternalContext#redirect(), that would work perfectly fine, but you would lose all request attributes, including the error details. It is really not preferable to fiddle with the session scope or maybe even the flash scope to get them to show up in the error page.
I disagree. In case of error (rare exception case), ExternalContext#redirect() doesn't hurt at all. And storing of error details in a session scoped bean is ok for me because this is only one small session scoped bean which transfers error details into request scope bean and clear its values at the end. Request scoped bean is bound in the error page via preRenderView listener. I can provide an example what I do in case of errors configured via web.xml.

But of course, FullAjaxExceptionHandler is a nice thing anyway.
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

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

04 Mar 2012, 13:57

I don't even need a session scoped bean. I just create FacesMessages in my ExceptionHandler add doing an redirect.
Always Bet On Prime (+ Extensions)!

Thomas Andraschko
PrimeFaces Developer | PrimeFaces Extensions Founder
Apache OpenWebBeans PMC | Apache DeltaSpike PMC | Apache MyFaces PMC

Personal Blog: http://tandraschko.blogspot.de/

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

04 Mar 2012, 14:41

Thomas, yes, sure. But exception details get lost with redirect.
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

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

04 Mar 2012, 14:48

What details? request attributes or so?
I add the stacktrace as FacesMessage and display it only if ProjectStage == dev.
Always Bet On Prime (+ Extensions)!

Thomas Andraschko
PrimeFaces Developer | PrimeFaces Extensions Founder
Apache OpenWebBeans PMC | Apache DeltaSpike PMC | Apache MyFaces PMC

Personal Blog: http://tandraschko.blogspot.de/

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

04 Mar 2012, 19:52

Does FacesMessage survive redirect? In the standard JSF not. There are solutions like this one http://ocpsoft.org/java/persist-and-pas ... redirects/ Do you use something like?
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

BalusC
Posts: 36
Joined: 23 Jul 2010, 20:21

04 Mar 2012, 20:44

optimus.prime wrote:update="@all" is supported in PrimeFaces 3.2, BalusC convinced me to add it.

http://code.google.com/p/primefaces/iss ... il?id=3643
Great job!
Oleg wrote:Nice to see support of @all.
I disagree. In case of error (rare exception case), ExternalContext#redirect() doesn't hurt at all. And storing of error details in a session scoped bean is ok for me because this is only one small session scoped bean which transfers error details into request scope bean and clear its values at the end. Request scoped bean is bound in the error page via preRenderView listener. I can provide an example what I do in case of errors configured via web.xml.
It may not hurt, but I consider it be a "workaround" instead of a "solution". Why would you do it the hard way if it can be done simple? :)
Oleg wrote:Does FacesMessage survive redirect? In the standard JSF not. There are solutions like this one http://ocpsoft.org/java/persist-and-pas ... redirects/ Do you use something like?
They do indeed by default not survive redirects. Therefor the Flash scope should be used. There's a Flash#setKeepMessages() method which does that. However this has in turn bugs/oddities in Mojarra. With the current latest release 2.1.7, if the redirect changes the path, then the faces message won't be displayed until you go back to some page in the same path as from where the redirect is been sent.

notizklotz
Posts: 9
Joined: 20 Jan 2012, 12:44

06 Mar 2012, 11:14

Wow, thanks for integrating this feature and thanks to all for discussing it!

Coming from a commercial JSF library I find it very refreshing that features are added because of rational arguments instead of marketing/money/boss escalation. I have to re-learn being part of a community.

User avatar
optimus.prime
Prime
Posts: 17717
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Mar 2012, 11:52

Welcome to PrimeFaces Community!

lleontop
Posts: 14
Joined: 18 May 2012, 11:37

18 May 2012, 12:25

Hi!

Congratulations to everyone for these great components!

I have a problem though with this Exception Handler proposed by BalusC and Primefaces.
I have the latest Primefaces 3.2 build with mojarra 2.1.7 running on Tomcat 7.
The problem is this:
I have a template page with a menubar and a SelectOneMenu (error.xhtml uses that template).
I have defined the Exception Handler Factory and everything works fine in chrome and firefox
but in ie8 after the error page is rendered PrimeFaces controls don't work. In the error console i can see that 'Primefaces' is undefined.
Then as i am viewing error.xhtml if i hit F5 the error.xhtml is displayed again and this time everyhting works perfectly!
I had a similar problem with another page that was using forward to display another page and i remembered i solved it by redirecting instead (again only in ie8).
So is the render="@all" attribute that was inserted in 3.2 not working well with ie8? Is it something else?
Any help would be appreciated!!

Thanks!

edit: i also forgot to mention that i already have the resource servlet in web.xml like this

Code: Select all

   <servlet>
		<servlet-name>Resource Servlet</servlet-name>
		<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>Resource Servlet</servlet-name>
		<url-pattern>/primefaces_resource/*</url-pattern>
	</servlet-mapping>
  <context-param>
		<param-name>com.sun.faces.allowTextChildren</param-name>
		<param-value>true</param-value>
	</context-param>
Primefaces 3.4
Mojarra 2.1.11
Shiro 1.2
Omnifaces 1.1
PF Extensions 0.5

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 26 guests