Ajax update/render does not work on a component which has rendered attribute

匿名 (未验证) 提交于 2019-12-03 08:36:05

问题:

I'm trying to ajax-update a conditionally rendered component.

...

However, that does not work. I can assure that #{user} is actually available. How is this caused and how can I solve it?

回答1:

It's not possible to re-render (update) a component by ajax if the component itself is not rendered in first place. The component must be always rendered before ajax can re-render it. Ajax is using JavaScript document.getElementById() to find the component which needs to be updated. But if JSF hasn't rendered the component in first place, then JavaScript can't find anything to update.

The solution is to simply reference a parent component which is always rendered.

...

See also:



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