I have a problem in showing a Modal Panel with JSF 1.2 & rich faces. I have to use a jsp because of project restrictions. The a4j commandLink does submit to the server and it comes back to the browser and the browser blinks but nothing shows up.
This is the fragment I used in my 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>
....
This is the error I get when I include above fragment in my jsp
panel.component is undefined
...,opts);});};Richfaces.hideModalPanel=function(id,opts,event){var panel=$(id);if(...
If I use the same in a seperate Test jsp (shown below) - which I created to test, it works fine.
<%@ 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>
Thanks and I appreciate any help from you guys. I have spent couple of days struggling to do this. I had another css solution that I used after a4j jsfunction call to server to get info for the popup and show the overlay popup but that does not work in Chrome and it works in IE with a script error in jquery script code and not in my code, but works fine in Firefox, that is when I switched to Richfaces solution thinking it looks very somple but once I include a test working (on seperate page) solution to my jsp it does not work.