Hot answers tagged

6

You only need to declare @AuraEnabled once per type, if you use the comma operator to define multiple variables. In your case, you could write it as: @AuraEnabled public String var1, var3, var4; @AuraEnabled public Decimal var2; You do not need to add explicit default getter-setter { get; set; } in order for the variables to be accessible (this is a ...


5

I am learning LWC, and I found out that I should not use as it's ECMASCRIPT 7 which means that it's using templates, shadow dom, web components and most of browsers are not ready for that. LWC polyfills everything not supported by the browser. There is no risk in using LWC, as all supported browsers will support LWC for now, and in the future. As browsers ...


3

Here is an answer: Fix methods in core/main.js var matchesMethod = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.msMatchesSelector; var closestMethod = Element.prototype.closest || function (selector) { var el = this; if (!document.documentElement.contains(el)) { return null; } do { ...


3

It's not supported for Quick Actions as mentioned here. There's an idea to support this that I suggest voting on. Unsupported Experiences and Tools Lightning Web Components doesn’t currently support these Salesforce experiences and tools. To use a Lightning web component with these experiences and tools, wrap the component in an Aura component. ...


3

Just be careful... the use of LWC is clearly a good thing to do in the future, but if it is like aura technology, that took months/years to be stable & mature despite the great announcements , beware of ascending compatibility breaks by Salesforce platform upgrades, like it happened with : LockerService in the past (almost everything to recode) ui: ...


2

Yes, this is allowed. Component's find will return either undefined (no values), an object (one value), or a list (two or more values). There's a small bug that I'm not sure was ever fixed where changing multiple items like this might result in find returning a list consisting of a single element, so you may need to prepare for that by checking if there's a ...


2

You cannot modify the lighting experience theme as you would a lightning community, you can create content layouts, however, these, as you pointed out only appear below the header on top of the lighting experience background (or without the header, depending on your use case). So, at the moment, this is not possible.


1

In JavaScript, sync and async lines are handled differently. In the JS event loop first sync events are handeled, after which on a diffrent thread, async events are handled. It becomes important to pass context in JavaScript. Use .bind(this) for your setInterval anonymous function so that context will be maintained.


1

component <aura:component> <aura:attribute name="options1" type="List" default="['1','2','3']"/> <aura:attribute name="options" type="List" default="[{'label': '', 'value': 'option1'}]"/> <aura:attribute name="value" type="String" default="option1"/> <aura:iteration items="{!v.options1}" var="organization"> &...


1

The value attribute should contain the HTML: JS: import { LightningElement, track} from 'lwc'; export default class testLwc extends LightningElement { @track htmlValue; handleChange(event) { console.log(event.target.value); } } Template <template> <lightning-input-rich-text value={htmlValue} onchange={...


1

Am I doing anything wrong? Yes. Simply, while JavaScript supports this syntax, "Aura Expressions" do not. You need to mix the data together such that you can resolve it without using the "dynamic" notation, which means copying the value in a way that you can access it directly from obj. Without seeing your code, it's hard to make a specific ...


1

Use a lightning:layout. It supports 12 columns, so you might choose to split them such as 4-8 or 3-9 (etc) to suit your needs. <lightning:layout> <lightning:layoutItem size="4"> <c:component1/> </lightning:layoutItem> <lightning:layoutItem size="8"> <c:component2/> <c:component3/> </lightning:...


Only top voted, non community-wiki answers of a minimum length are eligible