MouseDown event preventing other controls from reacting

Hi

I have a simple page with one button that displays a sheet form. this form has a close button and a drop down menu. Very simple, right? I want the sheet window to close when the person clicks outside:

if( X < ((webpage1.Width/2)-(Me.Width/2))) or( X > ((webpage1.Width/2)+(Me.Width/2))) or (Y > Me.Height )then
close
end if

but when I put that code on the mousedown event, the dropdown stops working. I assume I need to execute the default mousedown event somehow once my code is executed, but I have no idea how to do this.

Something like call the default functionality before calling mine.

[quote=164602:@Andres Montoya]Hi

I have a simple page with one button that displays a sheet form. this form has a close button and a drop down menu. Very simple, right? I want the sheet window to close when the person clicks outside:

if( X < ((webpage1.Width/2)-(Me.Width/2))) or( X > ((webpage1.Width/2)+(Me.Width/2))) or (Y > Me.Height )then
close
end if

but when I put that code on the mousedown event, the dropdown stops working. I assume I need to execute the default mousedown event somehow once my code is executed, but I have no idea how to do this.

Something like call the default functionality before calling mine.[/quote]

Put this in the sheet MouseDown :

if x>me.width or x<0 or y <0 or y > me.height then me.close 

Thank you Michel but the code you gave me actually closes the window immediately. Whether outside or inside.

Sorry. Just use the code you posted in the sheet mousedown event.

Here is the minimalistic project link

Sample project

Click on the button
Click on the dropdown (does not work). It should be showing 1,2,3,4
click outside the window, it closes.

Need to have the dropdown to respond to the click. Right now the mouse down event is “stealing” the mouse, so it never gets sent to to the dropdown.

[quote=164630:@Andres Montoya]Here is the minimalistic project link

Sample project

Click on the button
Click on the dropdown (does not work). It should be showing 1,2,3,4
click outside the window, it closes.

Need to have the dropdown to respond to the click. Right now the mouse down event is “stealing” the mouse, so it never gets sent to to the dropdown.[/quote]

Indeed the popmenu does not work on the sheet window. I even tried to place it onto a WebContainer and put that on the sheet, it does not work either.

You should file a bug report in feedback, and attach your sample project.

As a workaround, you can put the popupmenu on a modal dialog box that you position on top of the webpage. I verified, it works there.

I am filing a bug report. I keep thinking that there might be something I missed or that I should be calling the original method.

If anybody has a workaround idea…

It is a very real bug. Whether the MouseDown event is added to the class or the instance, anything added there and the popupmenu becomes inactive.

I suggested using a dialog instead, but if you want another workaround, you could trap the JavaScript MouseDown.