I need a certain div to appear when the user mouse-overs an image.
For this, i added a behaviour to the image:

    add(imageDiv.add(new AjaxEventBehavior("onmouseover")
    {
      @Override
      protected void onEvent(AjaxRequestTarget target)
      {
        div.setVisible(true);
        imageDiv.remove(this);
        target.addComponent(div);
        target.addComponent(imageDiv);
      }
    }));

So I remove the behaviour once the div has been shown.

If I mouse-over the image twice in a row very fast, I get a

java.lang.IllegalStateException: No behavior listener found with behaviorId 0

I suppose that Wicket postpones the second request and when it is exectured
later on, the behaviour has already been removed.

What is the best way to have a JS behaviour executed only once?

Thanks in advance,
Kaspar

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to