Re: ModalWindow and jQuery mousedown binding

2014-04-03 Thread Martin Grigorov
Hi,

Thanks for sharing your findings !

On Wed, Apr 2, 2014 at 11:20 PM, neilbennett nbenn...@awaremanager.comwrote:

 Hello again. Thanks for your help, I've found what occurs. When removing
 onmousedown=Wicket.Event.stop(event); from the w_content_1 div, the event
 then propagates. However, the mouseDownHandler function is called in the
 Drag class in wicket-ajax-jquery.js this returns false which then stops
 further event propagation. Commenting out the return false then allows my
 component popup window to close.


I am not sure why only commenting out the return statement helps.
At
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L2410there
is another Wicket.Event.stop(event) call that I think also should
mess the things up in your case ...



 So that's the cause, I'm not sure of the best way to work around this. I
 can
 crudely remove the bindings/return value, but I'm sure that will break
 things. Thought I'd report back anyway - if anyone has any suggestions to
 work around this or what would break/not break from changing this.


I am also not aware why this code needs to stop the propagation of the
event.
Please file a bug in our Jira with a quickstart and I'll try to find out.



 Thanks,

 Neil

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859p4665236.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: ModalWindow and jQuery mousedown binding

2014-04-03 Thread neilbennett
Hi Martin,

You are exactly right. The other Wicket.Event.stop(event) does need to be
commented out. I've found that while this does allow pop-up's to be closed,
it also stops fields taking focus. I will submit a JIRA issue with a
quickstart though.

Thanks,

Neil

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859p4665250.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow and jQuery mousedown binding

2014-04-02 Thread neilbennett
Hello again. Thanks for your help, I've found what occurs. When removing
onmousedown=Wicket.Event.stop(event); from the w_content_1 div, the event
then propagates. However, the mouseDownHandler function is called in the
Drag class in wicket-ajax-jquery.js this returns false which then stops
further event propagation. Commenting out the return false then allows my
component popup window to close.

So that's the cause, I'm not sure of the best way to work around this. I can
crudely remove the bindings/return value, but I'm sure that will break
things. Thought I'd report back anyway - if anyone has any suggestions to
work around this or what would break/not break from changing this.

Thanks,

Neil 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859p4665236.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow and jQuery mousedown binding

2014-03-12 Thread Martin Grigorov
Hi,

You can use Google Chrome's Event Listener Breakpoints and see where
mousedown is trapped.
Dev Tools - Sources - right pane - Event Listener Breakpoints - Mouse
-mousedown

Martin Grigorov
Wicket Training and Consulting


On Tue, Mar 11, 2014 at 11:32 PM, neilbennett nbenn...@awaremanager.comwrote:

 Thanks for the reply. I actually removed that binding from the html output
 but I don't see any noticeable changes in behavior. Clicks on the
 modalwindow still do not trigger the mousedown binding on the datetime
 component unless it is outside of the modal window.

 I have limited javascript knowledge, hence why using Wicket, but I'm
 stumped
 on where to look on why these events aren't being sent to the datetime
 component.

 Thanks,

 Neil

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859p4664902.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: ModalWindow and jQuery mousedown binding

2014-03-11 Thread neilbennett
Thanks for the reply. I actually removed that binding from the html output
but I don't see any noticeable changes in behavior. Clicks on the
modalwindow still do not trigger the mousedown binding on the datetime
component unless it is outside of the modal window.

I have limited javascript knowledge, hence why using Wicket, but I'm stumped
on where to look on why these events aren't being sent to the datetime
component.

Thanks,

Neil

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859p4664902.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow and jQuery mousedown binding

2014-03-10 Thread Martin Grigorov
Hi,

I don't know what is the reason to stop the event at
https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js?source=c#L1186

You can remove that binding with:
jQuery('.wicket-modal .w_content_1')[0].onmousedown = null; // or =
function() {};


 Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 7, 2014 at 6:22 PM, neilbennett nbenn...@awaremanager.comwrote:

 Hi,

 I am experiencing an issue very similar to Andrew Geery here,

 http://apache-wicket.1842946.n4.nabble.com/weird-interaction-between-ModalWindow-and-jQuery-mousedown-binding-td4473055.html

 I have a ModalWindow open with a datetimepicker
 (http://www.malot.fr/bootstrap-datetimepicker/) component. On
 non-ModalWindow pages this component closes if open when clicked outside of
 it's area, but the ModalWindow consumes the mousedown event and so
 datetimepicker is not closed when clicking outside of it or even when the
 modal window is closed itself.

 Are there any ideas on how to have these ModalWindow mousedown events not
 be
 consumed?

 Thanks,

 Neil

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




ModalWindow and jQuery mousedown binding

2014-03-07 Thread neilbennett
Hi,

I am experiencing an issue very similar to Andrew Geery here,
http://apache-wicket.1842946.n4.nabble.com/weird-interaction-between-ModalWindow-and-jQuery-mousedown-binding-td4473055.html

I have a ModalWindow open with a datetimepicker
(http://www.malot.fr/bootstrap-datetimepicker/) component. On
non-ModalWindow pages this component closes if open when clicked outside of
it's area, but the ModalWindow consumes the mousedown event and so
datetimepicker is not closed when clicking outside of it or even when the
modal window is closed itself.

Are there any ideas on how to have these ModalWindow mousedown events not be
consumed?

Thanks,

Neil

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-jQuery-mousedown-binding-tp4664859.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: weird interaction between ModalWindow and jQuery mousedown binding

2012-03-14 Thread Andrew Geery
Line 749 of modal.js seems to have the answer that, yes, mousedown events
don't bubble out of a ModalWindow -- am I reading that correctly?

div class=\w_content_1\ onmousedown=\if (Wicket.Browser.isSafari()) {
event.ignore = true; } else { Wicket.stopEvent(event); } \+

Thanks
Andrew

On Wed, Mar 14, 2012 at 4:34 PM, Andrew Geery andrew.ge...@gmail.comwrote:

 I'm using the jQuery Multiselector (
 http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ ) with
 Wicket 1.4.19 (via jqWicket 0.6).  The multi-selector was straightforward
 to integrate with Wicket and use on a regular page.

 Using it in a ModalWindow was a little trickier because you have to
 manually add the JS + CSS to the header of the ModalWindow (which jqWicket
 takes care of for you on a regular page).

  Here's my problem:

 When I click outside of a multi-selector component on a regular page, the
 multiselector closes.  However, when I click outside of a multi-selector in
 the containing ModalWindow, it does not.

 I've traced the problem back to the following line in the multiselector
 (the self.close() method simply closes/rolls up the multiselector options):

$(document).bind('mousedown.multiselect', function (e) {
 if (self._isOpen  !$.contains(self.menu[0], e.target) 
 !$.contains(self.button[0], e.target)  e.target !== self.button[0]) {
 self.close();
 }
});

 I've verified that the mousedown bind does indeed happen in both the
 regular page and in the ModalWindow.

 The difference is that, on a regular page, the handler function is called
 when I click anywhere on the page (i.e., jQuery detects the mousdown
 event).  However, in the ModalWindow, the handler is not called when I
 click in the ModalWindow (i.e., jQuery does not detect the mousedown event
 in the context of the ModalWindow).  To make things more interesting, the
 handler is called if I click on the page *outside* of the ModalWindow.

 Is there anything in a ModalWindow that would make jQuery bind not work
 for mousedown events that target the ModalWindow itself?

 Thanks
 Andrew