Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    If you don't want a submenu at all, just omit the submenu entirely rather than provide a submenu with empty data.

    Comment


      #17
      My problem is these menu data are dynamically hidden/added. So I don't really know at rendering time which menu items will be displayed. I've tried to set data to null but I get an NPE as soon as I try to click on the menu. I agree it is completely useless to have a submenu with no data but I'd rather have the submenu there and do nothing when the user clicks.

      Perhaps I can hide the submenu instead of it does not have any data?

      Comment


        #18
        Well, you're basically asking how to not show a submenu when you've explicitly provided a submenu - restructuring your code so you can avoid this is the right solution, if you want a hack, maybe remove the submenu attribute if you later detect there's no data.

        Comment

        Working...
        X