You need to sign in to do that
Don't have an account?
SFHelpMePlease
Visual Force page, how do I check for a value in the output link
How would I check if the URL is populated in the below code?
What I would like to do is display 'Open URL' if a URL exists.
If no URL, then I would like to display 'No URL Available' or leave it blank.
<apex:pageBlockSectionItem >
<apex:outputLabel value="MY URL" />
<apex:outputLink value="{!defaultURL.MY_URL__c}" target="_blank">Open URL</apex:outputLink>
</apex:pageBlockSectionItem>
What I would like to do is display 'Open URL' if a URL exists.
If no URL, then I would like to display 'No URL Available' or leave it blank.
<apex:pageBlockSectionItem >
<apex:outputLabel value="MY URL" />
<apex:outputLink value="{!defaultURL.MY_URL__c}" target="_blank">Open URL</apex:outputLink>
</apex:pageBlockSectionItem>
KC Shafer
If you are using a controller or extension, you can define the url label in you apex, depending on the value of the url. So basically have a property for urlLabel, then check if the url is null or not to fill in the urlLabel. Alternatively, you can do something like this render different text with the rendered attribute.