• wasabi 865
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Fannie Mae

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
So I have been searching for days, to find out how to embed a Web component within another web component. I have a conditional statement that will include another web component if it evalutes to true, but I can't seem to get it to work. I get the following error when I try to deploy it: 
/c/eCms_cancelModal_lwc/eCMS_CancelModal_LWC.js:0,0 : LWC1010: Failed to resolve entry for module "eCMS_CancelModal_LWC"

Listed below is a snippet of the code causing the error. Any help would be greatly appreciated. 
Thanks,
Niels

WEB COMPONENT (HTML) 1

<template if:true={openmodel}>
    <c-e-cms_cancel-modal_lwc source="lwc/eCMS_CancelModal_LWC"></c-e-cms_cancel-modal_lwc>
</template>

WEB COMPONENT (HTML) 2
<template>
<!--NJ call component here, so remove the following once I get it working. -->
<div class="slds-m-bottom_none slds-m-top_none" style="height: 640px;">
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<header class="slds-modal__header">
<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal}>
<lightning-icon icon-name="utility:close" size="medium">
</lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">(VERSION 2) Please Enter Cancellation Justification</h2>
</header>
<div class="slds-modal__content slds-p-around_medium">
<p></p>
<lightning-input label="Justification" class="slds-size--1-of-1"></lightning-input><br/>
</div>
<footer class="slds-modal__footer">
<lightning-button label="Save" variant="brand" onclick={saveMethod}></lightning-button>&nbsp;&nbsp;&nbsp;&nbsp;
<lightning-button label="Cancel" variant="neutral" onclick={closeModal}></lightning-button>
</footer>
</div>
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</div>
</template>

WEB COMPONENT (JS) 2
import { LightningElement, track, api } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
//import { getRecord } from 'lightning/uiRecordApi';
export default class ECMS_CancelModal_LWC extends LightningElement {
@api recordId;
@track openmodel = false;
//openmodal() {
// this.openmodel = true;
//}
closeModal() {
this.openmodel = false;
}
saveMethod() {
// Navigate to a URL
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: '/apex/Apttus__AgreementCancel?id=' + this.recordId
}
});
//this.closeModal();
}
}
So I need to be able to get the name of the home page where my lightning component is loaded from. If its loaded on a record page then I simply implement force:hasSObjectName and use sObjectName to get the name of the object, but I can't seem to figure out how to get the name of an app page if the component is loaded there. Thanks in advance for any help. 
So I have been searching for days, to find out how to embed a Web component within another web component. I have a conditional statement that will include another web component if it evalutes to true, but I can't seem to get it to work. I get the following error when I try to deploy it: 
/c/eCms_cancelModal_lwc/eCMS_CancelModal_LWC.js:0,0 : LWC1010: Failed to resolve entry for module "eCMS_CancelModal_LWC"

Listed below is a snippet of the code causing the error. Any help would be greatly appreciated. 
Thanks,
Niels

WEB COMPONENT (HTML) 1

<template if:true={openmodel}>
    <c-e-cms_cancel-modal_lwc source="lwc/eCMS_CancelModal_LWC"></c-e-cms_cancel-modal_lwc>
</template>

WEB COMPONENT (HTML) 2
<template>
<!--NJ call component here, so remove the following once I get it working. -->
<div class="slds-m-bottom_none slds-m-top_none" style="height: 640px;">
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<header class="slds-modal__header">
<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal}>
<lightning-icon icon-name="utility:close" size="medium">
</lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">(VERSION 2) Please Enter Cancellation Justification</h2>
</header>
<div class="slds-modal__content slds-p-around_medium">
<p></p>
<lightning-input label="Justification" class="slds-size--1-of-1"></lightning-input><br/>
</div>
<footer class="slds-modal__footer">
<lightning-button label="Save" variant="brand" onclick={saveMethod}></lightning-button>&nbsp;&nbsp;&nbsp;&nbsp;
<lightning-button label="Cancel" variant="neutral" onclick={closeModal}></lightning-button>
</footer>
</div>
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</div>
</template>

WEB COMPONENT (JS) 2
import { LightningElement, track, api } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
//import { getRecord } from 'lightning/uiRecordApi';
export default class ECMS_CancelModal_LWC extends LightningElement {
@api recordId;
@track openmodel = false;
//openmodal() {
// this.openmodel = true;
//}
closeModal() {
this.openmodel = false;
}
saveMethod() {
// Navigate to a URL
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: '/apex/Apttus__AgreementCancel?id=' + this.recordId
}
});
//this.closeModal();
}
}
So I need to be able to get the name of the home page where my lightning component is loaded from. If its loaded on a record page then I simply implement force:hasSObjectName and use sObjectName to get the name of the object, but I can't seem to figure out how to get the name of an app page if the component is loaded there. Thanks in advance for any help. 
All,

I've been working through the "Lightning Components Basics" Trailhead module and found it to be, in the main, really helpful. However, there are a few points in the examples where methods/techniques are used which aren't clarified and I can't find in the documentation either. I'm trying to work out if these are specific to the Lightning implementation of Javascript, standard Javascript methods or something else that I should read for additional understanding:
  • When setting up asyncronous callback responses, there are 2 methods that I can't find in the Lightning documentation or with a Google search, so what are they native to?
    • getReturnValue()
    • getState()
  • When setting up a variable to run an apex method, there are methods which I have a similar issue with:
    • setParams()
  • ​In another module, 2 methods in the Helper class for a component call another method within the same Helper class with the "this." nomenclature. Given that these methods are all held in a map, is this a standard Javascript technique or something else?
If I've just missed stuff in the documentation, sorry! Feel free to tell me to RTM or link me to the appropriate resources.

Thanks!