1

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

0

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>
    ...
| improve this answer | |
  • I like the answer with only the "column" and "commandLink" options – 94071340 Jun 4 '14 at 17:26
1

The facet names are fixed by Salesforce to things like "header" and "footer" (depending on the surrounding apex tag which looks for specific names) so the first thing to try is changing this:

<apex:facet name="Agregar">

to this:

<apex:facet name="header">

See the bottom of the apex:pageBlockTable documentation.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.