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 write a js Funtion On page.When press 'Esc' key ,it call 'closeDialog()',then Close 'WebDialogBox1'.But how I judge that 'WebDialogBox1' whether or not to has focus????(like webgrid'S way grid.HasFocus() )Anyone can help me?thanks!</head><body onkeydown="buyShortKey()">function buyShortKey() { if (event.keyCode == 27) { closeDialog(); }}
//Close WebDialogBox1 function closeDialog() { var grid2 = ISGetObject("WebGrid2"); var grid1 = ISGetObject("WebGrid1"); if (grid2.HasFocus() == true) { var dlgBoxAbout = ISGetObject("WebDialogBox1"); dlgBoxAbout.CloseDialog(); grid1.SetFocus(); grid1.RootTable.GetRow(0).Select(); var goCell = grid1.RootTable.GetRow(0).GetCell('tradecode'); goCell.ActivateEdit(); } }
Hello Frank,
when the grid2 has focus, I can close WebDialogBox by the way ,but when the focus is on WebDialogBox not on grid2 ,I press 'Esc',it can not close WebDialogBox .You can have a try.
I think you missunderstood about our WebDialogBox control. Event though you can focus WebDialogBox, it does not mean that you can close WebDialogBox by pressing 'ESC'.
Example:You do not need to focus another control. Just Load WebDialogBox at page load and press 'ESC'. Notice that, It will not close WebDialogBox.
Unfortunately, WebDialogBox also doesn't have this feature. However, I have a workaround which can help you.
I add listener onkeydown for WebDialog's div global from OnCreated clientside event. During the focus in its div, we can validate your scenario.
function Created() { var el = document.getElementById("dvWnd_Global_wndWebDialogBox1"); Listener.Add(el, "onkeydown", keyDown); } function keyDown() { var dlg = ISGetObject("WebDialogBox1"); if (event.keyCode == 27) { dlg.CloseDialog(); } } function Button1_onclick() { var dlg = ISGetObject("WebDialogBox1"); var el = document.getElementById("dvWnd_Global_wndWebDialogBox1"); el.focus(); }
Hope this helps.
Regards,Handy
Anyone can help me?thanks!
Hello,
Unfortunately WebDialogBox does not have HasFocus method.
I have tried your sample on my side. everythings went right. It can close nicely, I even tried several times.
Please tell me kind of error did you get.
Regards,Niven.
So I want you give me a focus way for WebDialogBox .
Hi Frank,
Even if I remove the following code the WebDialogBox still closing properly.
Please make sure that you get the latest build on your project.
We do have a SetFocus method for WebDialogBox.
Niven.
For Example:First,the WebDialogBox (Not modal) has displayed on the page,then I put focus to other controls,last I click a button,I wish the WebDialogBox has got focus. how to achieve it?
webdiaog.SetFocus()????
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