+ Start a Discussion
di_zoudi_zou 

Values in apex:pageBlockTable not linking

I have a custom Cases Apex page. I want to be able to display a list of cases and then be able link to the individual cases in each row like the default cases page. This is what I have so far:

 

<apex:page standardController="Case" recordSetVar="Case" tabstyle="Case" sidebar="true" showHeader="true">
    <apex:form >
        <apex:pageBlock >
            <apex:panelGrid columns="2">
              <apex:outputLabel value="View:"/>
              <apex:selectList value="{!filterId}" size="1">
                <apex:actionSupport event="onchange" rerender="cases_table"/>
                <apex:selectOptions value="{!listviewoptions}"/>
              </apex:selectList>
            </apex:panelGrid>
            <apex:pageBlockTable value="{!case}" var="c" rows="50" id="cases_table" >
                <apex:column value="{!c.CaseNumber}" />
                <apex:column value="{!c.ContactId}" />
                <apex:column value="{!c.Subject}" />
                <apex:column value="{!c.Status}" />
                <apex:column value="{!c.Priority}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

However, no links are showing up in any of the rows. When I click an individual Case Number, nothing happens. How do I get links to each of the cases to show up? Thanks.

HariDineshHariDinesh

Hi,

 

Replace your code with below code, which will works for you

 

<apex:page standardController="Case" recordSetVar="Case" tabstyle="Case" sidebar="true" showHeader="true">
<apex:form >
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="cases_table"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
<apex:pageBlockTable value="{!case}" var="c" rows="50" id="cases_table" >
<apex:column >
<apex:facet name="header">
<apex:outputLabel value="{!$ObjectType.Case.Fields.CaseNumber.Label}" />
</apex:facet>
<apex:outputLink value="/{!c.id}" target="_blank">{!c.CaseNumber} </apex:outputLink>
</apex:column>
<!--apex:column value="{!c.CaseNumber}" / -->
<apex:column value="{!c.ContactId}" />
<apex:column value="{!c.Subject}" />
<apex:column value="{!c.Status}" />
<apex:column value="{!c.Priority}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

di_zoudi_zou

I figured this out. I have to have something like this:

 

<apex:column><a target="_parent" href="{!URLFOR($Action.Case.View, c.id)}">{!c.CaseNumber}</a></apex:column>

 

inside my pageBlockTable