Questions tagged [track]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
578 views

Concatenate two Values in a LWC (Lightning Web Component)

I am currently grabbing field values from a Lead and displaying them onto a LWC. I am having trouble taking two values and placing them into a variable. Here is my JS: // ********************* // ...
3
votes
1answer
139 views

@track array of objects

Let's say I have @track dataSource[] which contains objects {id,price} Why if I for example change the value this.dataSource[1].price = 1234; i can't get changes in markup? Markup <lightning-...
6
votes
1answer
113 views

Basic Question about @track decorator

I have a (probably very) basic question about @track decorator. I modified the helloExpressions LW Component from Sample Gallery as below. Here the values FirstName and lastName are no longer ...
1
vote
2answers
967 views

LWC tracked variable not changing page

Hello so i am building my component which is suppose to display list. I am using foreach and tracked variable. So here is component html: <template> QuoteLevel {num} <lightning-button-...
0
votes
2answers
970 views

LWC: @track binding won't refresh component on value change

I have a component that picks up the value originally from the JS controller but won't refresh after I modify the value in the JS file. Component: <template> <div class={...
1
vote
1answer
178 views

LWC Access denied error referencing namespace problem

We have a JavaScript utility class containing two properties, like: class DateRange { start; end; constructor(start, end) { this.start = dateToIsoDateLocal(start instanceof Date ?...
0
votes
1answer
772 views

A @track decorator can only be applied to a public field

I'm getting the following error from Salesforce whenever I try to create a Lightning Web Component app: Action.prototype.finishAction Error [Error in $A.getCallback() [Assert Violation: Compiler ...
5
votes
1answer
839 views

Array.push() on a @tracked array doesn't cause component refresh in lightning-accordion in LWC

This may be a duplicate of Array.push() won't update Lightning Web Component View However, that is for an @wire case, while this is for lightning-accordion. I am attempting to use the lightning-...
6
votes
1answer
6k views

Array.push() won't update Lightning Web Component View [duplicate]

We are migrating over to Lightning Web Components in the last couple of weeks now and we had some struggles with the arrays in Javascript. On a trackable array, when I call push in a wiredMethod, ...