On 10/23/2009 09:59 PM, prairie_kids wrote:
> Hi - thanks for the reply. I already was using FitLayout.
>
> Another thing, it would be nice to be able to create and destroy a
> Viewport so that I could dynamically swap my view (Panel).
>
> If I do away with using Viewport, what do I need to handle/implement
> in order to have my parent Panel resize to the browser? just using
> FitLayout I assume won't be enough?
>    
Just create a new Viewport on the parentPanel when needed

e.g.

public class Main implements EntryPoint {
    static final Panel extRootPanel = new Panel();
     static Panel activeElement = new Panel();

     public void onModuleLoad() {
        extRootPanel.setId("extrootpanel");
         extRootPanel.setBorder(false);
         extRootPanel.setPaddings(15);
         extRootPanel.setLayout(new FitLayout());
          activeElement.setAutoScroll(true);
           activeElement.setLayout(new FitLayout());
         extRootPanel.add(activeElement);
        new Viewport(extRootPanel);
   }

public static void setActiveElement(Widget w) {
         activeElement.clear();
         activeElement.add(w);
         new Viewport(extRootPanel);
     }
...

}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to