wjPopup with Knockout Binding gives console error on updating to Wijmo 5.20232

Posted by: dev on 11 March 2024, 2:48 pm EST

    • Post Options:
    • Link

    Posted 11 March 2024, 2:48 pm EST - Updated 11 March 2024, 2:54 pm EST

    We encountered this error following an update to Wijmo ‘5.20232.939’ from ‘5.20202.699’.

    Here is an example demonstrating when the error occurs. We have used a wjPopup binding, and in the JS viewmodel, a knockout observable was utilized before applying the binding. This triggers the appearance of a console error. It appears to be specific to the wjPopup component. The error says ‘You cannot apply bindings multiple times to the same element’.

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="utf-8" />
        <link href="https://cdn.mescius.com/wijmo/5.20232.939/styles/wijmo.min.css" rel="stylesheet" />
    </head>
    
    <body>
        <div data-bind="wjPopup:{}"></div>
    
        <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/controls/wijmo.min.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/controls/wijmo.input.min.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/interop/knockout/wijmo.knockout.min.js"></script>
        <script>
            this.model = {
                dialog: ko.observable()
            }
            ko.applyBindings(this.model);
        </script>
    </body>
    </html>

    Attaching a screenshot of the console error and an HTML file containing the above-mentioned example, the error can be found in the browser console by simply opening the file.

  • Posted 13 March 2024, 9:16 am EST

    Hi,

    Sorry for the delayed response, we are investigating this issue, and update you soon on it’s progress. For now, to avoid this issue you can set the ‘removeOnHide’ property of the popup to true.

    Please refer to the following code snippet -

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="utf-8" />
        <link href="https://cdn.mescius.com/wijmo/5.20232.939/styles/wijmo.min.css" rel="stylesheet" />
    </head>
    
    <body>
        <div data-bind="wjPopup:{removeOnHide: true}"></div>
    
        <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/controls/wijmo.min.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/controls/wijmo.input.min.js"></script>
        <script src="https://cdn.mescius.com/wijmo/5.20232.939/interop/knockout/wijmo.knockout.min.js"></script>
        <script>
            this.model = {
                dialog: ko.observable()
            }
            ko.applyBindings(this.model);
        </script>
    </body>
    </html>

    Regards

  • Posted 14 March 2024, 1:24 am EST

    Hi,

    We have forwarded this issue to the dev team for further investigation, with internal tracking ID - WJM-33546, We will update you when we have some update from the dev team.

    Regards

  • Posted 19 March 2024, 3:30 pm EST

    Thanks, in the meantime we are using the removeOnHide workaround you provided in order that we can upgrade. It does require another change, to move .show() before any initialization of the dialog state, but it does work. Looking forward to the fix so we can remove these workarounds.

  • Posted 20 March 2024, 12:22 am EST

    Hi,

    The dev team is working on this issue, we will update you when we have some updates from the dev team.

    Regards

  • Posted 9 July 2024, 8:00 am EST

    Hi, any updates on a fix for this from the dev team?

  • Posted 10 July 2024, 7:28 am EST

    Hi,

    The support for KnockoutJS is ending from our next major release, i.e. 5.2024v2, as mentioned in the planned changes in release notes of our previous major release. Here is the blog link for your reference - https://developer.mescius.com/blogs/wijmo-2024-v1-has-landed#:~:text=Wijmo%20KnockoutJS%20Support%20End%20of%20Life%20Announcement

    We are confirming it with the dev team, if the fix for this issue will be included in upcoming releases or not. We will let you know soon.

    Regards

  • Posted 12 July 2024, 12:58 am EST

    Hi,

    The dev team has confirmed that as the support for KnockoutJS has ended and from 2024 v2 we will no longer publish the package, hence this case will not be fixed.

    You may continue to use the workaround that your are using to avoid this issue.

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels