Hi everybody,
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 beacon.
Here is the code I typed to do it:```
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:
<%@ 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”);
}
%>
Servoy Headless Client test
Generating...
<%
servoy_hc.executeMethod(null,“genPDF”,null);
out.print(“END”);
%>
```
IT2Be
January 27, 2009, 10:24am
2
Clever solution
But is that what you want in any way related to Servoy or is that just how IE behaves?
I am not sure if and how you can solve that (other than through preference settings in IE)…
IT2Be:
Clever solution
Thank you
IT2Be:
But is that what you want in any way related to Servoy or is that just how IE behaves?
I want the window to be poped-up as new small IE window. I don’t want it to be opened as a new tab.
Refering to the JavaDoc showURL should do the job.
IT2Be:
I am not sure if and how you can solve that (other than through preference settings in IE)…
Yes, the pop-up might be blocked by IE (by the way when try to auto-close it asks me if I want to close!). But I should be able to create a pop-up?!
I’m now trying to make my program working on the server (another machine). It works fine on my computer (using developer), but when I run it on the server it seems to be stuck when creating the headless client. I don’t get any error in the logs. The only thing I see, is the headless client and my smart client on the “clients” section of the server.
Here is code of the JSP page which seems to cause the problem:
<%@ 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" %>
<html>
<head>
<meta http-equiv="refresh" content="2;url=doc2pdf3.jsp?idnb=<%= request.getParameter("idnb") %>; charset=UTF-8">
<title>PDF file Generator</title>
</head>
<body onLoad="window.moveTo((screen.availWidth/2)-125,(screen.availHeight/2)-300),window.resizeTo(200,250)">
<%
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;
}
String docID = request.getParameter("docID");
String idnb = request.getParameter("idnb");
servoy_hc.executeMethod(null,"genPDF",new Object[]{docID,idnb});
out.print("<center>PDF file check...</center>");
%>
</body>
</html>
And the line which seems to cause the problem is:
servoy_hc = HeadlessClientFactory.createSessionBean(request,"doc2pdf_test");
doc2pdf_test is the solution name
testForm is the form which contains the genPDF method
what are you doing in “doc2pdf_test” ?
for example does it have an open solution method?
Does that one block somehow? Do you ask for user input?