1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    376
    Vote Rating
    0
    zaccret is on a distinguished road

      0  

    Default [FIXED] NullPointerException in BorderLayout.onLayout

    [FIXED] NullPointerException in BorderLayout.onLayout


    I have a BorderLayouted container. It has setLayoutOnChange(true) and is already rendered so when I want to add(west,westData) I get :
    Code:
    java.lang.NullPointerException: null
        at com.extjs.gxt.ui.client.widget.layout.BorderLayout.onLayout(BorderLayout.java:108)
        at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:68)
        at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:252)
        at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:343)
        at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:235)
        at com.extjs.gxt.ui.client.widget.Container.insert(Container.java:303)
        at com.extjs.gxt.ui.client.widget.LayoutContainer.insert(LayoutContainer.java:214)
        at com.extjs.gxt.ui.client.widget.LayoutContainer.add(LayoutContainer.java:121)
    The BorderLayout.onLayout() method tries to :
    Code:
              BorderLayoutData data = (BorderLayoutData) c.getData();
              Map<String, Object> st = c.getState();
              if (st.containsKey("collapsed")) {
                switchPanels((ContentPanel) c);
              } else if (st.containsKey("size") && (!(c instanceof CollapsePanel))) {
                data.setSize((Float) st.get("size")); //line 108
              }
    but if we look at LayoutContainer.insert(Widget,int,Object) :
    Code:
      public boolean insert(Widget widget, int index, Object layoutData) {
        Component component = wrapWidget(widget);
        boolean added = super.insert(component, index);
        if (added && layoutData != null) {
          component.setData(layoutData);
        }
        return added;
      }
    we see that the data object is set AFTER the insert call so the data variable will be null in BorderLayout.onData(). I guess this could be easily fixed in LayoutContainer :
    Code:
      public boolean insert(Widget widget, int index, Object layoutData) {
        Component component = wrapWidget(widget);
        Object oldData = component.getData();
        component.setData(layoutData);
        boolean added = super.insert(component, index);
        if (!added) {
          component.setData(oldData);
        }
        return added;
      }
    or something else.

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Fix is in SVN.

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