Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    isHidden() after resize

    Hello,

    I have a vertical layout with 2 child canvases. I added a resizer between them, and I need to know if user clicked on "collapse" or "resize" button (and made one of the canvases or its children hidden).

    I tried to check it by childCanvas.getHeight(), childCanvas.isVisible() inside resizedHandler, but these attribute are unchanged.

    How can I get this information?



    thank you

    p.s. I'm using smartGWT 2-1
    Attached Files
    Last edited by la123; 27 Jun 2010, 23:38.

    #2
    Add a resizedHandler to the parent (vertical layout), then inside that handler check to see if childCanvas.isVisible(). That should work.

    Comment


      #3
      Thanks so much, it worked.
      If someone needs it, here is the code:

      Code:
              Layout container = new VLayout();
      
              final Button resizableBtn = new Button("hiding button");
              resizableBtn.setHeight(100);
      
              container.addResizedHandler(new ResizedHandler() {
                  public void onResized(ResizedEvent event) {
                      SC.say(""+resizableBtn.isVisible());
                  }
              });
      
              Button expandableBtn = new Button("expandable button");
              expandableBtn.setHeight(100);
              expandableBtn.setResizeBarTarget("next");
              expandableBtn.setShowResizeBar(true);
      
              container.addMember(expandableBtn);
              container.addMember(resizableBtn);
              container.draw();

      Comment

      Working...
      X