Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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在manegbean条件下呈现弹出窗口?_Jsf_Jsf 2_Popup_Richfaces - Fatal编程技术网

JSF在manegbean条件下呈现弹出窗口?

JSF在manegbean条件下呈现弹出窗口?,jsf,jsf-2,popup,richfaces,Jsf,Jsf 2,Popup,Richfaces,当发生错误时,我用它在登录中显示消息: <a4j:region rendered="#{usuario.fail == 1}"> <div class="alert alert-danger alert-dismissable" style="width: 470px; margin: 10px auto;"> <button type="button" class="close

当发生错误时,我用它在登录中显示消息:

<a4j:region rendered="#{usuario.fail == 1}">
            <div class="alert alert-danger alert-dismissable"
                style="width: 470px; margin: 10px auto;">
                <button type="button" class="close" data-dismiss="alert"
                    aria-hidden="true">&times;</button>
                Invalid user or password.
            </div>
        </a4j:region>
:
#{rich:component('popup')}.hide()

我正在尝试这个例子:

有没有办法显示manegedbean返回的弹出窗口


提前谢谢

在创建popupPanel之前调用函数,这就是为什么会出现未定义的错误

您不必为了显示面板而渲染JS函数,只需显示面板即可:

<rich:popupPanel id="popup" show="#{usuario.fail == 1}" …>
    …
</rich:popupPanel>

请用开发者的术语而不是最终用户的术语详细说明“工作不正常”。正在呈现脚本
RichFaces.component('popup').show()
?它正在被执行?然后呢。。。?有什么错误吗?或者?此错误发生在TypeError:RichFaces.$(…)是未定义的RichFaces.$('popup').show(),而此弹出窗口的渲染效果并不是更好。好吧,原因(因此也是答案)现在显而易见。该JS变量未定义。显然RichFaces脚本没有(自动)包含在内,或者您使用的RichFaces版本不支持此构造。为了排除第一个问题,RichFaces脚本是否正确地包含在头部?在RichFaces 4中是否有其他方法使用它?非常感谢您的回答,这正是发生的事情!
<rich:popupPanel id="popup" show="#{usuario.fail == 1}" …>
    …
</rich:popupPanel>