Using one component (dataTable) id inside composite component

核能气质少年 提交于 2019-12-04 12:24:07
BalusC

Apparently you've another NamingContainer parent in the view. To be sure, open page in browser, rightclick and View Source and determine the generated ID of <p:dataTable id="leakTable">. Then, you should grab exactly that ID and prefix with :.

Alternatively, you can also bind the table component to the view and use UIComponent#getClientId() instead to dynamically refer the client ID.

<p:dataTable binding="#{leakTable}" ...>

with

<haiq:exporter target=":#{leakTable.clientId}" ...>

Unrelated to the concrete problem, I suggest to replace <!DOCTYPE><html> of your composite by <ui:component>, which is more natural and it also saves JSF from doing it impliticly everytime.

<ui:component
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:cc="http://java.sun.com/jsf/composite"
    xmlns:p="http://primefaces.prime.com.tr/ui">

See also https://stackoverflow.com/tags/composite-component/info.

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