I am new to Lightning so it might be very foolish question.
I have a Visualforce page with 2 buttons "Save" and "Cancel" and both has custom code which uses "PageReference" to navigate to other page. It is working fine in Classic but Lightning it is not working.
So for Lightning, I have create a Lightning component and loading this component on Visuaforce page using Lightning connect.
In Lightning connect javascript I am using following code -
<script>
var userContext = "{!$User.UIThemeDisplayed}";
$Lightning.use("c:NavButtonApp", function() {
$Lightning.createComponent("c:NavButton",
{"url" : "{!navigationURL}" , "ButtonName" : "Demo BTN", "UserContext": userContext },
"lightning",
function(component) {
console.log("First_Lightning component loaded");
}
);});
</script?
When I run this page in Salesforce Classic then userContext
displays "theam3"
and that is correct. but when I open this visualforce page in Lightning environment even though this userContext
displays "theam3"
. I was hoping it will display "theam4d".
Can you suggest if I am doing something wrong.