Skip to content

Problem with CurrPage.Test.Load #1

@rvveldhuyzen

Description

@rvveldhuyzen

Hi Erik,

First of all thank you for putting your time and effort in providing this nice example of how to integrate a small HTML Editor into BC!

I have been playing around with it and the example works fine as is. But afterI modified the CurrPage.Test.Load from hardcoded text to a text variable (or a field from a table) like:

        usercontrol("TextEdit"; "TextEditor")
        {
            ApplicationArea = All;
            trigger ControlReady()
            begin
                CurrPage.TextEdit.Init();
                //CurrPage.TextEdit.Load('This is a <strong>BOLD</strong> statement!');
                CurrPage.TextEdit.Load(NewText);  //<< NewText is a global text variable
            end;

the addin crashes with the following error (in Event Viewer):
"message": "Cannot read property 'setData' of undefined",

I have tried to find the cause. The only thing I found Googling around is that it could be a problem with Jquery but I have no idea what to do with this info and if this is true.

I also checked the history of your repository and noticed that you commited a change in the MainScript.js in the function Load:
image

After I reverted this change the CurrPage.TextEdit.Load worked fine with text coming from a variable.

Is there something I can do to prevent this error because there must be a good reason you decided to change Editor.setData instead of InputArea.value or was it just for the support of readonly?

Thank you in advance for your answer!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions