1

when i click the button handler.toggleCreatingTheme() is called, but the outputPanel is not rendering. When i refresh the page(f5) the content of the panel is showed.

                <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}">

this tags are both in a h:form tag, there is just that one h:form.

How do I let the page refreshing on his own, so rendering the panel at the moment when i click the button?

4

2 回答 2

1

嵌入newThemeForm另一个 a4j:outputPanel 并渲染它而不是 reRendering newThemeForm。这是因为newThemeForm在尝试渲染它时不会在 DOM 中,因为它的rendered属性仍然是false. 喜欢:

<a4j:outputPanel id="outerPanel>
<a4j:outputPanel id="newThemeForm" rendered="#{bean.booleanvalue}">
</a4j:outputPanel>
</a4j:outputPanel>

渲染outerPanel而不是newThemeForm.

于 2012-05-31T17:11:29.590 回答
0

我已经尝试过 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> 
于 2012-10-18T12:20:11.760 回答