Edit/Display text as HTML in VLF command Handler

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Edit/Display text as HTML in VLF command Handler

Post by PhilA » Fri Feb 01, 2019 7:54 pm

Hi, first time post and currently in uncharted waters...

We have a VLF command handler where we display description text from in ISeries file. Ideally I would like to see the data in a HTML format on the command handler if the Text has been formatted with HTML tags.

I would like to amend this test using a 3rd party HTML editor by passing arguments (ie the Text Data) to the editor and then passing the HTML formatted text back to the command handler.

Has anyone done anything similar and if so can you suggest how this can be done.

Any help would be appreciated..

jyoung
Posts: 642
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Edit/Display text as HTML in VLF command Handler

Post by jyoung » Sat Feb 02, 2019 1:20 am

Hi and Welcome!

There is a VLF-ONE demo that uses QuillJS embedded in a widget.

https://docs.lansa.com/14/en/lansa048/c ... 8_7000.htm

You can find the implementation in DF_Note_QuillInterface widget and the DF_Note_NoteDetailPanel RP.

Hope this helps.
Joe

Pablo
Posts: 41
Joined: Wed Dec 02, 2015 10:35 am

Re: Edit/Display text as HTML in VLF command Handler

Post by Pablo » Sat Feb 02, 2019 2:30 am

Hi Phil,

You'd be thinking at writing a widget to wrap around the 3rd party editor.

The shipped VLF demo includes a Notes command handler - DF_Note_CommandHandler - attached to Places, Things and People in the Resources Application. The handler uses DF_Note_NoteDetailPanel which is the wrapper around the widget DF_Note_Quillinterface.

Open DF_Note_Quillinterface and look at the Resources tab. You can add external Javascript/css. I don't know the editor you will use but if you have to include external Javascript that's the way to do it.
If your editor is provided as a html page you would probably create an iFrame container to point to it.
If that's the case you would do that in the PROTOTYPE.onRealizeControl routine. Find that routine in the quill widget ... you'd see this

PROTOTYPE.onRealizeControl = function( parentDiv )

The parentDiv is passed as an argument to the widget and where you would append your manufactured child iFrame. Once the onRealizeControl has been executed it fires an Initialized event meaning the widget is now operational. See Evtroutine Handling(#DF_Note_QuillInterface.Initialize) in DF_Note_NoteDetailPanel.

Look also at the widget's definition tab where you define properties/methods/events to talk to the handler.
I suppose your widget would be quite similar in that you'd have a setContent where you pass the html from the iSeries and a getContent when the user has finished with editing that returns the contents as a string.

[while I was writing this I see that Joe beat me to it :)]

Regards,
Pablo

PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Re: Edit/Display text as HTML in VLF command Handler

Post by PhilA » Thu Feb 28, 2019 11:33 pm

Hi, Thanks fo the replies guys, will will review the demos...thanks

Post Reply