Find your content:

Search form

You are here

if else condition in commandlink value

<apex:commandLink value="ADD" onclick="return divToggle('{!oplist.lineNumber}');"/>

I want to apply if else condition ,if UnitPrice is not null then View commandlink should show otherwise Add should show..

Attribution to: Mik

Possible Suggestion/Solution #1

If I follow you right you need to display a command link when unitprice is not null. If thats the case try


<apex:page standardController="account">
<apex:form >
<apex:commandLink value="ADD" rendered="{!NOT(ISNULL(}"/>
<apex:commandLink value="View command link" rendered="{!(ISNULL(}"/>

replace the with your unitprice

rendered attribute allows you to control the visibility conditionally on a command link

Attribution to: Rao
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content