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

    Adding an existing member to a layout

    Hi, haven't done this in a long while, so hoping i can ask a pretty simple question.

    If you don't know if you've previously added a member to a layout, are there any issues/potential side effects with adding a member to the same layout again? I looked at the layout docs but didn't find any mention of it.


    I don't think there are any issues, but you may call Layout.hasMember


      It's not 100% clear from your question what you're trying to achieve here, but to talk in general terms - when you create a canvas in SmartGWT it can only actually be drawn in one place on the page. If you add it to a layout as a member it will be rendered inside that layout in the appropriate position with the appropriate size. If you call the "addMember()" method to add that same canvas to the same layout in a different position, it will be moved to the new specified position. If you add the canvas as a member to another layout, it will be removed from the first layout and added to the other layout. You can of course add as many members to a layout as you need.

      Hope this helps


        Hi thanks for reaponse. I usually use layout.hasmember as claudio mentioned. I was just wondering if there is any issues/side effects with adding the same layuut object as a member in to the exact same layout, in the exact same place, more than once. Perhaps it's redrawn unneccesarily, causing flickers or something. I was just wondering, basically. We have a lot of places where we do a lot of juggling of different canvases, showing hiding etc. so was just thinking about ways to simplify the logic. Cheers