当我单击按钮时,将调用handler.toggleCreatingTheme(),但outputPanel不会呈现。当我刷新页面(F5)时,会显示面板的内容。
<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。
如何让页面自动刷新,以便在单击按钮时呈现面板?
发布于 2012-06-01 01:11:30
将newThemeForm嵌入到另一个a4j:outputPanel中并呈现它而不是reRendering newThemeForm.This是因为newThemeForm在试图呈现它时不会在DOM中,因为它的rendered属性仍然是false。像这样:
<a4j:outputPanel id="outerPanel>
<a4j:outputPanel id="newThemeForm" rendered="#{bean.booleanvalue}">
</a4j:outputPanel>
</a4j:outputPanel>渲染outerPanel而不是newThemeForm。
发布于 2012-10-18 20:20:12
我已经尝试了AhamedMustafaM提到的方法,但它对我不起作用,所以我搜索并尝试了一段时间,最后我找到了一个变通的方法,下面是方法
<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> https://stackoverflow.com/questions/10835916
复制相似问题