You need to sign in to do that
Don't have an account?
Pzyren
Disable link if column is empty
I have a table and the columns have outputlinks. Right now, if the column is empty, it displays "None" which is a link to nowhere. I want to be able to remove the link if the column is empty. Any help? Thanks
I tried
<apex:outputLink value="/{!object.field__c}" )}" disabled = {!IF(!object.field__c == '')} target="_top">
Obviously didn't work since disabled takes in boolean.
<apex:column > <apex:facet name="header" ><apex:outputText value="{!$Label.Name}" /></apex:facet> <apex:outputLink value="/{!object.field__c}" )}" target="_top"> <apex:outputField value="{!object.field__c}" /> </apex:outputLink> </apex:column>
Try
disabled = {! IF(ISBLANK(object.field__c),true,false)}
All Answers
Try
disabled = {! IF(ISBLANK(object.field__c),true,false)}
If you want to remove the link just use the rendered attribute of the apex:outputLink and add the condition inside it.