function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
venkat bojjavenkat bojja 

How can we give the component URL in Anchor Tag: <a>

Hi Team,
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:

 <aura:iteration items="{!v.ContactList}" var="acc">
                                        <tr>
                                            <th>
                                                <label class="slds-checkbox" id="{!acc.Id}">
                                                    <ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />

                                                    <span class="slds-checkbox--faux" />
                                                    <span class="slds-form-element__label"></span>
                                                </label>
                                            </th>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Name}</div>
                                            </th>
                                            <td>
                                                <div class="slds-truncate" title="">{!acc.Phone}</div>
                                            </td>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Email}</div>
                                            </th>

                                            <td>
                                                <div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
                                            </td>

                                            <th scope="row">
                                                <div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
                                            </th>

                                        </tr>
                                    </aura:iteration>

=============================================================
Ref Image:

User-added image
Thanks 
Venkat
krisstannum1krisstannum1
<a href="{! 'one/one.app#/sObject/' + acc.id + '/view'}" target="_blank"/>
Try this. Where acc.id is the record Id.
venkat bojjavenkat bojja
Hi krisstannum1, 

Thanks for your reply...
When i clicked on Hyperlink it is opening new tab but the thing is need to navigate to pertecular component Ex: cmp1. We are iterating that cmp1.
When ever i clicked that hyper link i shoud open in new tab with the pertecular component(cmp1) URL. 
Note: Without usig the force:Navigate.
Thanks in advance...

Thanks
Venkat.
venkat bojjavenkat bojja
  Hi Team,

<td>
 <div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
  </td>

I need to iterate my component ex: cmp1 instead of https://www.google.co.in/ .  When i clicked on that hyperlink then it should open in new window with the component(cmp1) URL .

Thanks
Venkat
krisstannum1krisstannum1
Oh, i didn't understand your requirement the first time. So what you need is the link to open a new component in a different window and pass the record ID?
Will it be the same component or a different one you created?
venkat bojjavenkat bojja
Hi krisstannum1,
 Excatly what you said in above reply(So what you need is the link to open a new component in a different window and pass the record ID?).

Will it be the same component or a different one you created? :Ans: It's a different compoent. When i clicked on link it should navigate to another different component. This Iteration and  all in one component ex: cmp1. I need to place another new component in link (ex :cmp2 ).So when i cliked that link it should navigate to cmp2.Please help me on this...Thanks in advance

Note: Without usig the force:Navigate.

Thanks
Venkat
krisstannum1krisstannum1
I'm thinking you could make use of $A.createComponent but i'm not sure how to make it open in a new tab. how about as a popup, will that work for you? or it has to be a new window?
krisstannum1krisstannum1
OR, you can put your second component in a new lightning app page and we can get the url of it from there...is that an option for you?
venkat bojjavenkat bojja
OR, you can put your second component in a new lightning app page and we can get the url of it from there...is that an option for you?
Ans: I was done same like what you said initially but my team  saying that this is not a good approach

Thanks
Venky