[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
popup menu crashes with empty menu item list  XML
Forum Index -> Development
Author Message
heyl

Power User

Joined: 10/01/2008 09:41:55
Messages: 267
Location: Ettlingen
Offline

Hi Björn,

the popup menu crashes when the list of menu items is empty.
The attached logfile is missleading because the jsp is correct (the designer can read it and it works if there are menu items added).

<t:popupmenu id="STATUS_COMMANDS" componentbinding="#{d.cardproductionList.commandPopup}" rendered="#{d.cardproductionList.showCommandPopup}" />

You find the server side code in the second attachement.
I try to render the popup menu only if the children list contains menu items.

Frauke

 Filename EmptyPopupMenu.txt [Disk] Download
 Description
 Filesize 3 Kbytes
 Downloaded:  452 time(s)

 Filename ServerCode.txt [Disk] Download
 Description
 Filesize 881 bytes
 Downloaded:  441 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi Frauke,

I tested - no problem on my side:

Code:
     public void setMenu(POPUPMENUComponent value) 
     { 
         if (m_menu == value)
             return;
         m_menu = value; 
         m_menu.getChildren().clear();
         
         if (isMenuRendered())
         {
             MENUITEMComponentTag mict = new MENUITEMComponentTag();
             mict.setText("Menu A");
             m_menu.getChildren().add(mict.createBaseComponent());
         }
     }
     
     public boolean isMenuRendered()
     {
         return false;
     }
 


and the layout

Code:
 <t:rowbodypane id="g_5" popupmenu="TEST" >
 </t:rowbodypane>
 <t:popupmenu id="TEST" componentbinding="#{d.DynPopupMenuUI.menu}" rendered="#{d.DynPopupMenuUI.menuRendered}" />
 


Are you sure that your nice method m_rows.getSelectedItem().isLocked() is never stopping with a null pointer, e.g. if you do not have any selected items...? ;-)

Björn

Björn Müller, CaptainCasa GmbH
heyl

Power User

Joined: 10/01/2008 09:41:55
Messages: 267
Location: Ettlingen
Offline

Hi Björn,

the problem was that I used
m_menu.getChidren().isEmpty()
in the render function, and the render function was called before setMenu() and so the m_menu was null.


Thank anyway....
Frauke
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team