0

I am having to plot matrix type chart where I have dynamic data.

Here is the code

<apex:dataTable value="{!lstTableRows}" var="rows">
     <apex:column >
        <apex:facet name="header">{!rows.header1}</apex:facet>
        <apex:outputText value="{!rows.inputValue}"/>
    </apex:column>
    <apex:repeat value="{!rows.lstOfTargetValues}" var="targetValue">                   
        <apex:column >
            <apex:facet name="header">{!targetValue.header}</apex:facet>
            <apex:inputText value="{!targetValue.inputValue}" html-placeholder="enter the input"/>
        </apex:column>
    </apex:repeat>
</apex:dataTable>

In this case the header from facet element will not render. It renders fine when it is outside the <apex:repeat>.

NOTE: the above code is within <apex:dataTable>

Am I missing anything here or this is a bug. I would love to hear of any workaround with this.

  • That's not a bug. Look at the documentation. "An <apex:facet> component can only exist in the body of a parent component if the parent supports facets." – Martin Lezer Mar 8 '17 at 12:20
  • <apex:facet> is not a child component of <apex:repeat>. Remeber, repeat tag is not required inside a <apex:pageBlockTable> component. You can use <apex:dataTable> instead as this is a parent component of <apex:facet>. – TSmith Mar 8 '17 at 12:21
  • The <apex:repeat> here is child element of <apex:dataTable> and don't want to write this code for all columns manually, instead, render from a collection using <apex:repeat> – veer7 Mar 8 '17 at 12:34
  • <apex:dataTable> does not require <apex:repeat>. Can you please post some more code snippet. – Saroj Bera Mar 8 '17 at 12:46
  • @SarojBera: I am basically having to creates columns as well from a collection. dataTable helps you creates rows from collections. Added more code for your reference. – veer7 Mar 8 '17 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.