Add dynamic report in WYSIWYG editor

Hi
I want to create a assessment report which a user creates and submit it (to DB, export to PDF, etc.) using WYSIWYG editor. I have templates/formats of the report in the form of several statements and want to create links/buttons to click which adds the text/lines in the editor to prepare the report.

Tried searching in the community and in docs but could not find a proper answer. Please advise.

1 Like

Any suggestion from anyone?

I’m not sure what you mean. Is it that you have a bank of phrases, paragraphs etc. that you want displayed as buttons that, when clicked, insert to the cursor position in the text editor?

That is correct.
I want the users to choose text phrases from the links/buttons to create the report in the text editor.

Use a textarea with Summernote enabled.
You could have a DB table that contains a set of statements, create a Server Connect query to retrieve them. Once retrieved, use a repeat to create a button for each - set the dynamic attribute of innertext to the statement. Then set the dynamic click event for the button to insert text (the repeat statement value) into the editor.

Tried the above steps. The buttons are generating but the dynamic click event to insert text is not working. Receiving below error in console.

TypeError: this.editor.insertText is not a function
at n.insertText (summernote.js:496)
at Object.data.<computed> (BaseComponent.js:475)
at parser.js:714
at parser.js:455
at Object.dmx.parse (parser.js:388)
at HTMLButtonElement.<anonymous> (on.js:9)
at HTMLButtonElement.n (appConnect.js:472)
at HTMLButtonElement.dispatch (jquery-3.3.1.slim.min.js:2)
at HTMLButtonElement.v.handle (jquery-3.3.1.slim.min.js:2)

I tried other dynamic events for summernote and getting similar error for each function.
I am working on NodeJS.

Any advice?

EDIT: Attached screenshots

Several features of the Summernote editor were missing when it was initially added to Wappler, and I don’t think there has been any development since then. Some of these features were discussed here. It would certainly be useful if the missing features were added at some point.

Saw your earlier post, the insert text dynamic event is an issue since long.
Is there any way around to this? perhaps code changes or something else?

I don’t think there is a way to do this in Wappler, at least at the moment (and at least as far as I know). This example might be a solution.

I’m not sure if there is a point where features like this become bugs to be reported, or if they are just features which have not been implemented, or perhaps forgotten about.

Thank you. I will try to work with the example.

Tom, if there is a feature in Wappler UI which produces errors in the console when used, this means it is integrated but there’s a bug obviously :slight_smile:

Ah, that’s a shame it’s got an issue. Hopefully it will be resolved soon for you.

The example works well for a simple textarea, but not for summernote.

Hope @patrick can resolve this soon.

I’ve added a report about this issue.

2 Likes

Solved here