Primefaces datatable selected row not working using viewscope

拟墨画扇 提交于 2019-12-05 21:42:40

I have managed to resolve this issue by using @ViewAccessScoped which is supported in CDI. Add the dependency in maven or directly download from http://myfaces.apache.org/extensions/cdi/download.html and put it in classpath.

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
    <artifactId>myfaces-extcdi-core-api</artifactId>
    <version>1.0.5</version>
    <scope>compile</scope>
</dependency>

One small problem still remains i.e. when application is deployed for the first time, I still do not get selected row value, for the subsequent selections I am able to get selected row value.

I think you have to provide rowKey attribute on datatable, if you want to work with selection.

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