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 have a desktop wep
I want to close an page
so like the sample I am using this code var curWin = ISGetCurrentWindow();
ISGetObject("WebMenuBar1").HideAll(); // ensure all menus are closed before exit curWin.Close(true); // close with raise event
but in one page I have a dialog box
if I open this dialog and close it ISGetCurrentWindow function will retrive null and the closing code will not work
I tried to use this fucntion ISCloseCurrentWindow();
also not working
this happenes only if I open the dialog box and close it
The issue :
that the windows cllection will remove the child window if the user close a dialog from this child window
So Active window is null and also if I tried to get the window by GetWindow function it will retrive null as well
Then I checked the windows.lenght if gound it zero
So
I implement a workaroud as follow
function Button1_onclick() { var dialogbox = ISGetObject("WebDialogBox1"); var wnd = ISGetDesktopManager(); if (lastwnd == null) lastwnd = wnd.GetActiveWindow(); dialogbox.ShowDialog(); }
assiging a bublic variable lastwnd before opening the dialog
and in closing
var lastwnd =null ; function Button2_onclick() { var wnd = ISGetDesktopManager(); if (wnd.GetActiveWindow() !=null) wnd.GetActiveWindow().Close(); if (lastwnd !=null) lastwnd.Close(); }
I will close this public variable if the GetActiveWindow retrieve null
and It works correctly
Hi Hamdy,
I'm apologize if I have misinterpret the scenario that you describe in the statement above. If I'm not wrong, are you trying to close the WebDesktop's window and WebMenuBar after open WebDialogBox?
If yes, you could use these snippet :
function Button1_onclick() { var wnd = ISGetDesktopManager("WebDesktopManager1"); var mnuBar = ISGetObject("WebMenuBar1"); var activeWnd = wnd.GetActiveWindow(); mnuBar.Hide(); activeWnd.Close(); }
Unfortunately, I'm sorry that I'm not use your code because the codes doesn't work in my end.
Here I attach the sample for you. Please let me know if this sample has appropriate with your need or not.
And if this sample is not fit with your scenario, please let me know the scenario with more details. Thank you.
Regards,
Julia
Thanks for supporting
but it is still not wotking
my case as follow
1- open the dialog
2 -close the dialog
3- close the page
var activeWnd = wnd.GetActiveWindow();
activeWnd object is null
that happened also with ur code by the way
I'm really apologize about my sample attachment before, because I haven't edit the comment. Here I reattach you the sample. This sample using exactly the same code as my statement before.
I have follow your step in this sample and its working fine in my end. Could you please try this sample in your place and let me know if this sample work or not?
Below is the following step:
- click on button open 'DialogBox'
- close the dialog box ( click close (x) )
- click on button 'close all' to close the window
If this sample is not work, could you send me your sample project that replicating your issue?
And for better result, please do not forget to use the latest bins before you run the project.
Thank you.
Dear Julia
Still the sample not my case
my case , that the button which close the opened window in the window it self not in the parent
I attached your sample after making my case
and it has the error
1- open the dialog box from the child window
2- close the dialog
3- close the child window from the button on it (Close the form)
if i did not open the dilaog box the button will wiork and close the window
sorry the code by VB.net
and also he is the code PageDialogBox
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="PageDialogBox.aspx.vb" Inherits="PageDialogBox" %> <%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop" TagPrefix="ISWebDesktop" %> <html> <head id="Head1" runat="server"> <title></title> <script language="javascript" type="text/javascript"> // <!CDATA[ function Button2_onclick() { var wnd = ISGetDesktopManager(); var activeWnd = wnd.GetActiveWindow(); alert(activeWnd.Name + " is closed"); //activeWnd would be 'Window 1' activeWnd.Close(); } function Button1_onclick() { var dialogbox = ISGetObject("WebDialogBox1"); dialogbox.ShowDialog(); } // ]]> </script> </head> <body> <form id="form1" runat="server"> <div> <ISWebDesktop:WebDialogBox ID="WebDialogBox1" runat="server" Height="150px" Width="400px"> <WindowSettings> <WindowStyle> <Normal BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma" Font-Size="8pt"> </Normal> <Active BaseStyle="Normal" BorderColor="Gray"> </Active> </WindowStyle> <CaptionStyle> <Normal Cursor="Default" BackColor2="Gainsboro" BackColor="Gray" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="White"> <Padding Top="2px" Left="2px" Right="2px" Bottom="2px"></Padding> </Normal> <Active BackColor2="192, 192, 255" BaseStyle="Normal" BackColor="Navy"> </Active> </CaptionStyle> <CaptionButtonStyle> <Normal Overflow="Hidden" OverflowY="Hidden" OverflowX="Hidden" BorderColor="White" BorderStyle="Solid" BorderWidth="1px" Height="17px"> </Normal> <Over BaseStyle="Normal"> <BorderSettings> <Bottom Color="Gray"></Bottom> <Right Color="Gray"></Right> </BorderSettings> </Over> <Active BaseStyle="Normal"> <BorderSettings> <Left Color="Gray"></Left> <Top Color="Gray"></Top> </BorderSettings> </Active> </CaptionButtonStyle> <ContainerStyle BackColor="White" Font-Names="Tahoma" Font-Size="8pt" Height="100%" Width="100%"> <Padding Top="4px" Left="4px" Right="4px" Bottom="4px"></Padding> </ContainerStyle> <CommandButtonStyle> <Normal BackColor="Control" BorderColor="ControlDarkDark" BorderStyle="Solid" BorderWidth="1px" Font-Bold="False" Font-Italic="False" Font-Names="Tahoma" Font-Size="8pt" Font-Underline="False"> </Normal> <Over BaseStyle="Normal" BackColor="#C5C2AF"> </Over> <Active BaseStyle="Normal" BackColor="#8A887B" ForeColor="White"> </Active> </CommandButtonStyle> <CommandButtonDisabledStyle BackgroundImage="" CustomRules="" BackColor="Control" BorderColor="ControlDarkDark" BorderStyle="Solid" BorderWidth="1px" Font-Bold="False" Font-Italic="False" Font-Names="Tahoma" Font-Size="8pt" Font-Underline="False" ForeColor="Gray"> </CommandButtonDisabledStyle> </WindowSettings> </ISWebDesktop:WebDialogBox> <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></div> <input id="Button2" type="button" value="close this form" onclick="return Button2_onclick()" /> </form> </body> </html>
Thank you for the sample.
Since you are going to close the window from an IFrame button, it is recommended to access the window parent first. Therefore, you could use the following code to modified the code in PageDialogBox sample:
function Button2_onclick() { var wnd = window.parent.ISGetObject("WebDesktopManager1"); var activeWnd = wnd.GetActiveWindow(); alert(activeWnd.Name + " is closed"); activeWnd.Close(); }
I hope this could helps.
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