Hi,

try to add them both at once.

component.add(clickbehavior,mousebehavior);

kind regards

Tobias

> Am 11.02.2015 um 07:51 schrieb avchavan <avinash.cha...@yahoo.co.in>:
> 
> Hi,
> 
> I am having a component with both onmouseover and onclick behavior.
> onmouseover behavior works but the onclick event never gets triggered.
> If i just keep the onclick event then it works.
> 
> Code:
> 
> firstContainer2.add(new AjaxEventBehavior("onclick") {
>                    @SuppressWarnings({ "unchecked", "rawtypes" })
>                    @Override
>                    protected void onEvent(final AjaxRequestTarget target) {
>                        for(Component acc:
> (ListView<String>)mainContainer.get("list2")){
>                            final Component accord = (Component)
> acc.get("descriptionContainer2");
>                            if(accord.isVisible()){
>                                accord.setVisible(false);
>                                target.add(accord);
>                            }
>                            Component firstCont2 = acc.get("firstContainer2");
>                            firstCont2.add(new AttributeModifier("class", ""));
>                            Component lArrow2 = firstCont2.get("leftArrow2");
>                            lArrow2.add(new AttributeModifier("class",
> "tableIconArrowLeft"));
>                            target.add(firstCont2);
>                        }
>                        descriptionContainer2.setVisible(true);
>                        firstContainer2.add(new AttributeModifier("class", 
> "info
> table-hover"));
>                        leftArrow2.add(new AttributeModifier("class",
> "tableIconArrowDown"));
>                        target.add(firstContainer2);
>                        target.add(descriptionContainer2);
>                    }
>                });
>                
>                firstContainer2.add(new AjaxEventBehavior("mouseover"){
> 
>                    @Override
>                    protected void onEvent(AjaxRequestTarget target) {
>                        if(firstContainer2.getStyle() == null ||
> !firstContainer2.getStyle().equalsIgnoreCase("ex")){
>                            firstContainer2.add(new AttributeModifier("class", 
> "ex"));
>                            target.add(firstContainer2);
>                        }
>                    }
>                    
>                });
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-onmouseover-and-onclick-event-misbehavior-tp4669442.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
> 

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

Reply via email to