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
mobile vistexmobile vistex 

how to give commandlink or link to particular columns in visualforce

hi iam trying to build a visual force where i am getting my data from a controller in form of lists. i want to dispaly the page like following
User-added image

iam giving my visualforce page code  
<apex:page controller="dataController" showHeader="false">

<style>
table {
    border-collapse: collapse;
}

table, td, th {
    border: 1px solid black;
    
}



</style>

<apex:pageBlock >
<table>
<tr>
<apex:repeat value="{!tableHeader}" var="header">
<td>
<apex:outputText value="{!header}"></apex:outputText>
</td>
</apex:repeat>

</tr>

<apex:repeat value="{!tableBody}" var="tbody">
<tr class="lnkdsble" >
<apex:repeat value="{!tbody}" var="rdata">

<td>
<apex:outputText value="{!rdata}"/>

</td>

</apex:repeat>
</tr>
</apex:repeat>
</table>

</apex:pageBlock>
</apex:page>

please tell me how can i put links for those paticular columns ie jan feb mar so on..  i dont want links for first two columns
Best Answer chosen by mobile vistex
Mudasir WaniMudasir Wani
Hello,

I assume the link will appear in case you have number value in the expression
If that is the case you can use Visualforce IF condition
Mody your code of line 33 as
td>
<apex:outputText value="{!rdata}"  rendered="{!IF(ISNUMBER(rdata),false,true)}" />
<apex:commandLink action="{!save}" value="{!rdata}" rendered="{!IF(ISNUMBER(rdata),true,false)}" />
</td>
Let me know in case you have any issue.


Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help

All Answers

Mudasir WaniMudasir Wani
Hello,

I assume the link will appear in case you have number value in the expression
If that is the case you can use Visualforce IF condition
Mody your code of line 33 as
td>
<apex:outputText value="{!rdata}"  rendered="{!IF(ISNUMBER(rdata),false,true)}" />
<apex:commandLink action="{!save}" value="{!rdata}" rendered="{!IF(ISNUMBER(rdata),true,false)}" />
</td>
Let me know in case you have any issue.


Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
This was selected as the best answer
mobile vistexmobile vistex
thanks wani