Richfaces 4.0.0 + Mojarra 2.0.3 => Ajax problems in dynamic ui:include
maze_fr Oct 20, 2011 4:23 AMHello everybody,
As I found many topics about the same problems and tried every solution I found and that nothing worked, then I decided to ask for my problems here.
Maybe I dodn't found the good topic to solve my problems and I appologize for the waste of time if it's the case.
I use Richfaces 4.0.0 Final + Mojarra 2.0.3 + JBoss 6.1.0.Final.
So, here is my case :
- I have a global body template for all my site.
- I use a richer template for some pages that have a lot in commun, which use global body template.
- I load the content with a dynamic ui:include with navigation of the menu (that is in the richer template).
Here is the summed up code architecture :
Global body : html > f:view > h:body > div > table > tr > td > ui:insert
- Richer body template from global body : ui:composition > ui:define > rich:panel > table > tr > td > div > a4j:outputPanel > ui:include
- Content page : ui:composition > f:view > rich:panel > ui:include
- Reused content : ui:composition >
- h:form > rich:dataTable > a4j:commandLink
- my popup tag : ui:composition > h:form > a4j:outputPanel > rich:popupPanel > table > tr > td > ui:decorate > a4j:commandButton
- Reused content : ui:composition >
- Content page : ui:composition > f:view > rich:panel > ui:include
I konw, it looks like a matriochka...
All my pages (templates, contents, tags, etc) have <h:head />, as I read this problem somewhere.
All my pages have :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<xxx:the_good_tag xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
Detailed mechanisms :
- In the richer body, when I click on the rich:panelMenuItem of the rich:panelMenu, the bean is updated and a4j:outputPanel is rerender to refresh the dynamic include.
- When I click on reused content edit link, it shows the popup and refresh the content. On second time click, the popup is correctly refreshed.
- When I click on popup button to save the modifications, it hides the popup (it works) and refresh the rich:dataTable, theoricaly... but I traced the action and the logs shows it doesn't fire it.
- If I try to show directly the content page and use the popop, everything works fine... but I prefer to use Ajax better than reload the entire page...
Here are the problems :
- When I click on a button, the action launches only after second click : the first click never works, but everything is OK afterwards.
I found that "javax.faces.PARTIAL_STATE_SAVING" at false in "web.xml" should solve that problem, but it doesn't. - One of my contents has an hidden edit popup (to edit the current line) that I use as a tag.
When I click (so on second time) to show the popop, the content is refreshed, so this is OK (excepted that it's on second click...).
But when I click on "save" button, the popup go hidden again as it must but nothing happens in the Java, the action is not launched.
I thank anybody who could help me about my problems.
If anything is missing to help me correctly, just ask.