iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I am attempting to close all windows that are visible. The following code closes every other window. For example if there are 10 visible windows 5 will close. What is the problem with the code?
function CloseWindows(){ var dm = ISGetDesktopManager(); for (var i = 0; i < dm.Windows.length; i++ ) { var win = dm.Windows[i]; if (win.ClientVisible == true) { win.Close(); } }}
Edited 09/24/2009: encapsulate the code in <pre> tag to avoid duplication issue
Al, try to add i-- after calling win.Close()
The code should look like:
function CloseWindows() { var dm = ISGetDesktopManager(); var length = dm.Windows.length; for (var i=0; i<length; i++) { var win = dm.Windows[i]; if (win.ClientVisible == true) { win.Close(); i--; } } }
Let me know if it works for you.
Hope this helps,James.
The code snippet appears twice, and I have been unable to remove the duplicate.
edited double post.
I have tested the snippet on our environment, it is running as expected all the opened window will be closed. Attached is the sample we are using to test the snippet in our environment.
Have you used all the latest build of WebDesktop and WebUI Framework?
Glenn;
I am stilling getting every other window to close. The difference between my code and your is that am creating new windows with client side code rather than opening windows that alread exist.
Thanks,
Al
Hi Al,
Try to use the following code:
function CloseWindows() { var dm = ISGetDesktopManager(); var length = dm.Windows.length; for (var i=0; i<length; i++) { var win = dm.Windows[0]; if (win.ClientVisible == true) { win.Close(); } } }
Hope this helps.
Best Regards,
Gordon Tumewu
Gordon;
None of the windows close when I use your suggested code. The problem appears to be line below:
var win = dm.Windows[0];
When I cahnge this to:
var win = dm.Windows[i];
It goes back to every other window closing.
Do you have any other suggestions?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname