0

I'm New to LWC and I'm trying to include tableau visualization with LWC. I have a combobox where I store all my tableau urls. On combobox change i'm chaning the url value but the view is not re-rendering for some reason.

Am I missing something here?

html:

<div class = "slds-var-m-around_medium">
        <lightning-combobox
        label="Select a report"
        value={vizUrl}
        placeholder="Select a report"
        options={vizOptions}
        onchange={handleVizChange}></lightning-combobox>
    </div>

    <template if:true={vizUrl}>
        <c-tableau-viz viz-url={vizUrl}></c-tableau-viz>
        </template>
</lightning-card>
</template>

javascript in lwc:

    import { LightningElement } from 'lwc';
    
    export default class TableauReports extends LightningElement {
    vizUrl;
        handleVizChange(event) 
        {
            this.vizUrl = event.detail.value;
        }
}
3
  • To compute a value for the property, use a getter
    – glls
    Jan 8 at 3:01
  • I tried adding the getter setter but it throws ' [Maximum call stack size exceeded]' error. @api vizUrl; get vizUrl() { return this.vizUrl; } set vizUrl(value) { this.vizUrl = value; }
    – New
    Jan 8 at 21:13
  • you should not name your getter and property the same.
    – glls
    Jan 9 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.