The following code isn't working (as it also doesn't work for DefaultMenuItem): Using Primefaces 5.3 and setting the model attribute of a TieredMenu.
DefaultSubMenu submenuModulo = new DefaultSubMenu();
submenuModulo.setId(sisModulo.getCodModulo());
submenuModulo.setLabel("#{pptMenu." + sisModulo.getDesModulo() + "}");
submenuModulo.setIcon(sisModulo.getDesIcone());
submenuModulo.setExpanded(false);
I need to use EL expression when setting the label, so the label is translate when there is a language switch. The menu is build in a static way, so I don't have to read it from the database again. I don't want to recreate the menu when the language changes.
EDIT: This question has nothing to do with the question marked as duplicate. I found the answer myself, but I can't post the answer. I created a custom TieredMenuRenderer renderer that accepts EL in Label of DefaultSubMenu and in the value of DefaultMenuItem. (as it should be by default)