[jboss-user] [JBoss Seam] - Re: How can i popup a browser window?

fhh do-not-reply at jboss.com
Tue Mar 6 07:09:41 EST 2007


I do it in a project but I'm not sure if it is the best way to do it. Here it goes:

You have a event-scoped Seam component:

  | 
  | @Name("jspopup")
  | public class JsPopup {
  | 
  |   private String name;
  |   private String url;
  |   private int height;
  |   private int width;
  |  // etc.
  |   
  | 
  | /* Getters and Setters */
  | 
  | 
  | }
  | 

In your action method you create the popup component and outject it. Now
add some javascript at he beginning of the page:


  | <c:if test"! empty popup">
  | 
  |    <script language="javascsript>
  |        var vWinUsers = window.open('
  | #{jspopup.url}', #{jspopup.name},'width=#{jspopup.width},width=#{jspopup.height});
  |     vWinUsers.opener = self;
  | 	vWinUsers.focus()
  |    </script>
  | 
  | </c:if>
  | 

If you find a better way to do it please let me know.

Regards

Felix

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025359#4025359

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025359



More information about the jboss-user mailing list