문제

How the popup panel work when on the mouse enter it will show and on leaving it will hidden and on showing of popup panel when the cursor move inside the popup it will stay over.

도움이 되었습니까?

해결책

I am doing this but it is having problem that the popup is not staying....any idea?

  Event.addNativePreviewHandler(new NativePreviewHandler() {
      public void onPreviewNativeEvent(final NativePreviewEvent event) {
        final int eventType = event.getTypeInt();
        switch (eventType) {

          case Event.ONMOUSEOUT:
          {
                        System.out.println("hello");
                        popup.setVisible(false);
           break;
          }
          case Event.ONMOUSEOVER:
          {
              l1.addMouseOverHandler(new MouseOverHandler()
              {
                  public void onMouseOver(MouseOverEvent event)
                  {
              popup.show();
              popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() 
                {
                    public void setPosition(int offsetWidth, int offsetHeight) 
                        {
                            int left = (Window.getClientWidth() - offsetWidth) / 24;
                            int top = (Window.getClientHeight() - offsetHeight) / 5;
                            popup.setPopupPosition(left, top);
                        }
                });
              MouseOutHandler handler1=new MouseOutHandler()
                {
                    public void onMouseOut(MouseOutEvent event)
                    {
                        System.out.println("welcome2");
                        popup.setVisible(false);

                    }
                };
                popup.addHandler(handler1,MouseOutEvent.getType());
               popup.sinkEvents(Event.ONMOUSEOUT); 
               event.preventDefault();
                  }
              });
            break;
          }
          default: 

        }
      }
    });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top