0

Am trying to create a composite component that will display the values as overlaypanel. But it returns the below error; Cannot find component 'j_idt58:reviewDataTable:0:overrideCol' in view

overrideVersionDetails.xhtml:(composite component)

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:cc="http://java.sun.com/jsf/composite"
    xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

    <cc:interface>
        <cc:attribute name="forId" type="java.lang.String" required="true" />
        <cc:attribute name="forValue" type="java.lang.Object" />
    </cc:interface>

    <cc:implementation>
        <p:overlayPanel for="#{cc.attrs.forId}" my="left bottom">
            #{cc.attrs.forValue}
        </p:overlayPanel>
    </cc:implementation>
</ui:composition>

Its used in another page:

<h:form>
....
...
<p:dataTable .....>
....
    <p:column sortBy="#{dto.isSameCycleOverride}" width="100">
      <f:facet name="header">
          Override
      </f:facet>
      <h:commandLink id="overrideCol" binding="#{overrideCol}"
        value="#{(dto.isSameCycleOverride) ? 'Yes' : 'No'}" />
     <comp:overrideVersionDetails forId="#{overrideCol.clientId}"
     forValue="#{dto.message}" />
    </p:column>
....
</p:dataTable>
</h:form>

Any help is really appreciated.

rajeshsam
  • 1
  • 1

1 Answers1

0

I don't work with Primefaces, but with RichFaces I would use :

<comp:overrideVersionDetails forId="#{rich:clientId('overrideCol')}"
                             forValue="#{dto.message}" />

to do what you want.

With a little Help from SO : Rich Faces rich:clientId in Primefaces? it seems you can do this :

...
 <h:commandLink id="overrideCol" value="#{(dto.isSameCycleOverride) ? 'Yes' : 'No'}" />
 <comp:overrideVersionDetails forId="#{p:component('overrideCol')}"
 forValue="#{dto.message}" />
...

Now to see if this works better than the use of binding in a dataTable...

Community
  • 1
  • 1
gillup
  • 38
  • 6