You need to sign in to do that
Don't have an account?
MrHammy
How do i build an apex:outputLink and pass it back to a Visualforce page
I am replacing a formula that has grown too large with a Visualforce page and an extension to do the work. When passing the fully composed apex:outputLink back as a string is displays as just that a string. How should I be passing this back? I have stripped out all the logic so it is just building the first of about 20 different links that i need to build, once one is working the others will be easy
VF page:
VF page:
<apex:page standardController="SFDC_520_Quote__c" showHeader="false" sidebar="false" extensions="makelink"> {!mylink} </apex:page>Extention
public class makelink { private final SFDC_520_Quote__c q; public makelink(ApexPages.StandardController stdController) { this.q = (SFDC_520_Quote__c)stdController.getRecord(); } public string getmylink(){ string l; l = '<apex:outputLink target="_blank" value="https://inside.legrandna.com/mainpage/Sales/tws_quote_program/find_quote.cfm?quote=' + q.Quote_ID__c + '&oppid=' + q.Opportunity__c + '"eid=' + q.id + '">WS Quote</apex:outputLink>'; return l ; } }
If the links get out of hand, then you may want to consider a different approach, perhaps using custom settings.
In the past I have used visualforce remoting to call an apex method that generates HTML, then in the callback function use jQuery to inject the HTML into the DOM.
I'm suspecting though that this may be overkill for your implementation