簡體   English   中英

JSF 1將一個新頁面嵌套到我的主要xhtml中

[英]JSF 1 nests a new page into my main xhtml

我對JSF 1.2 + Richfaces 3.3有疑問。 我有一個Web應用程序,其中包含一些導航規則和一些Ajax函數。 在某種程度上,我希望應用程序在服務器端執行操作后,在瀏覽器中打開一個新選項卡並顯示一個xhtml頁面。 我為此選擇了標簽。 看起來就是這樣:

<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>

正在執行的代碼如下:

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);
}

這將返回“ showAudits”字符串。 根據我的導航規則,此String必須打開以下鏈接: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>

規則適用得很好,但是,頁面在我的應用程序的主面板中打開,我的意思是,打開了一個新的瀏覽器選項卡,但整個應用程序都在其中顯示了auditInfo.xhtml內容,以便僅顯示auditInfo.xhtml頁面。

這似乎是一些過濾問題,因為在調用org.ajax4jsf.Filter之后,將調用我的應用程序bean的setContent()方法。 但是我不希望該方法被調用。 有任何想法嗎?

解決。 該標簽位於a4j:outputPanel內部,因此,即使未將其自動設置為ajaxRender,Richfaces也在對該請求使用ajax過濾器。 該過濾器導致了此問題。 更改ah:panelGroup的a4j:outputPanel已解決了該問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM