1. #1
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    24
    Vote Rating
    1
    |ZUTI| is on a distinguished road

      0  

    Arrow GXT 2.2.5 and Border Layout Collapse problem - simple code included

    GXT 2.2.5 and Border Layout Collapse problem - simple code included


    Hey.

    With GXT 2.2.5 I have annoying problem. Best to show the simple code:
    Code:
    public class AATestWindow extends Window
    {
        
        public AATestWindow()
        {
            setSize(400, 200);
            BorderLayout layout = new BorderLayout();
            setLayout(layout);
            
            ContentPanel cntntpnlCenter = new ContentPanel();
            cntntpnlCenter.setHeading("Center");
            add(cntntpnlCenter, new BorderLayoutData(LayoutRegion.CENTER));
            
            ContentPanel cntntpnlSouth = new ContentPanel();
            cntntpnlSouth.setHeading("South");
            cntntpnlSouth.setCollapsible(true);
            add(cntntpnlSouth, new BorderLayoutData(LayoutRegion.SOUTH, 50.0f));
            
            layout.collapse(LayoutRegion.SOUTH);
        }
    }
    The point is in the last line where I collapse south region so that when the application is started that region is collapsed. Well, with 2.2.5 GXT the region is also invisible, not only collapsed. Not sure what exactly the problem could be but with old release, the above code worked OK.

    Is there a new way to implement this? Calling collapse() on south panel does not do what I need to be done.

    Thanks.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Code:
    Index: user/src/com/extjs/gxt/ui/client/widget/layout/BorderLayout.java===================================================================
    --- user/src/com/extjs/gxt/ui/client/widget/layout/BorderLayout.java	(revision 2463)
    +++ user/src/com/extjs/gxt/ui/client/widget/layout/BorderLayout.java	(working copy)
    @@ -537,6 +537,10 @@
         }
       }
     
    +  private native boolean isComponentHidden(Component c) /*-{
    +		return c.@com.extjs.gxt.ui.client.widget.Component::hidden;
    +  }-*/;
    +
       private void onCollapse(ContentPanel panel) {
         if (panel.getParent() == layoutContainer && fireEvent(Events.BeforeCollapse, createBorderLaoutEvent(panel))) {
     
    @@ -545,7 +549,7 @@
           boolean layoutOnChange = layoutContainer.isLayoutOnChange();
           setLayoutOnChange(layoutContainer, false);
     
    -      boolean isVisible = panel.isVisible();
    +      boolean isVisible = !isComponentHidden(panel);
     
           layoutContainer.remove(panel);
           Map<String, Object> st = panel.getState();
    @@ -579,7 +583,7 @@
           setLayoutOnChange(layoutContainer, false);
           cp.setExpanded(false);
           setCollapsed(panel, false);
    -      boolean isVisible = cp.isVisible();
    +      boolean isVisible = !isComponentHidden(cp);
     
           Map<String, Object> st = panel.getState();
           st.remove("collapsed");

    This patch should fix it. One note to you code, you should set the BorderLayoutData to be collapsible, not the contentpanel.

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    24
    Vote Rating
    1
    |ZUTI| is on a distinguished road

      0  

    Default


    Hey Sven.

    Thanks for fast heads up. So, where do I paste this code? Directly to the BorderLayour java file?

    Thanks again.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi