function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gaurav.agrawal91.3963408275063662E12gaurav.agrawal91.3963408275063662E12 

Using outputlink in repeat block

Can anyone help in below code where i have used the output link under repeat block but its not showing the link.


   <apex:pageBlockTable value="{!sObjectList}" var="res" id="pg">
                <apex:repeat value="{!objectFields}" var="field">
<apex:outputLink title="xyz" value="/apex/payer">
link
</apex:outputLink>
                    <apex:column value="{!res[field]}"/>
                </apex:repeat>
            </apex:pageBlockTable>
bob_buzzardbob_buzzard
I suspect this is because your outputlink becomes a direct descendant of the pageblocktable which isn't a valid place for it.  If you place this outside the field repeat and wrap in an apex:column then it will be displayed correctly:
 
<apex:column>
  <apex:outputLink title="xyz" value="/apex/payer">
    link
  </apex:outputLink>
</apex:column>
 <apex:repeat value="{!objectFields}" var="field">
                    <apex:column value="{!res[field]}"/>

If you only want one of these links on the page you should place it outside the pageblocktable.

 
Rohit SharmaGRohit SharmaG
<apex:pageBlockTable value="{!sObjectList}" var="res" id="pg">
  <apex:repeat value="{!objectFields}" var="field">
    
<apex:column>
  <apex:outputLink title="xyz" value="/apex/payer">
    link
  </apex:outputLink>
</apex:column>

 <apex:column value="{!res[field]}"/>

 </apex:repeat>

</apex:pageBlockTable>