RequestContext.getCurrentInstance().openDialog() não funciona

Olá pessoal alguém pode me ajudar com relação a um Dialog Framework do primefaces?

Não está abrindo, segue o código:

BEAN:
    @ManagedBean(name = "selectPessoaView")
    @ViewScoped
    public class SelectPessoaView implements Serializable {

    public void choosePessoa() {
        Map<String, Object> options = new HashMap<>();
        options.put("resizable", false);
        options.put("draggable", false);
        options.put("modal", true);
        options.put("widgetVar", "selectTable");
        options.put("id", "selectTable");
        RequestContext.getCurrentInstance().openDialog("selectTable", options, null);
    }

    public void onPessoaChosen(SelectEvent event) {
        SinanNotificacao p = (SinanNotificacao) event.getObject();
        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Cartão SUS", "número:" + p.getNu_cartao_sus());

        FacesContext.getCurrentInstance().addMessage(null, message);
    }
}

JSF:

<p:commandButton icon="fa fa-fw fa-search" actionListener="#{selectPessoaView.choosePessoa}">
     <p:ajax event="dialogReturn" listener="#{selectPessoaView.onPessoaChosen}" update="nu_cartao_sus,mensagem" />
</p:commandButton>

selectTable.xhtml

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>Pessoas</title>
        <style type="text/css">
            .ui-widget {
                font-size: 90%;
            }
        </style>
    </h:head>

    <h:body>
        <h:form>
            <p:dataTable value="#{sinanNotificacaoBean.list}" var="x">
                <p:column headerText="Id">
                    <h:outputText value="#{x.nu_notificacao}" />
                </p:column>

                <p:column headerText="Nome">
                    <h:outputText value="#{x.no_nome_paciente}" />
                </p:column>

                <p:column headerText="SUS">
                    <h:outputText value="#{x.nu_cartao_sus}" />
                </p:column>

                <p:column headerText="Nascimento">
                    <h:outputText value="#{x.dt_nascimento}" />
                </p:column>

                <p:column style="width:32px;text-align: center">
                    <p:commandButton icon="ui-icon-search" actionListener="#{sinanNotificacaoBean.selectPessoaFromDialog(x)}" />
                </p:column>
            </p:dataTable>
        </h:form>
    </h:body>
</html>

simlplesmente não abre. Nada acontece quando clico no botão acima. Estou usando primefaces 6.0.

Valeu

Resolvi da seguinte forma: Basta criar um faces-config no WEB-INF com o seguinte código:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
    <application>
        <action-listener>org.primefaces.application.DialogActionListener</action-listener>
        <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
        <view-handler>org.primefaces.application.DialogViewHandler</view-handler>
    </application>
</faces-config>
1 curtida