I would like to open an URL from the Smart Client into asmall IE pop-up window. And after few seconds auto-closing it.
But it opens the url as a tab in IE and in full size, and it auto-closes because of the script which is into the <body> beacon.
Here is the code I typed to do it:
- Code: Select all
application.showURL('http://localhost:8080/examples/doc2pdf.jsp','_blank','top=240,left=380,resizable=no,width=400,height=135',5);
And here is the page content:
- Code: Select all
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.util.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<%
ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
if (servoy_hc == null)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"doc2pdf_test");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("testForm");
if (!ok)
{
out.print("error cannot work on required form");
return;
}else{
String browse = request.getParameter("browse");
}
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Servoy Headless Client test</title>
</head>
<body onLoad="setTimeout(window.close(), 5000)">
Generating...<BR>
<%
servoy_hc.executeMethod(null,"genPDF",null);
out.print("END");
%>
</body>
</html>