Activity Forums Salesforce® Discussions What is the difference between apex command link and apex output link in Salesforce? Reply To: What is the difference between apex command link and apex output link in Salesforce?

  • saloni gupta

    Member
    July 19, 2017 at 1:19 pm

    Apex:outputLink – The <h:outputLink> renders a fullworthy HTML <a> element with the proper URL in the href attribute which fires a bookmarkable GET request. It cannot directly invoke a managed bean action method.

    <apex:outputlink value="https://www.google.co.in"> Google </apex:outputlink>

    <apex:outputlink value="/{!r.Id}"> {!r.Name} </apex:outputlink>

    apex:commandLink – The <h:commandLink> renders a HTML <a> element with an onclick script which submits a (hidden) POST form and can invoke a managed bean action method. It's also required to be placed inside a <h:form>.

    <apex:commandLink value="Google" action="https://www.google.co.in"/>

    <apex:commandLink value="Delete" action="{!dodelete}">
    <apex:param name="eid" value="{!E.Id}" assignTo="{!rId}"/>
    </apex:commandLink>