
I am trying to get the BrowserOpenWindowCommand to open a new browser with an HTML source from within my application. The html is under the webapp folder and this works perfectly well in Mozilla Firefox, but not in Microsoft IE. Any suggestions? My code is posted below.
Thanks!
HttpServletRequest req = app.getCurrentRequest();
String sep = "/";
String serverName = req.getServerName();
int serverPort = req.getServerPort();
String contextPath = req.getContextPath();
StringBuilder sbURI = new StringBuilder()
.append("http:")
.append(sep)
.append(sep)
.append(serverName)
.append(":")
.append(serverPort)
.append(contextPath)
.append(sep)
.append("help")
.append(sep)
.append("Scenario2.htm")
;
StringBuilder sb= new StringBuilder()
.append("width=800")
.append(",height=600")
.append(",resizable=yes")
.append(",scrollbars=yes")
;
Command oComm = new BrowserOpenWindowCommand(sbURI.toString(),"New"",sb.toString());
app.enqueueCommand(oComm);
Do you get any exceptions? Usually stuff like this happens when the window name is invalid (at least for MSIE). Try using a different one.
Popupblocker?
The issue seems to have been in passing in any parameters for title or width/height, etc...
When I pass in
Command oComm = new BrowserOpenWindowCommand("http://www.google.com","","");it works great.
Thanks for the suggestions though...
this code don't work for me
I am using Firefox 3.013
I try this options
Command command = new BrowserOpenWindowCommand("http://www.google.com","","");
Command command = new BrowserOpenWindowCommand("http://www.google.com",null,null);
Command command = new BrowserOpenWindowCommand("http://www.google.com","New","");
ApplicationInstance.getActive().enqueueCommand( command )
but, don't work for me
anybody can help me?
Thank you.