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
RajusRajus 

How to provide link for dynamic columns in pageblocktable.

Hi All,

I have created one search functionality where users can select the filter criteria and fields to display in the search results,

In search results i want to provide a link for Name field .So that users can open that perticaular record.

I know how to it for static columns. It will be some thing like <apex:outputLink value="{!result.id}">{!result.Name}</apex:outputLink>

 

Now i want do like this for the Name field which will be selected dynamically.

Following is my visualforce code which i use to display the search results.

 

<apex:pageblockTable value="{!masterlist}" var="rec" rendered="{!if(masterlist.size>0,true,false)}">


<apex:repeat value="{!selectedfields}" var="FieldLable">

<apex:column value="{!rec[FieldLable]}" />
</apex:repeat>
</apex:pageblockTable>

 

So can any one please give any idea that where and how should i change the code .so that i can provid the link comfirtably.

 

 

Thanks,

Rajesh.

ShahTheTrainerShahTheTrainer

The combination of  <apex:commandLink> and <apex:param> will do the job.

 

RajusRajus

Could you please provide the code for it.