I have a problem with window objects being shown in the center of an iframe instead of the browser window. Is there any way around this? I know the documentation says under centerInPage() "Centers the Window in the page. This is called automatically in window.show() if Window.autoCenter is true. Note - if the Window is a child of another widget, we center in the parent widget rather than centering in the page. " but I would like to figure out how to override this behaviour.
Save the following code in two different files. Open in the iframe.html and click on Show Window button. You'll notice the window is not visible until you scroll down. This testcase works fine if the iframe height/width is "100%".
windowSample.html:
iframe.html
Save the following code in two different files. Open in the iframe.html and click on Show Window button. You'll notice the window is not visible until you scroll down. This testcase works fine if the iframe height/width is "100%".
windowSample.html:
Code:
<HTML><HEAD><TITLE> </TITLE> <SCRIPT>var isomorphicDir = "../../isomorphic/"</SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=../../isomorphic/skins/SmartClient/load_skin.js></SCRIPT> </HEAD><BODY bgcolor=tan><SCRIPT> isc.IButton.create({ ID: "touchButton", width: 120, title: "Touch This" }); isc.Label.create({ left: 150, height: 20, contents: "<a href='http://www.google.com' target='_blank'>Open Google</a>" }); isc.IButton.create({ title: "Show Window", top: 35, left: 75, click : function () { touchButton.setTitle("Can't Touch This"); modalWindow.show(); } }); isc.Window.create({ ID: "modalWindow", title: "Modal Window", autoSize:true, autoCenter: true, isModal: true, showModalMask: true, autoDraw: false, closeClick : function () { touchButton.setTitle('Touch This'); this.Super("closeClick", arguments)}, items: [ isc.DynamicForm.create({ autoDraw: false, height: 48, padding:4, fields: [ {name: "field1", type: "select", valueMap: ["foo", "bar"]}, {name: "field2", type: "date"}, {type: "button", title: "Done", click: "modalWindow.hide();touchButton.setTitle('Touch This')" } ] }) ] }); </SCRIPT></BODY></HTML>
Code:
<html> <iframe src="windowSample.html" width="100%" height="2000"></iframe> </html>
Comment