Creating multiple global alarms

I am trying to find a hopefully easy way to display potentially multiple alarms globally on my screen and wanted to see if anyone had ideas or advice to go about it. I found a simple example from the Nextion blog but my issue becomes if multiple sensors have an error at once how can I cycle through them to look at them. I provided an example of just a single alarm working, my ideal usecase would be to have Flowmeter1 display and then a touch event to pass on to say FlowmeterX has an issue and so on.

From the page ‘popup’ that displays the error message

if(popup.style.val==0)
{
  popup.head.txt="Information"
  popup.head.pco=WHITE
}else if(popup.style.val==1)
{
  popup.head.txt="Warning"
  popup.head.pco=YELLOW
  popup.content.bco=YELLOW
}else if(popup.style.val==2)
{
  popup.head.txt="Error"
  popup.head.pco=RED
  popup.content.bco=RED
}else
{
  //emergency reset and exit
  popup.style.val=-1
  page popup.pageloadid.val
}


Simple test case


if(page1.flow1.val==1)
{
  popup.content.txt="Flowmeter 1 out of range!!"
  popup.style.val=2
  page popup
}

Separate the if statement into multiple if’s so each error is evaluated.