diaglog window: window.resizeTo not working in onLoad event in IE?

622 views
Skip to first unread message

Jiayan Xiang

unread,
Mar 6, 2009, 9:54:33 AM3/6/09
to InterSystems: Zen Community
I have a standard dialog page that extends %ZEN.Dialog.standardDialog.
I would like to make sure it opens with a certain size. So I added
code in the onloadHandler event: window.resizeTo(800,800). But the
dialog will not resize in IE, it resizes properly in Firefox. For
regular zen pages, it resizes properly in both IE and Firefox.

Here is the code:

Main Page:

Class JYXTEST.ResizeTest Extends %ZEN.Component.page
{
Parameter APPLICATION = "JYXTEST.ZENAPP";
Parameter PAGENAME;
Parameter DOMAIN;

XData Contents
{
<page xmlns="http://www.intersystems.com/zen" title="">
<button id="idLaunchDialog" caption="Launch Dialog Page"
onclick="javascript:zenPage.LaunchDialog();"/>
<button id="idResize" caption="Resize"
onclick="window.resizeTo(500,500);"/>
</page>
}

Method LaunchDialog() [ Language = javascript ]
{
zenLaunchPopupWindow('JYXTEST.ResizeDialog.cls?','Test
Resizing','status,scrollbars,width=600,height=600');
}

/// This client event, if present, is fired when the page is loaded.
Method onloadHandler() [ Language = javascript ]
{
window.resizeTo(400,400);
}
}

The Dialog Page:

Class JYXTEST.ResizeDialog Extends %ZEN.Dialog.standardDialog
{

/// Class name of application this page belongs to.
Parameter APPLICATION = "JYXTEST.ZENAPP";

XData dialogBody
{
<pane title="Resize Test">

<titlePane title="Resize Test" width="100%" />

</pane>
}


/// Get the (localized) title string for the dialog.
/// This should be implemented in a subclass.
Method %OnGetTitle() As %String
{
Quit "Resize Test"
}

/// Get the (localized) subtitle string for the dialog.
/// This should be implemented in a subclass.
Method %OnGetSubtitle() As %String
{
Quit ""
}

/// Get the value that will be applied when the user presses the OK
button.
/// This is implemented by subclasses.
Method getDialogValue() [ Language = javascript ]
{
return "";
}

/// This callback is called after the server-side page
/// object and all of its children are created.<br>
/// Subclasses can override this to add, remove, or modify
/// items within the page object model, or to provide values
/// for controls.
Method %OnAfterCreatePage() As %Status
{
S %page.%GetComponentById("header").hidden=1
Q $$$OK
}

/// This callback, if defined, is called when the user presses the OK
or Apply action buttons.
/// If this returns false, then the action is cancelled.
Method ondialogFinish(action) [ Language = javascript ]
{
return false;
}

/// This client event, if present, is fired when the page is loaded.
Method onloadHandler() [ Language = javascript ]
{
window.resizeTo(800,300);
}

}


Bill McCormick

unread,
Mar 6, 2009, 10:56:44 AM3/6/09
to InterSys...@googlegroups.com, InterSystems: Zen Community
You should likely ask support. The dialog is just a window open and
should obey size constraints in both browsers.

Bill

Jiayan Xiang

unread,
Mar 6, 2009, 3:19:32 PM3/6/09
to InterSystems: Zen Community
Thanks, I did some more research and this is actually a browser
issue. I just need to do:

/// This client event, if present, is fired when the page is loaded.
Method onloadHandler() [ Language = javascript ]
{
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer") {
window.dialogHeight = '300px';
window.dialogWidth = '800px';
}
else {
window.resizeTo(800,300);
}
}

And it works for both IE and Firefox now.

Vu Pham

unread,
Mar 7, 2009, 11:37:03 PM3/7/09
to InterSys...@googlegroups.com

Hi,
Do you know why I am having this message 'Unable to lock session object as another process has this lock'
Thanks
Vu

Bill McCormick

unread,
Mar 8, 2009, 10:26:52 AM3/8/09
to InterSys...@googlegroups.com, InterSys...@googlegroups.com
It means that another request from that browser / session has been executing. That process is doing something long running as the error you reference only comes after the new request waits for the lock for 60 seconds. 

For asynchronous long running requests you can use %session.Unlock() to release the session object which will let the csp engine process the secondary request without waiting

Bill 
Reply all
Reply to author
Forward
0 new messages