0

ご覧のとおり、コマンド リンクをクリックしてダイアログ ボックスを表示しようとしています。ダイアログは IE と Firefox では表示されますが、Google Chrome v23 では表示されません。提案してください。

<h:form id="myForm">
    <p:tabView id="tabView">
        <p:tab id="tab1" title="Tab 1">
            <h:panelGrid columns="1" cellpadding="10">
                <h:dataTable value="#{testBean.dataList}" var="data">
                    <h:column>
                        <h:outputText value="#{data}" />
                    </h:column>
                    <h:column>
                        <p:commandLink action="#{testBean.loadCommentHistory(data)}"
                                       update=":myForm:tabView:dialog" oncomplete="dlg.show()">
                            <h:graphicImage url="resources/theme1/images/comments.gif"
                                            styleClass="basicImageStyle" />
                        </p:commandLink>
                    </h:column>
                </h:dataTable>
                <p:dialog id="dialog" header="Dynamic Dialog" widgetVar="dlg">
                    <h:outputText value="#{testBean.commentHistory}" />
                </p:dialog>
            </h:panelGrid>
        </p:tab>
    </p:tabView>
</h:form>
4

2 に答える 2

0

ダイアログを更新すると、ダイアログは非表示のデフォルト状態にリセットされます。ダイアログを呼び出しdialog.show()て更新すると、ダイアログは再び非表示になります。Chrome (おそらく IE や FireFox よりも高速) は、これを別の方法で処理しているようです。解決策は、ダイアログのコンテンツをコンテナーにラップし、コンテナーを更新することです。

<p:commandLink action="#{testBean.loadCommentHistory(data)}"
    update=":myForm:tabView:dialog-content" oncomplete="dlg.show()">
    <h:graphicImage url="resources/theme1/images/comments.gif"
        styleClass="basicImageStyle" />
</p:commandLink>

<p:dialog id="dialog" header="Dynamic Dialog" widgetVar="dlg">
    <p:outputPanel id="dialog-content">
        <h:outputText value="#{testBean.commentHistory}" />
    </p:outputPanel>
</p:dialog>
于 2012-12-12T12:52:42.057 に答える
0

ページを af:view タグでカプセル化していない場合は、カプセル化してみてください。Chrome と Safari で存在しない場合、いくつかの問題があります。http://primefaces.org/faq.html質問 3を参照してください。

<html xmnls=... >
    <f:view contentType="text/html">
        <h:head>
            ....
        </h:head>
        <h:body>
            ....
        </h:body>
    </f:view>
</html>
于 2012-12-12T14:02:21.827 に答える