Announcement

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

    Smart GWT best practices

    Hi there! I'm a starter at both GWT and SmartGWT applications.

    We are designing a new web app, and from what I've read so far from GWT, we would do something like this:

    A top panel holds the menu
    A bottom (FlowPanel) the contents

    Every time the user selects a menu, a widget would be set on the panel with
    panel.add(widget).

    We are creating our widgets as Composites with several GWT components.

    Since we decided move to SmartGWT, I wonder if the same approach is valid:

    A VerticalLayout with a bottom member being a freeform layout that gets drawn every time the users clicks on an icon.

    Also, is it possible to use GWT 2.0 Composites?

    Regards

    #2
    Basically same principle, it is a trade off as always, but for things that are re-used best to always be part of the panel (addMember()) and then use show()/hide(), for other things can always recreate/destroy() as needed. Only difference is the API of course, Layout.addMember() is what you use generally for SmartGWT. You can mix GWT and SmartGWT yes but be careful, best if the 'leaf' element or childless element is always of GWT type and parents are of SmartGWT. Best place to start is the Showcase.

    Comment


      #3
      Thanks, I was doing a clean on my container, but I guess would be better to just show hide

      Code:
      private void addCanvas(Canvas canvas){
      		for(Canvas c : container.getChildren()){
      			container.removeChild(c);
      		}
      		container.addMember(canvas);
      	}

      Comment


        #4
        If you reuse the components yes, plus removeChild() and removeMember() are two very different methods. I'd recommend sticking with addMember()/removeMember() functions for adding and removing panels.

        Comment

        Working...
        X