Trinidad has a navigation framework for page navigation. The framework is based on the assumption that the project is organized around a hierarchical navigation structure. Let’s explore the possibilities of this navigation framework by adding some navigation to our MIAS example program. Let’s create a super simple hierarchical structure like the following:
Home Start.jspx +- Kids overview Kids.jspx | +- Edit kid EditKid.jspx +- Employee overview Employees.jspx +- Edit employee EditEmployee.jspx
The Trinidad navigation framework lets us define this structure in an XML file; let’s call it menu.xml
. For the structure proposed before, the contents of that file should look as follows:
<?xml version="1.0" encoding="UTF-8"?> <menu xmlns="http://myfaces.apache.org/trinidad/menu" resourceBundle="inc.monsters.mias.Messages" var="msg"> <itemNode id="menu0" focusViewId="/Start.xhtml" label="#{msg.home}" action...