-
1. Re: 100% Ajax Application
vgarmash Sep 30, 2009 3:03 PM (in response to igor_ti)If I understand correctly what you just described then I think you need your own custom page state tracker exactly because "all navigation occurs through DOM manipulation (Thanks to A4J)".
If you are still using navigation rules some how (in other words you have several xhtml pages in your app) then you defenitely can identify target view. I think you can do it if you extend current ViewHandler you are using (I assume it is org.ajax4jsf.application.AjaxViewHandler) and override some methods in there. I would recommend to study source of org.ajax4jsf.application.AjaxViewHandler since it is key element in A4J page rendering.
But if you have only 1 physical page and all page refreshes happened by calling actionListeners then you'll defenitely need some kind of tracking bean (session scope) with java.util.Stack inside that will keep "bread crumbs" for you. So you will need to manually add/remove items to your stack while you are doing some actions in the app. -
2. Re: 100% Ajax Application
alexsmirnov Sep 30, 2009 8:02 PM (in response to igor_ti)You can bind 'src' attribute of the <a4j:include > component to the bean property, so you can always get current page from that property.
What is a problem do you have with RichFaces filter ? Seam Filter integrates RichFaces filter since 2.0 release, and they should work together without conflicts. -
3. Re: 100% Ajax Application
igor_ti Oct 1, 2009 12:12 PM (in response to igor_ti)"alexsmirnov" wrote:
You can bind 'src' attribute of the <a4j:include > component to the bean property, so you can always get current page from that property.
Really thank you for this tip, it's so obvious that I haven't though about that option. So I don't need to do any other filtering to intercept page navigation."alexsmirnov" wrote:
What is a problem do you have with RichFaces filter ? Seam Filter integrates RichFaces filter since 2.0 release, and they should work together without conflicts.
I will explain:
The features like the property login-required for the tag PAGE, the tags , and others are not interpreted when I navigate through pages using ajax.
Use case:
I have the index page that include (a4j:include) a PersonList.xhtml, then I click in one person on that list to navigate to PersonDetail.xhtml, I have defined an action to be executed when the PersonDetail.xhtml is requested, but this action is never executed, it is executed only if I do a direct request for that page or a redirect.
I tested this again, before post this affirmation.
Since every request have the viewRoot pointing to index.xhtml, Seam filter interpret this action only for index.xhtml and not for PersonDetail.xhtml, the funny thing is that the index action is executed for all pages requests :-)
If you prefer I can send you a piece of code to demonstrate that, but it's simple to reproduce.
As I mentioned, I have a colleague looking for this problem, so I don't have details, he says that it looks like to be happening because the A4J filter bypass the Seam filter in one of the JSF phases. But I will have more detail when I talk with him (I'm on vacations now :-)
There are other limitations too, like the exception treatment tag for pages.xml, it accept only redirect's, so I can't render a error page using the A4J. So my choice was to do the redirect back to the index and change the page included there to the "error.xhtml".
Example.:<exception class="javax.el.ELException"> <end-conversation/> <redirect view-id="/index.xhtml"> <message for="exceptionHadler" severity="error">Error</message> </redirect> </exception>
I should have the option to place a render tag there:<exception class="javax.el.ELException"> <end-conversation/> <render view-id="/error.xhtml"> <message for="exceptionHadler" severity="error">Error</message> </redirect> </exception>
I want to discuss this matter with more details, we can do this in this thread, but in 15 hours I will be traveling, and I will be back on 07/Oct.
Thank you for you reply!