Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 页面加载到jsf2时显示咆哮_Jsf 2_Primefaces_Load_Growl - Fatal编程技术网

Jsf 2 页面加载到jsf2时显示咆哮

Jsf 2 页面加载到jsf2时显示咆哮,jsf-2,primefaces,load,growl,Jsf 2,Primefaces,Load,Growl,我有一个命令按钮: <p:commandButton value="Enregistrer" action="#{reglementClientMB.ajouter}" process="@this @form" update="@form" > <f:setPropertyActionListener target="#{reglementClientMB.est_ajouter}" value="false" /&g

我有一个命令按钮:

    <p:commandButton value="Enregistrer" action="#{reglementClientMB.ajouter}" 
            process="@this @form" update="@form" >
            <f:setPropertyActionListener target="#{reglementClientMB.est_ajouter}" value="false" />
            </p:commandButton>
我怎样才能做到这一点


提前感谢

如果在第一次构造bean之前呈现了
,那么bean的构造函数可能太晚了。例如

<p:growl />
...
<h:outputText value="#{bean.something}" />

我通过将消息/咆哮放在模板代码的末尾解决了这个问题。。这是一种好的/可接受的做法吗?还是我会在这方面遇到问题?@Jenson:正如所回答的,您需要确保在呈现目标消息组件之前添加消息。你选择哪条路取决于你自己。
<p:growl />
...
<h:outputText value="#{bean.something}" />
<h:outputText value="#{bean.something}" />
...
<p:growl />
<f:event type="preRenderView" listener="#{bean.init}" />
public void init() {
    // Add the desired message here.
}