a4j:commandButton reRendering rich:datatable

左心房为你撑大大i 提交于 2019-12-01 18:43:30

You need to wrap both components in an <a4j:outputPanel id="myPanel" ajaxRendered="true"/>. The reason both components are failing to be reRendered is that the component you've set torendered="false" will not be sent to the browser on initial view rendering.

<a4j:outputPanel id="myPanel" ajaxRendered="true">
<h:outputText value="#{_yield.yfYield}" rendered="#{not yieldSearch.visible}"/>
<h:inputText rendered="#{yieldSearch.visible}" />
</a4j:outputPanel>

The way ajax refreshes work is by using javascript to locate a clientId in the DOM tree to update with new markup, i.e. the component must already be in the DOM tree. Since you've set the rendered="false", the component was never in the DOM tree to start with. So on an ajax request, the browser doesn't know what you're talking about because it can't find the clientId to update.

Using the outputPanel with ajaxRendered="true", you're refreshing the entire outputPanel, so the ajax refresh will update that component as a whole, with whatever you've nested within it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!