Announcement

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

    AddChild vs AddMember

    Hi,

    I am moving from ext to smart. What is the fundamental difference between addChild and addMember for layouts. When should I use one over the other?

    #2
    correct me if i am wrong.

    addMember() will allow smartgwt to control the position of the widget added. the first widget added will appear first and last added will appear last.
    for addchild(), this probably not happening

    i normally use addmember only.

    haven't see the usefulness of using addchild. maybe someone can give some enlightenment on addchild?

    Comment


      #3
      Apart from these two, there is addItem() in few components. Would like to know about this too.

      Thanks.

      Comment


        #4
        hi

        I believe that,

        1) addItem is used with forms

        2)when addchild is used widget layout is not controlled by its container

        3)addMemeber- widget layout IS controlled by container.

        Shay

        Comment


          #5
          Originally posted by shay
          I believe that,

          1) addItem is used with forms

          2)when addchild is used widget layout is not controlled by its container

          3)addMemeber- widget layout IS controlled by container.

          Shay
          addItem with Windows, Menu's and SectionStackSection.

          Comment


            #6
            Thank you for the help

            Comment


              #7
              very stupid ... children controlled/not-controlled by the container layout ... who had this idea? All children should be CONTROLLED by the container ..if you want no control make a "hollow" layout ...

              Comment


                #8
                @scristescu a Layout can have both members, who are stacked, and normal children, which manage their own positions. Some quality time with the docs would keep you from calling things you don't understand "very stupid" :)

                Comment


                  #9
                  Originally posted by Isomorphic View Post
                  @scristescu a Layout can have both members, who are stacked, and normal children, which manage their own positions. Some quality time with the docs would keep you from calling things you don't understand "very stupid" :)
                  I agree that being judgmental is never helpful. I had the same question regarding SmartGwt.mobile. I did read the javadoc. I did not find anything of help.

                  Comment


                    #10
                    It's exactly the same distinction as in SmartGWT (normal).

                    The user_guide encourages you to read the SmartGWT docs to supplement SmartGWT.mobile's JavaDoc, because generally, where special notes do not exist in SmartGWT.mobile, the behavior is the same.

                    Comment


                      #11
                      I was confused too. And it wasted me some time on alignment as I used addChild. The method name might be more intuitive.

                      From the javadoc, addChild() is method of Canvas. Without a layout, canvas does not know where a child should be located.
                      addMember() is introduced in Layout. The layout decides a child's position.

                      Does OOP allow a subclass to hide/delete a method from the superclass? Seems no? If no, IMO, it's better to override the addChild() of Canvas.

                      So always use addMember() where possible.
                      Last edited by Leonsoft; 30 Dec 2013, 05:30.

                      Comment

                      Working...
                      X