You need to sign in to do that
Don't have an account?
need help with Component.Apex.outputLink
Looks like I am missing the name attribute for outputLinks, but there is no such thing as name fot the tag.
Like you see in the code I tried "link.expressions.Value" too.
public Component.Apex.OutputPanel getLinks(){ Component.Apex.OutputPanel pnl = new Component.Apex.OutputPanel(); for(string id : recentItems) { Component.Apex.outputLink link = new Component.Apex.outputLink(value='/'+id, title=id); //link.expressions.Value = '/{!id}'; This does not work either pnl.childComponents.add(link); } return pnl; }
I see the links if I do inspect element, but they are not displayed on the page.
<span id="j_id0:j_id1:j_id6_0"> <a href="https://na9.salesforce.com/001E000000iWHSLIA4" title="001E000000iWHSLIA4"></a> <a href="https://na9.salesforce.com/001E000000iWHSMIA4" title="001E000000iWHSMIA4"></a> </span>
What am i missing here?
Thanks in advnace.
Thanks Ashlekh.
I modified the code, because hand icon won't be shown when you hover. Also they were in straight line.
All Answers
Hi,
I think you want to show some text and also want to open the given link after clicking on that text. For that you have to put a text between <a></a>
try above code you will get a clickable link on your page.
If this post helps you then hit kudus by clicking on star and accept my post as a solution to your question.
I would like it that to be defined here
Component.Apex.outputLink link = new Component.Apex.outputLink(value='/'+id, title=id);
Thank you for your time.
Hi
Try this code.
Thanks
Ashlekh
If this post helps you then mark it as a solution and don't Forget to give me Kudo's.
Thanks Ashlekh.
I modified the code, because hand icon won't be shown when you hover. Also they were in straight line.
<a href="mylink">Text </a>
How to set the property to get Link Text different from "mylink"?