Olá galera,
Alguém poderia me ajudar numa duvida que me persegue e que não consigo entender.
É o seguinte... Tenho a seguinte estrutura de layout e em alguns momentos quanto tento acessar os links para alterar de pagina, é preciso clicar mais de uma vez para a action seja executada e seja renderizada.
Este problema geralmente ocorre quando acesso alguma pagina através do menu e em seguida tento acessar alguma outra através dos links exibidos no conteúdo.
O que parece é que a primeira vez que clico no link a pagina apenas realiza um refresh, e a segunda vez é que realmente a ection é executada.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Plain Project</title>
</h:head>
<h:body>
<table width="100%" cellpadding="0" cellspacing="5">
<tr style="height: 100%; vertical-align: top">
<td colspan="2">
<ui:insert name="header">Main Layout Header (from mainLayout.xhtml)</ui:insert>
</td>
</tr>
<tr style="height: 100%; vertical-align: top">
<td id="menu" width="200px">
<ui:insert name="menu">
<ui:include src="/pages/commun/menu.xhtml" />
</ui:insert></td>
<td id="workArea">
<ui:insert name="workArea">Main Layout Content (from mainLayout.xhtml)</ui:insert>
</td>
</tr>
</table>
</h:body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/WEB-INF/templates/mainLayout.xhtml">
<ui:define name="workArea">
<rich:panel>
<f:facet name="header">
<ui:insert name="title">Work Area Title (from workLayout)</ui:insert>
</f:facet>
<ui:insert name="content">Work Area Content (from workLayout)</ui:insert>
</rich:panel>
</ui:define>
</ui:composition>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<ui:composition>
<h:form>
<rich:panelMenu groupExpandedLeftIcon="triangleUp"
groupCollapsedLeftIcon="triangleDown"
topGroupExpandedRightIcon="chevronUp"
topGroupCollapsedRightIcon="chevronDown" itemLeftIcon="disc"
expandSingle="false">
<rich:panelMenuGroup label="Menu" expanded="true">
<rich:panelMenuGroup label="Paginas">
<rich:panelMenuItem label="Pagina 1" action="pagina1" />
<rich:panelMenuItem label="Pagina 2" action="pagina2" />
</rich:panelMenuGroup>
</rich:panelMenuGroup>
</rich:panelMenu>
</h:form>
</ui:composition>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/WEB-INF/templates/workLayout.xhtml">
<ui:define name="title">
Pagina 1
</ui:define>
<ui:define name="content">
<h:form>
<h:commandLink action="pagina2" value="Link para pagina 2" />
</h:form>
</ui:define>
</ui:composition>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/WEB-INF/templates/workLayout.xhtml">
<ui:define name="title">
Pagina 2
</ui:define>
<ui:define name="content">
<h:form>
<h:commandLink action="pagina1" value="Link para pagina 1" />
</h:form>
</ui:define>
</ui:composition>
</html>
Obs.: O mesmo ocorre utilizando apenas JSF 2 (sem RichFaces).
Fico muito grato com a ajuda.
[]'s