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
    Ext User
    Join Date
    Mar 2010
    Posts
    3
    Vote Rating
    0
    devalx is on a distinguished road

      0  

    Question Can't add new Portlets after portal.removeAll()

    Can't add new Portlets after portal.removeAll()


    Hi there,
    i have the problem that after i call portal.removeAll(), i cannot add any new portlets. Am i missing some method-call??

    Code:
    public class PortalDemo extends ContentPanel {
        private int i = 0;
        private Portal portal;
    
        @Override
        protected void onRender(Element parent, int index) {
            super.onRender(parent, index);
            refresh();
        }
    
        public PortalDemo() {
            setLayout(new FitLayout());
            setHeaderVisible(false);
    
            portal = new Portal(3);
            portal.setBorders(true);
            portal.setStyleAttribute("backgroundColor", "white");
            portal.setColumnWidth(0, .33);
            portal.setColumnWidth(1, .33);
            portal.setColumnWidth(2, .33);
            add(portal);
        }
    
        private void addPortal(ModelData data) {
            final Portlet portlet = new Portlet();
            portlet.setHeading(...);
            portlet.setLayoutOnChange(true);
            portlet.setTitle(...);
            portlet.setLayout(new FitLayout());
            portlet.add(...);
            portlet.setHeight(250);
            portlet.setCollapsible(true);
            portlet.setAnimCollapse(false);
    
            portal.add(portlet, i++ % 3);
            layout();
        }
    
        private void refresh() {
           {{RPC.AsyncCallback}}() {
    
                public void onFailure(Throwable caught) {
                }
    
                public void onSuccess(final List<ModalData> result) {
    //                portal.removeAll();
                    i = 0;
                    for ModelData f : result) {
                        addPortal(f);
                    }
                }
            });
        }
    }
    Code works fine if that protal.removeAll() line is commented out (but i get duplicates then ofc on refresh) but if that line is in there, no portlet add is working.

  2. #2
    Sencha User
    Join Date
    May 2011
    Posts
    1
    Vote Rating
    0
    asquared is on a distinguished road

      0  

    Default


    I suspect that this occurs because the portal doesn't directly contain its portlets. The portal contains layoutContainers that represent the portal's columns, which then contain portlets. I think the removeAll() call actually removes those columns, thus rendering the portal completely unuseable. I'm still trying to figure out the "proper" way to remove the portlets, however...

    After some trial and error, the following code snippet seems to work in place of the removeAll() command:

    Code:
    for (LayoutContainer column : portal.getItems()) {
                column.removeAll();
            }
    Last edited by asquared; 14 May 2012 at 7:12 AM. Reason: Added more complete answer

Thread Participants: 1