Page 2 of 3

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 10:51
by cagatay.civici
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

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 12:34
by Oleg
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.

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 13:57
by tandraschko
I don't even need a session scoped bean. I just create FacesMessages in my ExceptionHandler add doing an redirect.

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 14:41
by Oleg
Thomas, yes, sure. But exception details get lost with redirect.

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 14:48
by tandraschko
What details? request attributes or so?
I add the stacktrace as FacesMessage and display it only if ProjectStage == dev.

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 19:52
by Oleg
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?

Re: update="@all" not updating browser DOM

Posted: 04 Mar 2012, 20:44
by BalusC
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.

Re: update="@all" not updating browser DOM

Posted: 06 Mar 2012, 11:14
by notizklotz
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.

Re: update="@all" not updating browser DOM

Posted: 06 Mar 2012, 11:52
by cagatay.civici
Welcome to PrimeFaces Community!

Re: update="@all" not updating browser DOM

Posted: 18 May 2012, 12:25
by lleontop
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>