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.0和Richface 4.0不重新发布组件_Jsf 2_Richfaces - Fatal编程技术网

Jsf 2 JSF2.0和Richface 4.0不重新发布组件

Jsf 2 JSF2.0和Richface 4.0不重新发布组件,jsf-2,richfaces,Jsf 2,Richfaces,你知道为什么这部分代码不起作用吗: 视图: 点击链接,什么也不做。试试这样的方法: <a4j:commandButton value="#{labels.comments}" action="#{reservation.displayComments}" render="dataComments" /> <h:panelGroup id="dataComments"> <h:panelGroup id="innerPanel" rende

你知道为什么这部分代码不起作用吗:

视图:


点击链接,什么也不做。

试试这样的方法:

<a4j:commandButton value="#{labels.comments}" 
    action="#{reservation.displayComments}"
    render="dataComments" />

<h:panelGroup id="dataComments">
    <h:panelGroup id="innerPanel" rendered="#{reservation.showComments}" >
        ...
    <h:panelGroup/>
<h:panelGroup/>

...

始终显示dataComments元素,除非页面上没有可刷新的内容。

您的标题与您的问题不同。它不是渲染吗?或者它没有击中方法。你在那里放了一个断点来查看吗?您可以在控制台中看到的任何错误日志。还提供完整的bean,包括向我们展示如何将其配置为托管bean。然后,至少完整的形式,围绕着这个按钮。关于表格的记录它在表格里吗?非常感谢,看起来很好。
 public String displayComments(){
    showComments = !showComments;
    return "";
 }
<a4j:commandButton value="#{labels.comments}" 
    action="#{reservation.displayComments}"
    render="dataComments" />

<h:panelGroup id="dataComments">
    <h:panelGroup id="innerPanel" rendered="#{reservation.showComments}" >
        ...
    <h:panelGroup/>
<h:panelGroup/>