简体   繁体   中英

How to find unnamed component in jsf/primefaces

In a primefaces/jsf webpage, I am unable to locate which of my components does not have an id, since the generated client side id is j_idt42:police-table-id:policeler . Can anyone help me to find which component is it?

Shortly, I have a full page layout. In the center of this layout, I define the content with one of my composite components. And lastly, inside this composite implementation, there is a datatable located inside a form. Form's id is police-table-id , dataTable's id is policeler .

layout.xhtml

<p:layoutUnit id="center-id" position="center" resizable="true">
    <ui:insert name="content">Put default content here, if any.</ui:insert>
</p:layoutUnit>

mycomposite.xhtml

<composite:implementation>
    <h:form id="police-table-id">
        <p:growl id="police-table-messages" />

        <p:dataTable id="policeler" var="pol"
            value="#{cc.attrs.policeBeanName.objectList}"...

actualPage.xhtml

<ui:define name="content">

        <denovo:poli... />
</ui:define>

generated html is as follows: 在此处输入图片说明

I suppose, I need to be able to give an id to the div in red rectangle whose classes are ui-layout-unit-content and ui-widget-content . However, i cannot give id to ui:define component, can I?

Also, any help about how to express my problem in a more coherent way is appreciated. Thanks.

The composite component is a naming container , which (among other things) means they add a "level" to the clientId generated by JSF.

Just name your invocation of the component:

<ui:define name="content">
    <denovo:poli id="mycomponent" ... />
</ui:define>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM