I have a menubar with several options and within one, that is, in a submenu I want to send a report, which I already have but it is shown through a button, and I do not want it to be that way, I want the choose in the submenu in automatic show the report
This is my code where I have the menu
<p:menuitem value="Reporte" url="${pageContext.request.contextPath}/jsf/reporte.xhtml?faces-redirect=true" />
and this is the code of the page that shows the report
<h:form>
<p:commandButton value="Generar Reporte" update="@form" actionListener="#{SctBienComponent.generateReport}" />
<div class="column-center">
<p:media cache="false" rendered="#{SctBienComponent.media ne null}" width="900" height="600" value="#{SctBienComponent.media}" player="pdf"/>
</div>
I just want to remove the button, and that in automatic without pressing anything, show the report