You need to sign in to do that
Don't have an account?
Rima KACI
Hi,
I've created class and method which retrieves List<Account> then it call Visualforce page contains Lightning Web Component.
Is there any way to pass List<Account> from this method to my LWC
Class
public override SearchResult SearchRecords()
List<Account> accountsCust = SearchClients.searchClientFromCustomerByPhoneMock2(callFolderId);
if(accountsCust != null && accountsCust.size()>0){
result.objectType = 'Url';
Set<String> setIds = new Set<String>();
setIds.add('https://test.lightning.force.com/apex/SearchClientCustomerByPhoneResultsPage');
.
.
}
}
Page
<apex:page extensions="SearchClients">
<apex:includeLightning />
<script>
//Tell your Visualforce page to use your Lightning app
$Lightning.use("c:SearchClientCustomerByPhoneResultsApp", function() {
// Write a function that creates the component on the page
$Lightning.createComponent("c:searchClientCustomerByPhoneResults",
{},
"divid",
function(cmp) {
})
});
</script>
<body>
<div id="divid" />
</body>
</apex:page>
LWC.JS
@track accounts[];
connectedCallback() {
this.accounts;
}
thx for your help
LWC Passparameters
Hi,
I've created class and method which retrieves List<Account> then it call Visualforce page contains Lightning Web Component.
Is there any way to pass List<Account> from this method to my LWC
Class
public override SearchResult SearchRecords()
List<Account> accountsCust = SearchClients.searchClientFromCustomerByPhoneMock2(callFolderId);
if(accountsCust != null && accountsCust.size()>0){
result.objectType = 'Url';
Set<String> setIds = new Set<String>();
setIds.add('https://test.lightning.force.com/apex/SearchClientCustomerByPhoneResultsPage');
.
.
}
}
Page
<apex:page extensions="SearchClients">
<apex:includeLightning />
<script>
//Tell your Visualforce page to use your Lightning app
$Lightning.use("c:SearchClientCustomerByPhoneResultsApp", function() {
// Write a function that creates the component on the page
$Lightning.createComponent("c:searchClientCustomerByPhoneResults",
{},
"divid",
function(cmp) {
})
});
</script>
<body>
<div id="divid" />
</body>
</apex:page>
LWC.JS
@track accounts[];
connectedCallback() {
this.accounts;
}
thx for your help
I call webservice to retrieve List of account from externe system
if list<Account> returned size >0 then I open visualforce page which containes my lightning web component
my LWC execute a method connectedCallback which call an other method in class B this method contains annotation @AuraEnabled
My question is how to pass List<Account> retreived in class A to LWC to display it?
is there any way to pass this list<Account> from class A to page VF then to LWC?
OR pass this List<Account> from class A to class B then it will be called from connectedCallback()?
OR I'am forced to redo the same call webservice from connectedCallback()?
thx for help