• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

MouseMove event does not fire after a dialog is displayed on the user control

I have a user control embedded inside internet explorer as shown below. I am trying to pass mouse move event args to my control to reset logout time. Everything works fine until a dialog is popped up on the control and mousemove does not fire after the dialog is closed eventhough the mouse is moving inside the user control area. It would reset itself If I move the mouse outside the user control and then move back in.

Any idea how to make it work after the dialog is closed without having to leave the user control and re-enter to make it work.


HTML SOURCE

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
<meta name="AUTHOR" content="PRCUA">
<meta name="MS.LOCALE" content="EN-US">
<meta name="ROBOTS" content="noindex">

<style type="text/css">
DIV.Control
{
      padding: 10;
      background-color: #CFCFCF;
      width: 1290px;
}
</style>

<script type="text/javascript">
//<!--window.open("http://localhost/Host/ProjectPermissionPackage.msi"); -->

function fnTrackMouse()
{
  oNotice.innerText="Coords: (" + event.clientX + ", " + event.clientY + ")";
}

function ResetLogout()
{
  document.MC.ResetAutoLogoutTimer(event.clientX, event.clientY);
}

function ResetLogoutOnMouseOver()
{
  document.MC.ResetAutoLogoutTimer(0, 0);
}
</script>

</head>

<body>

<font color="green">

<div id="oControl" class="Control">
<object id="MC" classid="http://localhost/Control.dll#ControlLibrary.MC" onmousemove="ResetLogout()" onmouseenter="ResetLogoutOnMouseOver()" VIEWASTEXT />   </object>
</div>

</body>

</html>

Thanks

J
0
YetAnotherCoder
Asked:
YetAnotherCoder
  • 11
  • 10
1 Solution
 
HainKurtSr. System AnalystCommented:
where is the dialog?
0
 
YetAnotherCoderAuthor Commented:
The dialog is displayed when a button on the Windows User Control is clicked.
0
 
HainKurtSr. System AnalystCommented:
I guess you need to focus the object after dialog is closed

or does this make any difference
<div id="oControl" class="Control" onmousemove="ResetLogout()" onmouseenter="ResetLogoutOnMouseOver()"> 
<object id="MC" classid="http://localhost/Control.dll#ControlLibrary.MC" VIEWASTEXT />
</div>

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
YetAnotherCoderAuthor Commented:
NOPE!
0
 
HainKurtSr. System AnalystCommented:
do you have a test link, I need to see it in action...
0
 
HainKurtSr. System AnalystCommented:
or can you post the control, can we test it on our local machines?
0
 
YetAnotherCoderAuthor Commented:
Ok! I will post it shortly.
0
 
HainKurtSr. System AnalystCommented:
look at this sample :) resize windows or div and make it larger so alert stays inside object area, or use spacebar to close the dialog, and mousemove will continue work...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
<meta name="AUTHOR" content="PRCUA">
<meta name="MS.LOCALE" content="EN-US">
<meta name="ROBOTS" content="noindex">

<style type="text/css">
DIV.Control 
{
      padding: 10;
      background-color: #CFCFCF;
      width: 1290px;
      height:200px;
}
</style>

<script type="text/javascript">
//<!--window.open("http://localhost/Host/ProjectPermissionPackage.msi"); -->

function fnTrackMouse()
{
  document.getElementById("oNotice").innerHTML="Coords: (" + event.clientX + ", " + event.clientY + ")";
}

function ResetLogout() 
{
	fnTrackMouse();
  //document.MC.ResetAutoLogoutTimer(event.clientX, event.clientY);
}

function dlg(){alert("sample dialog!");}

function ResetLogoutOnMouseOver() 
{
  document.MC.ResetAutoLogoutTimer(0, 0);
}
</script>

</head>

<body>

<font color="green">

<div id="oControl" class="Control" onmousemove="ResetLogout()" onClick="dlg()"> 
<object id="MC" classid="http://localhost/Control.dll#ControlLibrary.MC" VIEWASTEXT />   </object>
</div>

<div id=oNotice>???</div>
</body>

Open in new window

0
 
YetAnotherCoderAuthor Commented:
Here are my files:

I have attached a zip file. When you extract into wwwroot you will have all the library files with the htm file to test.... When you click Control3, it displays a login dialog and you look track of the mouse after you close the login dialog until you get out of the gray area and come into it. That would reset the mouse move....
Let me know if you need source files, vb.net, I can upload too.

Thanks

TwoControls.zip
0
 
YetAnotherCoderAuthor Commented:
I have tested with alert right before you posted. It works with alert but not with Login dialog originated from the control embdded. DON'T know why?
0
 
HainKurtSr. System AnalystCommented:
i dont see any button :) so no dialog appears...
0
 
HainKurtSr. System AnalystCommented:
just a square with yellow box showing mouse coordinates... did you miss anything?
0
 
YetAnotherCoderAuthor Commented:
No. The zip file should have three dlls,
ButtonControl.dll,
RadioControl.dll
and
TwoUserControls.dll

with Test.htm page.

TwoUserControls has a class called WholeControl....That can be instantiated to display in IE....

Do you see them?
0
 
YetAnotherCoderAuthor Commented:
Add localhost to Trusted Sites.....That will also block from being displayed
0
 
HainKurtSr. System AnalystCommented:
are you doing something with mouse events on the form?
0
 
YetAnotherCoderAuthor Commented:
Yes!

The mouse move is used to prolong the log out time of a user, if he is logged in. So it is important that the User Control know when mouse is moving or has stopped moving on the user control to appropriately log the user out.
0
 
HainKurtSr. System AnalystCommented:
maybe you should change your control dll and after disabling button3, you should focus on form or some other element on the control
0
 
YetAnotherCoderAuthor Commented:
NO LUCK! I tried to make the User Control as the focus with no success. Also I have tried to set focus to Control1 button with no success... It seems like an impossible task...
0
 
HainKurtSr. System AnalystCommented:
maybe it is a bug on IE, I found some articles with IE bug, actually a windows bug I guess since IE is using some common controls from os...
0
 
HainKurtSr. System AnalystCommented:
strange thing is, when you right click it starts firing onmouse events :)
0
 
YetAnotherCoderAuthor Commented:
You are right. I didn't notice until you said that. But still is not very useful. Any other ideas....

Thank you
0
 
John ClaesCommented:
it looks Like the Javascript is called only once for every Mouse over action.
This way you don't fire the Method every for every coordinate-change.

so when comming over the control the onmouseover is called (you see the dialogbox) but is then blocked so the user can get off that control without it shooting again.
When the user leaves the control the onmouseover is reactivated.

The Rightclick will reactivate all JavaScripts because it's an specific user action.


I would propose a set of independent controls scattered over the page to get the onmouseovers and send them all to the same method call
==> Example :
when building the page with tables (old school ) ==> fill the empty TD's so you can fetch onmouseover actions

when building the page with DIV's create layerDivs around the Div so you can also fetch the onmouseover actions.

know that in both examples the onmouseOver is always activated upon the highest control ==>
div containing a textbox ==> when going with the mouseOver the textbox the method upon the DIV is called 2 times
when going upon the DIV
when leaving the Textbox (comming back upon the DIV)

i hope to have helped
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 11
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now