wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From theivorykitty <chantal.da...@frontier.com>
Subject OnMouseOver and OnMouseOut menu
Date Sun, 30 Sep 2012 05:25:07 GMT
Hey guys!

So, basically I have a panel which, underneath some other items, has a
WebMarkupContainer which contains:
(1) A text link
(2) The label that goes inside the link (the text for the link above)
(3) A panel with clickable options in it. This panel is hidden with
setOutputMarkupPlaceholderTag set to true.

The WebMarkupContainer which contains all of these items has an
AjaxEventBehavior("onmouseover"), and an AjaxEventBehavior("onmouseout")
which make the #3 panel with clickable options in it visible or not visible.

The visible/invisible bit works wonderfully - however, the onmouseout
behavior happens too quickly - I can't get the mouse the tiny hair-line
distance between the #1 text link and the #3 panels with the options in
them.

Is there a way to add some sort of wait time or something to the onmouseout
behavior to give the user enough time to get into the selection panel?
And/or is this a totally hokey way to do this and should I try a different
way?

Any help is GREATLY appreciated!!! 

Example Code:

       WebMarkupContainer webcontainer = new
WebMarkupContainer("container");

        Panel panel = new Panel ("panel");
        webcontainer.add(panel);
        panel.setOutputMarkupPlaceholderTag(true);
        panel.setVisible(false);

        AjaxLink link = new AjaxLink ("link");
        webcontainer.add(link.setOutputMarkupId(true));
        
        Label labelText = new Label("labelText", "Hover Over Me!");
        link.add(labelText);
        labelText.setOutputMarkupId(true);
        labelText.setOutputMarkupPlaceholderTag(true);
        labelText.setVisible(true);

        webcontainer.add(new AjaxEventBehavior("onmouseover") {

            @Override
            protected void onEvent(AjaxRequestTarget target) {
                panel.setVisible(true);
                target.add(panel, panel.getMarkupId());
            }
        });
        webcontainer.add(new AjaxEventBehavior("onmouseout") {

            @Override
            protected void onEvent(AjaxRequestTarget target) {
                panel.setVisible(false);
                target.add(panel, panel.getMarkupId());
            }
        });

        add(webcontainer);
        webcontainer.setOutputMarkupId(true);

Thanks,



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/OnMouseOver-and-OnMouseOut-menu-tp4652538.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Mime
View raw message