Primefaces Dialog,没有显示

时间:2013-10-29 17:59:50

标签: primefaces dialog show

我知道很多人已经问过,但我找不到解决问题的方法。代码编译但对话框没有显示。

寻求帮助!

<h:form id="form">  

        <p:growl id="msgs" showDetail="true" />  

        <p:dataTable id="cars" var="car" value="#{sectionCtrl.tousAnime}">  

            <p:column headerText="Model" style="width:24%">  
                <h:outputText value="#{car.nom}" />  
            </p:column>  

            <p:column headerText="Year" style="width:24%">  
                <h:outputText value="#{car.prenom}" />  
            </p:column>  

            <p:column style="width:4%">  
                <p:commandButton id="selectButton" update=":form:display" oncomplete="PF('carDialog').show()" icon="ui-icon-search" title="View">  
                    <f:setPropertyActionListener value="#{car}" target="#{sectionCtrl.unAnime}" />  
                </p:commandButton>  
            </p:column>  

        </p:dataTable>  

        <p:dialog header="Car Detail" widgetVar="carDialog" resizable="false" id="carDlg"  
                  showEffect="fade" hideEffect="explode" modal="true" dynamic="true">  

            <h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">  

                <h:outputText value="Model:" />  
                <h:outputText value="#{sectionCtrl.unAnime.nom}" style="font-weight:bold"/>  

            </h:panelGrid>  

        </p:dialog>  

    </h:form>  

这是我的豆子:

@Named(value = "sectionCtrl")

@SessionScoped public class SectionController实现Serializable {

@EJB
private SectionEJB sectionEJB;
@EJB
private MembreEJB membrEJB;

private Collection<Anime> tousAnime;

private Anime selectedAnime;
private String erreur;

private boolean affPanel;

private Anime animeACreer;

private Membre membreConnecte;

public String goAjouterAnime(){
    Anime a = sectionEJB.inscrire(animeACreer, membreConnecte);
    if(a==null){
        erreur = "Anime non ajouté";
    }
    erreur = null;
    animeACreer = null;
    return "GOAJOUTERANIME";
}

public String affPanel(boolean affPanel){
    this.affPanel = affPanel;
    return "AFFPANEL";
}

public String goGerer(int idMembre) {
    membreConnecte = membrEJB.identifier(idMembre);
    if (membreConnecte.getIdmembre() == membreConnecte.getStaff().getIdchefsection().getIdmembre()) {
        tousAnime = sectionEJB.allAnime(membreConnecte.getStaff().getIdstaff());
        erreur = null;
        return "GOGERER";
    }
    erreur = "Vous n'êtes pas chef de section, vous ne pouvez donc pas gérer les membres.";
    return "GOSECTION";
}


/**
 * Get the value of erreur
 *
 * @return the value of erreur
 */
public String getErreur() {
    return erreur;
}

/**
 * Set the value of erreur
 *
 * @param erreur new value of erreur
 */
public void setErreur(String erreur) {
    this.erreur = erreur;
}

/**
 * Get the value of tousAnime
 *
 * @return the value of tousAnime
 */
public Collection<Anime> getTousAnime() {
    return tousAnime;
}

/**
 * Set the value of tousAnime
 *
 * @param tousAnime new value of tousAnime
 */
public void setTousAnime(Collection<Anime> tousAnime) {
    this.tousAnime = tousAnime;
}

    /**
 * Get the value of unAnime
 *
 * @return the value of unAnime
 */
public Anime getSelectedAnime() {
    return selectedAnime;
}

/**
 * Set the value of unAnime
 *
 * @param unAnime new value of unAnime
 */
public void setSelectedAnime(Anime unAnime) {
    this.selectedAnime = unAnime;
}

    /**
 * Get the value of affPanel
 *
 * @return the value of affPanel
 */
public boolean isAffPanel() {
    return affPanel;
}

/**
 * Set the value of affPanel
 *
 * @param affPanel new value of affPanel
 */
public void setAffPanel(boolean affPanel) {
    this.affPanel = affPanel;
}

/**
 * Get the value of animeACreer
 *
 * @return the value of animeACreer
 */
public Anime getAnimeACreer() {
    return animeACreer;
}

/**
 * Set the value of animeACreer
 *
 * @param animeACreer new value of animeACreer
 */
public void setAnimeACreer(Anime animeACreer) {
    this.animeACreer = animeACreer;
}

}

1 个答案:

答案 0 :(得分:0)

PF('carDialog').show()仅适用于Primefaces 4.请改用carDialog.show()