admin管理员组

文章数量:1287583

This is my first time to use Tableau and I want to embed it into Odoo 18 with custom module

This is my code for embed the Tableau on odoo 18 using javascript, but when want to catch the Authorization errors, I got Uncaught ReferenceError: TableauEventType is not defined

<?xml version="1.0" encoding="UTF-8" ?>
<template>
    <t t-name="tsel_tableau.TableauDashboard">
        <t t-set="title">Tableau Dashboard</t>
        <div class="container mt-4">
            <script type="module" src=".embedding.3.latest.min.js"></script>
            <script type="module" src=".embedding.3.1.0.min.js"></script>

            <tableau-viz id="tableauViz"
                src=";
                token="MY_TOKEN"
                onVizLoadError="handleLoadError">
            </tableau-viz>

            <script>
                function viz(){
                    console.log(1);
                    const tableauViz = document.getElementById('tableauViz');
                    tableauViz.addEventListener(TableauEventType.VizLoadError, handleLoadError);

                    function handleLoadError(e){
                        console.log(2);
                    }
                }

                viz();
            </script>

        </div>
    </t>
</template>

This is i got the error

I have read Tableau documentation, and follow the instruction but still not work. This is link doc : .html#improved-error-handling-for-connected-apps

本文标签: