[SalesForce] commandLink is not rendering in a pageBlockTable cell

I have the following code:

<apex:pageBlockTable value="{!nuevaBitacora}" var="bitacoraParaInsertar" id="table">                
            <apex:facet name="Agregar">
                <apex:commandLink action="{!agregaBitacora}" value="Agregar" id="idAgregar" rerender="idBitacora"/>
            </apex:facet>
            <apex:column headerValue="Fecha y hora de inicio">
                <apex:inputField value="{!bitacoraParaInsertar.FechaHoraInicio__c}" />
            </apex:column>
            <apex:column headerValue="Fecha y hora final">
                <apex:inputField value="{!bitacoraParaInsertar.FechaHoraFin__c}" />
            </apex:column>
            <apex:column headerValue="Tipo de actividad">
                <apex:inputField value="{!bitacoraParaInsertar.TipoActividad__c}" />
            </apex:column>
            <apex:column headerValue="Descripción">
                <apex:inputField value="{!bitacoraParaInsertar.Descripcion__c}" />
            </apex:column>
            <apex:column headerValue="Evento">
                <apex:inputField value="{!bitacoraParaInsertar.Evento__c}" />
            </apex:column>
        </apex:pageBlockTable>

I can see the fields, but I can't see the hyperlink to add the new record:

imge showing that there is no hyperlink

Best Answer

Similar to Keith's answer, the important part is the value of the name attribute on the facet tag.

If the 'add' link is supposed to be on each row rather than rendered in the header cell:

<apex:pageBlockTable value="{!nuevaBitacora}" var="bitacoraParaInsertar" id="table">                
    <apex:column>
        <apex:facet name="header">
            <apex:outputText value="Agregar" />
        </apex:facet>
        <apex:commandLink action="{!agregaBitacora}" value="Agregar" id="idAgregar" rerender="idBitacora"/>
    </apex:column>
    <apex:column headerValue="Fecha y hora de inicio">
        <apex:inputField value="{!bitacoraParaInsertar.FechaHoraInicio__c}" />
    </apex:column>
    ...
Related Topic