I created this button and want it to call the function in action=""
while also redirecting to a new page (displayed in the comment).
<p:commandButton icon="pi pi-pencil" value="Edit"
styleClass="rounded-button ui-button-primary"
action="#{notificationService.editNotificationInList(notification)}"/><!-- outcome="/create"/-->
So far I know I can use <p:button>
to only redirect (without executing any functions).