Announcement

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

    How to not show Tabs on TabSet (ala Swing Card Layout)

    I am trying to do the equivalent of swing CardLayout where multiple panels are stacked on top of each other like a deck of cards and api allows setting which card is displayed on top.

    The closest I have found in the layer sample.

    Is there a better way or shall I stick to the layer sample?

    #2
    Hi Guys, This is probably a quick and easy answer for the experts. Please respond even if it is just a 1 liner response. Thanks.

    Comment


      #3
      I'm not sure to understand what you want to do.

      But to have multiple layouts displayed one by one according to user action you just have to create your layouts and use the show() and hide() methods.

      It is not ok for you ?

      Respect

      Comment


        #4
        Yes that would be OK. The problem is that there are more than one way to do CardLayout the way Swing does it. I was hoping someone could share the best way among the many.

        The current approach I am trying is to implement is shown in code below. It is not fully tested yet:

        Code:
        public class CardLayoutCanvas extends Canvas {
        
            HashMap<Object, Canvas> cards = new HashMap<Object, Canvas>();
        
            public void addCard(Object key, Canvas card) {
                card.setWidth100();
                card.setHeight100();
                card.setPageLeft(0);
                card.setPageTop(0);
                this.addChild(card);
                cards.put(key, card);
            }
        
            public void showCard(Object key) {
                Canvas card = cards.get(key);
                card.bringToFront();
            }
        }

        Comment


          #5
          I just added The CardLayoutCanvas class to svn repo for the new smartgwt-ext project:

          http://code.google.com/p/smartgwt-extensions (home)
          http://code.google.com/p/smartgwt-extensions/source/checkout (svn instructions)

          An example will follow soon. Thanks.

          Comment

          Working...
          X