change rendered attribute from managed bean

若如初见. 提交于 2019-12-04 20:55:37

There is one thing i changed and now it is working, i changed the return type of the method i run when pressing the button, it returned a string value, navigating to the same page, it now returns null and JSF does not generate a new view , instead it renders the same view, and all is working.

I guess since a new view was rendered each time the fact that i set the render value true or false did not matter since each time the component was set to rendered="false" on the new view.

cubbuk

If you are making an ajax call with the button then javascript can not find your element in the dom tree to render it because it is not there in the firstplace.

There is a similar question here which explains the situation better.

Render component with ajax in jsf

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