Pessoal, fiz um botao, e neste botao gostaria de ao clicar no botao, abrisse um modal.
O problema que não entra nem no meu metodo.
Obs. gostaria de abrir o modal no meu bean
<h:form id="form">
<h:panelGrid columns="1" cellpadding="3" style="text-align:center;">
<h:panelGroup >
<p:commandButton value="Gravar" actionListener="#{pedidoControle.pergunta(event)}" style="height: 35px; font-size: 12px"/>
</h:panelGroup>
</h:panelGrid>
<p:dialog header="Autenticando Usuário" widgetVar="dialog"
height="40"
width="240" >
<br/>
<h:panelGrid columns="2" cellpadding="3">
<h:outputText value="11112"/>
</h:panelGrid>
</p:dialog>
</h:form>
@ManagedBean(name = "pedidoControle")
@ViewScoped
public class PedidoControle implements Serializable {
public void pergunta(javax.faces.event.ActionEvent event) {
System.out.print("fdsafsdfdsa");
org.primefaces.context.RequestContext.getCurrentInstance().execute("dialog.show();");
}