Storing clicked menuItem from a V2 menuBar

Is there a way to store the clicked menuItem index of a clicked menuItem on a menuBar component?

I need to be able to create a previous and next button that relates to the currently clicked menuItem of a menuBar. My menuBar dataprovider is an XML file. So I’m thinking it should be possible to show the nextSibling or previousSibling according to the clicked menuItem of a menuBar