开发者

JSF 2.0 with Richface 4.0 not rerendering component

开发者 https://www.devze.com 2023-04-04 05:51 出处:网络
Do you have any idea why this part of code isn\'t working: View: <a4j:commandButton value=\"#{labels.comments}\"

Do you have any idea why this part of code isn't working:

View:

<a4j:commandButton value="#{labels.comments}" 
    action="#{rese开发者_运维技巧rvation.displayComments}" 
    render="dataComments" />

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

Bean:

 public String displayComments(){
    showComments = !showComments;
    return "";
 }

Click on the link simply do nothing.


Try something like this:

<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/>

Always show your dataComments element, unless you will have nothing on the page to refresh.

0

精彩评论

暂无评论...
验证码 换一张
取 消