JSF 1.2 とリッチ フェイスを含むモーダル パネルの表示に問題があります。プロジェクトの制限により、jsp を使用する必要があります。a4j commandLink はサーバーに送信され、ブラウザに戻ってブラウザが点滅しますが、何も表示されません。
これは私がjspで使用したフラグメントです
....
....
<f:view>
....
....
<h:form id="buildForm">
....
....
<a4j:commandLink id="showItem" action="#{popupBean.selectAttributeAction}" oncomplete="Richfaces.showModalPanel('modalPanelId',{width:550, top:200});" reRender="modalPanelId">
Click Here!
</a4j:commandLink>
<rich:modalPanel id="modalPanelId" width="350" height="100">
<!-- the external content is loaded inside this tag -->
<div id="modalPanelResult">
This is test modal popup
</div>
</rich:modalPanel>
....
....
</h:form>
</f:view>
....
これは、jsp に上記のフラグメントを含めると発生するエラーです。
panel.component is undefined
...,opts);});};Richfaces.hideModalPanel=function(id,opts,event){var panel=$(id);if(...
テスト用に作成した別のテストjsp(以下に示す)で同じものを使用すると、正常に動作します。
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<a4j:commandLink id="showItem" action="#{popupBean.selectAttributeAction}" oncomplete="Richfaces.showModalPanel('modalPanelId',{width:550, top:200});" reRender="modalPanelId">
Click Here!
</a4j:commandLink>
<rich:modalPanel id="modalPanelId" width="350" height="100">
<!-- the external content is loaded inside this tag -->
<div id="modalPanelResult">
This is test modal popup
</div>
</rich:modalPanel>
</f:view>
</body>
</html>
ありがとう、皆さんからの助けに感謝します。私はこれを行うのに苦労して数日を費やしました。サーバーへのa4j jsfunction呼び出しの後にポップアップの情報を取得してオーバーレイポップアップを表示するために使用した別のcssソリューションがありましたが、それはChromeでは機能せず、IEでは機能し、私のコードではなくjqueryスクリプトコードでスクリプトエラーが発生します、しかしFirefoxでは正常に動作します。つまり、Richfacesソリューションに切り替えたとき、それは非常にシンプルに見えると思っていましたが、jspに(別のページで)テストを実行するソリューションを含めると、動作しません。