How make commandButton not fully refresh page? How to use f:ajax?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 14:44:52
BalusC

Make use of Ajax. It's a matter of nesting <f:ajax> inside the command button of interest.

<h:commandButton ...>
    <f:ajax execute="@form" render="@none" />
</h:commandButton>

Particularly the render="@none" (which is the default value anyway, you could just omit the attribute altogether) will instruct JSF to re-render just nothing after the submit. If you intend to re-render only a specific component instead of the whole page, then you could also specify the ID of that specific component in render attribute.

<h:commandButton ...>
    <f:ajax execute="@form" render="result" />
</h:commandButton>
<h:panelGroup id="result">...</h:panelGroup>

See also:

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