1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    57
    Vote Rating
    0
    andreiastra is on a distinguished road

      0  

    Default NullPointerException for Menu.hide()

    NullPointerException for Menu.hide()


    Hi,

    I'm getting the exception:

    java.lang.NullPointerException: null at com.extjs.gxt.ui.client.widget.menu.Menu.hide(Menu.java:284) at com.extjs.gxt.ui.client.widget.menu.Item.handleClick(Item.java:162) at com.extjs.gxt.ui.client.widget.menu.Item.onClick(Item.java:172) at com.extjs.gxt.ui.client.widget.menu.CheckMenuItem.onClick(CheckMenuItem.java:199) at com.extjs.gxt.ui.client.widget.menu.Menu.onClick(Menu.java:684)
    .....

    when I click on a menu item:

    menuItem.JPG

    I would blame it on my coding, however the exceptions occurs in IE, but not in Firefox.

    I can see in the debugger that the null pointer in Menu.java:284:

    parentItem.parentMenu.hide(true);

    because of parentMenu is null. However, parentItem.parent is not null and is of type Menu.

    I'm using GXT 2.2.1 and GWT 2.1.0.

    What can be the reason for it not to work in IE, but in FF?

    Thank you,

    Andrei

  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


    The easiest would be if you would post your code that shows the issue in a small standalone testcase implementing EntryPoint

  3. #3
    Sencha User
    Join Date
    Oct 2007
    Posts
    585
    Vote Rating
    0
    bhomass is on a distinguished road

      0  

    Default


    I am using gxt2.2.5-gwt22.

    This is definitely a bug. In Item class, there is a protected parentMenu field, but no where is this field settable. When a menu adds an menuItem, the menuItem does not automatically add the parentMenu. Even if you want to do it explicitly, there is no setter to use.

    the work around is to subclass MenuItem and add setParentMenu(parentMenu) method.

Similar Threads

  1. Replies: 3
    Last Post: 6 Sep 2011, 7:26 AM
  2. Button menu-active style no longer added/removed on menu show/hide
    By wdrwilson in forum Ext GWT: Help & Discussion (1.x)
    Replies: 1
    Last Post: 24 Nov 2008, 6:11 AM
  3. Button with Menu (menu auto show/hide)
    By fafhrd in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 23 Mar 2007, 12:19 AM

Thread Participants: 2

Tags for this Thread

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