You need to sign in to do that
Don't have an account?
Sahil Yadav 4
Aura Component Issue
Hello Developers,
I had one aura comp which holds 3 dropdown values and my requirement is on click of specific values some specific external sites should be get opened up .
So the above is component which hold three value such as canada , uk, usa and on click different page or site should be get opened up sharing the code please suggests where i did wrong..
I had one aura comp which holds 3 dropdown values and my requirement is on click of specific values some specific external sites should be get opened up .
So the above is component which hold three value such as canada , uk, usa and on click different page or site should be get opened up sharing the code please suggests where i did wrong..
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:attribute name="modes" type="List" default="[ {'label': 'UK', 'value': 'uk'}, {'label': 'CANADA', 'value': 'canada'}, {'label': 'Hard', 'value': 'hard'}, ]" /> <lightning:card title="SELECT COUNTRY"> <lightning:layout horizontalAlign="center" multipleRows="true"> <lightning:layoutItem padding="around-small"> <lightning:combobox name="gameMode" label="Game Mode" value="inProgress" variant="label-hidden" aura:id="gameMode" options="{!v.modes}" placeholder="Select Game Mode" /> </lightning:layoutItem> </lightning:layout> </lightning:card> </aura:component> Js ({ navigate : function(component, event, helper) { //Find the text value of the component with aura:id set to "address" var address = component.find("gameMode").get("v.value"); var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": 'https://www.google.com/maps/place/' + address }); urlEvent.fire(); } })
Hey Sahil,
You may take the idea from this example :-
https://salesforce.stackexchange.com/questions/106015/lightning-how-do-i-get-the-selected-value-from-a-select-dropdown-list-send-i
If it helps, kindly mark it as the best answer.
Regards,
Priya Ranjan