首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >渲染a4j commandButton不起作用;页面不渲染

渲染a4j commandButton不起作用;页面不渲染
EN

Stack Overflow用户
提问于 2012-05-31 22:47:23
回答 2查看 7K关注 0票数 1

当我单击按钮时,将调用handler.toggleCreatingTheme(),但outputPanel不会呈现。当我刷新页面(F5)时,会显示面板的内容。

代码语言:javascript
复制
                <a4j:commandButton styleClass="simple-submit-button"
                    action="#{handler.toggleCreatingTheme()}"
                    rendered="#{!handler.creatingTheme}"
                    value="txt"
                    immediate="true"
                    render="newThemeForm" oncomplete="initEditor()" status="statusWait" />

                <a4j:outputPanel id="newThemeForm" ajaxRendered="true" rendered="#{handler.creatingTheme}">

这两个标签都在h:form标签中,只有一个h:form。

如何让页面自动刷新,以便在单击按钮时呈现面板?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-06-01 01:11:30

newThemeForm嵌入到另一个a4j:outputPanel中并呈现它而不是reRendering newThemeForm.This是因为newThemeForm在试图呈现它时不会在DOM中,因为它的rendered属性仍然是false。像这样:

代码语言:javascript
复制
<a4j:outputPanel id="outerPanel>
<a4j:outputPanel id="newThemeForm" rendered="#{bean.booleanvalue}">
</a4j:outputPanel>
</a4j:outputPanel>

渲染outerPanel而不是newThemeForm

票数 1
EN

Stack Overflow用户

发布于 2012-10-18 20:20:12

我已经尝试了AhamedMustafaM提到的方法,但它对我不起作用,所以我搜索并尝试了一段时间,最后我找到了一个变通的方法,下面是方法

代码语言:javascript
复制
<a4j:commandButton id="clear" value="Clear" action="#{handler.clearData}"  immediate="true"  >
    <!-- dummy call just to make it work -->
    <a4j:actionListener listener="#{ViewerController.test}"/>
    <f:ajax render="dataGroupPanel"/>
</a4j:commandButton> 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10835916

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档