Source code: com/webobjects/woextensions/JSModalWindow.java
1 /*
2 * JSModalWindow.java
3 * © Copyright 2001 Apple Computer, Inc. All rights reserved.
4 * This a modified version.
5 * Original license: http://www.opensource.apple.com/apsl/
6 */
7
8 package com.webobjects.woextensions;
9
10 import com.webobjects.appserver.*;
11 import com.webobjects.foundation.*;
12
13
14 public class JSModalWindow extends JSComponent {
15 public JSModalWindow(WOContext aContext) {
16 super(aContext);
17 }
18
19
20 public String contextComponentActionURL(){
21 // Return the javascript function to the HREF, getting the URL for the action
22 // from the invokeAction setting in the context
23 return "window.open('"+context().componentActionURL()+"','"+valueForBinding("windowName")+"','"+windowInfo()+"'); return false";
24 }
25
26 public String windowInfo() {
27
28 // Generate the javascript window details
29 return "toolbar="+((null!=valueForBinding("showToolbar")) ? "yes" : "no")+
30 ",location="+((null!=valueForBinding("showLocation")) ? "yes" : "no")+
31 ",status="+((null!=valueForBinding("showStatus")) ? "yes" : "no")+
32 ",menubar="+((null!=valueForBinding("showMenubar")) ? "yes" : "no")+
33 ",resizable="+((null!=valueForBinding("isResizable")) ? "yes" : "no")+
34 ",scrollbars="+((null!=valueForBinding("showScrollbars")) ? "yes" : "no")+
35 ",width="+valueForBinding("width")+
36 ",height="+valueForBinding("height");
37 }
38 }