Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    0
    CHEM_Eugene is on a distinguished road

      0  

    Default Many Viewports in application

    Many Viewports in application


    Is it possible to use Viewport many times in one application? I use BorderLayout with Center and South areas. Center area's content is dynamically changed by other content during page swithing. This BorderLayout is in Viewport.
    There are another pages which require own BorderLayout markup. So we have nested border layouts. Problem consists in that nested BorderLayout's areas should take all available height of parent Center area. But it is not.
    Could I use nested Viewport for my purposes?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Its certainly possible, but it doesn't make much sense at all. The purpose of the Viewport is to take all available space in the browser - having more than one will mean that whichever is on top will completely cover anything below it.

    Very rarely does it make sense to have more than one. Use one when you add the root of your layout tree to the RootPanel, and find some other way to describe the layout at a lower level.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    0
    CHEM_Eugene is on a distinguished road

      0  

    Default


    It appears I reveal the root cause of my problems. Instead of using nested Viewport we can use forceLayout() method. Look at my test case. Try to comment forceLayout invokation and see result.
    Is it my solution correct?

    Code:
    package ru.dpop.mygwttestcase.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.sencha.gxt.core.client.util.Margins;
    import com.sencha.gxt.widget.core.client.ContentPanel;
    import com.sencha.gxt.widget.core.client.button.TextButton;
    import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
    import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
    import com.sencha.gxt.widget.core.client.container.MarginData;
    import com.sencha.gxt.widget.core.client.container.SimpleContainer;
    import com.sencha.gxt.widget.core.client.container.Viewport;
    import com.sencha.gxt.widget.core.client.event.SelectEvent;
    import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
    import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
    
    public class LayoutExample implements EntryPoint {
    
        private Viewport viewport;
        
        private BorderLayoutContainer container;
        
        private MarginData centerData;
        
        private ContentPanel mainContent;
        
        private ToolBar navigationLinks;
        
        public LayoutExample() {
            viewport = new Viewport();
            container = new BorderLayoutContainer();
            mainContent = new ContentPanel() {
                @Override
                protected void onAfterFirstAttach() {
                    super.onAfterFirstAttach();
                    
                    changeMainContent();
                }
            };
            mainContent.setHeaderVisible(false);
    
            navigationLinks = new ToolBar();
    
            centerData = new MarginData(5, 5, 0, 5);
    
            final BorderLayoutData southData = new BorderLayoutData(50);
            southData.setMargins(new Margins(5));
            southData.setCollapsible(true);
            southData.setCollapseMini(true);
    
            final ContentPanel footer = new ContentPanel();
            TextButton changeButton = new TextButton("Change center content", new SelectHandler() {
                
                @Override
                public void onSelect(SelectEvent event) {
                    changeMainContent();
                    mainContent.forceLayout();
                }
            });
            navigationLinks.add(changeButton);
            footer.setHeaderVisible(false);
            footer.setWidget(navigationLinks);
            container.setCenterWidget(mainContent, centerData);
            container.setSouthWidget(footer, southData);
            viewport.add(container);
        }
        
        @Override
        public void onModuleLoad() {
            RootPanel.get().add(viewport);
        }
        
        private void changeMainContent() {
            SimpleContainer container = new SimpleContainer();
            BorderLayoutContainer borderLayoutContainer = new BorderLayoutContainer();
            
            BorderLayoutData northData = new BorderLayoutData(100);
            BorderLayoutData westData = new BorderLayoutData(150);
            MarginData centerData = new MarginData();
            
            borderLayoutContainer.setNorthWidget(new ContentPanel(), northData);
            borderLayoutContainer.setWestWidget(new ContentPanel(), westData);
            borderLayoutContainer.setCenterWidget(new ContentPanel(), centerData);
            
            container.setWidget(borderLayoutContainer);
            
            mainContent.setWidget(container);
        }
    
    }

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Using the forceLayout() method is often correct when you modify a layout in some way. By default, the layout system doesn't update everything when something changes. This is to allow for better performance in a case like adding five new things to a parent container - you don't want to re-run the layout five times. Instead, you should make the desired changes, and then force a layout of the parent that was changed to update sizes and positions.

Thread Participants: 1

Tags for this Thread