你好,我有这样的代码可以在我的页面中有条件地渲染组件:
<h:commandButton action="#{Bean.method()}" value="Submit">
<f:ajax execute="something" render="one two" />
</h:commandButton>
<p><h:outputFormat rendered="#{Bean.answer=='one'}" id="one" value="#{messages.one}"/></p>
<p><h:outputFormat rendered="#{Bean.answer=='two'}" id="two" value="#{messages.two}"/></p>
我得到了答案并渲染了组件,但为了在页面上看到它,我需要刷新页面。如何解决这个问题?有什么建议吗?