I have a question about JSF 1.2 + Richfaces 3.3. I have a web app which has some navigation rules and some ajax functions. In some point, I want the application make to open a new tab in the browser and show an xhtml page, after doing an action in server side. I have chosen the tag for that. That’s how it looks:
<h:commandLink target="_blank"
action="#{sm_gestiondocumental_gestorUserAuditBean.actionCreateUserAuditManager}">
<h:graphicImage value="/images/sm_gestiondocumental/checklist.png"
alt="#{wmsg.VIEW_AUDITS}" title="#{wmsg.VIEW_AUDITS}"
styleClass="pic" />
</h:commandLink>
The code that is executing is the following one:
private String createAuditManager(String className, String param, Object objectToAudit,
String auditFileName) {
AuditManagerBean amb = (AuditManagerBean) FacesUtils
.getManagedBean(BeanNames.AUDIT_MANAGER_BEAN);
if (amb == null) {
amb = new AuditManagerBean();
}
try {
amb.set_serviceLocator(this.get_serviceLocator());
} catch (Exception e) {
e.printStackTrace();
}
amb.set_AuditClassName(className);
amb.set_AuditId(param);
amb.set_AuditList(null);
amb.set_AuditFileName(auditFileName);
amb.set_ObjectToAudit(objectToAudit);
amb.set_AuditFilterInit(this._FilterInit);
amb.set_AuditFilterEnd(this._FilterEnd);
FacesUtils.setManagedBeanInSession(BeanNames.AUDIT_MANAGER_BEAN, amb);
return "showAudits";
}
public String actionCreateUserAuditManager() {
if (this._SelectedUser == null) {
FacesUtils.addErrorMessage("Error al listar usuarios");
return this.createAuditManager(CUsuarioRegistrado.NAME_FOR_AUDIT, "", null,
"Auditoría para " + this._SelectedUser);
}
return this.createAuditManager(CUsuarioRegistrado.NAME_FOR_AUDIT,
this._SelectedUser.toString(), null, "Auditoría para " + this._SelectedUser);
}
Which is returning an “showAudits” String. According to my navigation rules, this String must open this link: auditInfo.xhtml.
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<description></description>
<from-outcome>sm_gestiondocumental_ListGrupoEntrega</from-outcome>
<to-view-id>/modules/sm_gestiondocumental/ges_tiposentrega/tiposGrupoList.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<description></description>
<from-outcome>sm_gestiondocumental_ListEmpresa</from-outcome>
<to-view-id>/modules/sm_gestiondocumental/ges_empresas/empresasList.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<description></description>
<from-outcome>sm_gestiondocumental_ListTrabajo</from-outcome>
<to-view-id>/modules/sm_gestiondocumental/ges_trabajos/trabajosList.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<description></description>
<from-outcome>sm_gestiondocumental_ListSeccion</from-outcome>
<to-view-id>/modules/sm_gestiondocumental/ges_secciones/seccionesList.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<description>
</description>
<from-outcome>showAudits</from-outcome>
<to-view-id>/modules/sm_gestiondocumental/auditInfo/auditInfo.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
The rules are well applied, however, the page is opening in the main panel of my application, I mean, a new browser tab is opened but the whole application is being displayed with the auditInfo.xhtml content inside, in order to display only the auditInfo.xhtml page.
It seems to be some filtering problem, because the setContent() method of my application bean is called after org.ajax4jsf.Filter invoked. However I don’t want that method to be called. Any ideas?
Resolved. The tag was inside an a4j:outputPanel, so, even it wasn’t set to ajaxRender automatically, richfaces was using the ajax filter for that request. That filter was causing this problem. Changing the a4j:outputPanel for a h:panelGroup has solved it.