1

I want to display only link to click only for value > 0.

How should I approach this issue?

<apex:outputLink value="{!IF(info.noOfStudents > 0, '#', '')}" onclick="return goToDetailsPage('{!info.studentId}');">
    <apex:outputText value="{!info.noOfStudents}" />
</apex:outputLink>

1 Answer 1

2

You can just conditionally render the link and the alternative text using the rendered attribute:

<apex:outputLink value="{!IF(info.noOfStudents > 0, '#', '')}" onclick="return goToDetailsPage('{!info.studentId}');" rendered="{!info.noOfStudents > 0}">
    <apex:outputText value="{!info.noOfStudents}" />
</apex:outputLink>
<apex:outputText value="{!info.noOfStudents}" rendered="{!info.noOfStudents == 0}"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .