Problem using Dialog Prime Faces

1

Good evening, I'm developing a simple CRUD using JSF, but I'm having trouble using the Prime Faces functions. I want to do insertions, changes and deletions through Dialogs ... but until now I could not use the functions ... the dialog does not appear on the screen. apparently the Bean methods are not working. I can access the Bean methods and apparently I was able to map the id of the form that is within the dialog , in the update attribute. But I could not access the dialog using oncomplete="dialogGerLivro.show()"

Bean Class

@Named
@SessionScoped
public class ListaController implements Serializable {

@Inject
private ListaDAO dao;
private Lista lista;

public Lista getLista() {
    if (lista == null) {
        lista = new Lista();
    }
    return lista;
}

public void setLista(Lista lista) {
    this.lista = lista;
}

public void adicionar() {
    lista = new Lista();
}

Page .xhtml

 <h:form id="formLista">

        <p:commandButton value="Adicionar Lista" actionListener="#{listaController.adicionar()}" update=":formLista:formDados:painelDadosLista" oncomplete="dialogGerLivro.show()"/>

      //DataTable

        <p:dialog header="Gerencia de Livro" widgetVar="dialogGerLivro">
            <h:form id="formDados">
                <h:panelGrid  id="painelDadosLista" columns="2" style="margin-bottom:10px">

                    <h:outputLabel for="titulo" value="Título:" />
                    <h:inputText id="titulo" value="#{listaController.lista.titulo}"/>


                </h:panelGrid>
            </h:form>
        </p:dialog>
    </h:form>
    
asked by anonymous 07.07.2014 / 02:23

1 answer

3

Starting with version 4.1 of Primefaces you need to use the following syntax: PF('widgetVar').show() , where widgetVar is the name of the dialog you want to display.

    
07.07.2014 / 13:36