Jsf a4j命令按钮的渲染不起作用;页面不呈现

Jsf a4j命令按钮的渲染不起作用;页面不呈现,jsf,ajax4jsf,Jsf,Ajax4jsf,当我单击按钮处理程序时,会调用.toggleCreationTheme(),但outputPanel不会呈现。当我刷新页面(f5)时,将显示面板的内容 <a4j:commandButton styleClass="simple-submit-button" action="#{handler.toggleCreatingTheme()}" rendered="#{!handler

当我单击按钮处理程序时,会调用.toggleCreationTheme(),但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


如何让页面自己刷新,因此,在我单击按钮时渲染面板?

在另一个a4j:outputPanel中嵌入
newThemeForm
,并进行渲染,而不是重新渲染
newThemeForm
。这是因为当尝试渲染它时,
newThemeForm
属性仍将保持不变,因此
newThemeForm
将不在DOM中
false
。 比如:


newThemeForm
嵌入另一个a4j:outputPanel中,并对其进行渲染,而不是重新渲染
newThemeForm
。这是因为当尝试渲染它时,
newThemeForm
将不在DOM中,因为它的
渲染属性仍然是
false
。 比如:


我尝试了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> 

我尝试了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>