Find your content:

Search form

You are here

if else condition in commandlink value

 
Share
<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

updated:

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

replace the account.name 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 https://salesforce.stackexchange.com/questions/4623

My Block Status

My Block Content