Announcement

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

    Best practice: MenuItem identification

    Hi Isomorphic,

    it seems that MenuItems do not have the concept of an ID, but only a title.
    The title is i18n'd for me with normal GWT i18n.
    This makes switching though the menuclick impossible as "case expressions must be constant expressions" (Java error message).
    Is there some ID I could use instead like you have it for e.g. TabSet + Tab?
    Or should I assign one using setAttribute("myID", "abc")/getAttribute("myID")?

    Thank you & Best regards
    Blama

    #2
    As MenuItem extends ListGridRecord, you can set an attribute (.setAttribute()) with your ID. I set normally an enumeration, which works with your switch.

    Comment


      #3
      Hi edulid,

      thank you, that is what I am trying right now. I did not notice the "extends ListGridRecord" so far, but this explains why Menus can be loaded from a DS.

      Best regards
      Blama

      Comment

      Working...
      X