Thank you Nicolas. That solution works fine. I have used that trick before but with Richfaces instead of Primefaces.
Actually I have figured out why I had this problem using the popup attribute of Webflow. I'm using Richfaces and the RichFacesAjaxHandler was detecting all the Ajax requests as A4J requests, including the requests made by the sf:commandLink, and it was ignoring the popup attribute. So what I did is add a "bypassRichfaces" parameter to the sf:commandLink.
HTML Code:
<sf:commandLink id="link" action="verDetalle">
<h:outputText value="#{transaccionElement.idTransaccion}"/>
<f:param name="transaccionSeleccionada" value="#{transaccionElement.idTransaccion}"/>
<f:param name="bypassRichfaces" value="true"/>
</sf:commandLink>
Then I overwrote the RichfacesAjaxHandler to check this parameter. If it exists then I delegate in the SpringJavascriptAjaxHAndler.
Code:
public class CustomAjaxHandler extends RichFacesAjaxHandler {
public CustomAjaxHandler() {
// TODO Auto-generated constructor stub
}
public CustomAjaxHandler(AbstractAjaxHandler delegate) {
super(delegate);
// TODO Auto-generated constructor stub
}
@Override
protected boolean isAjaxRequestInternal(HttpServletRequest request,
HttpServletResponse response) {
String bypassRichfaces = request.getParameter("bypassRichfaces");
if (bypassRichfaces != null && bypassRichfaces.equals("true")) {
return false;
}
return super.isAjaxRequestInternal(request, response);
}
}
Ans this is the flowController configuration:
Code:
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor" />
<property name="ajaxHandler">
<bean class="es.indra.isl.tibco.monitoring.util.CustomAjaxHandler">
<constructor-arg index="0">
<bean class="org.springframework.js.ajax.SpringJavascriptAjaxHandler"/>
</constructor-arg>
</bean>
</property>
</bean>
Hope it helps somebody.