Using Virtual Clipboard between VLF-One and RAMP-TS

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
PatrickF
Posts: 30
Joined: Thu Nov 26, 2015 1:31 pm

Using Virtual Clipboard between VLF-One and RAMP-TS

Post by PatrickF »

I am working on a project to rewrite a small VLF-Web RAMP-TS2 engine application in VLF-One with RAMP-TS2. One of the requirements is to pass values to RAMP via the virtual clipboard. I have reviewed the VLF-One differences as documented http://bit.ly/2jghXMO
However, I cannot get the script example in the documentation to work, so the clipboard value is restored.
In a method invoked from avMainWindowReady in my VLF One IIP I have this line :
#AvFrameworkManager.avSaveValue Withid1('TSTM92337') Withid2('A') WithID3('B') Instance(3)InLanguage(ENG) FromAvalue('CLIPDATA')

In the MainLogin junction screen in RAMP, I have copied and pasted the AVRESTOREAVALUE and the vHandle_AVCLIPBOARDEVENT function per the documentation just like this :
AVRESTOREAVALUE("Not found", "TSTM92337", "A","B",3, "ENG") ;, and added some trace statements for a RAMP Trace. However, the virtual clipboard values are not restored. The RAMP trace extract is shown below :
VLF One Trace.png
VLF One Trace.png (23.53 KiB) Viewed 6833 times
I have 2 questions :
1) What causes the AVCLIPBOARDEVENT event to fire ? Is it the Page Arrival or the AVRESTORE statement ? If I wanted to restore multiple different values from the clipboard, would the event fire for each AVRESTOREAVALUE RAMP statement ?
2) How can I see what is in the virtual clipboard for VLF-One ? The documentation tells me that the virtual clipboard is in the browser's local storage. In VLF-Win, the virtual clipboard is in a text file on the PC so easy to locate and debug. Has anyone got some shareable code that dumps the virtual clipboard to a screen or file ?
PatrickF
Posts: 30
Joined: Thu Nov 26, 2015 1:31 pm

Re: Using Virtual Clipboard between VLF-One and RAMP-TS

Post by PatrickF »

I can report that I got it working. The VLF-One IIP writes to the virtual clipboard, the RAMP MainLogin AVCLIPBOARDEVENT restores the values to an objGlobal and I set a USERENV property so Axes can use the value to control the 5250 screen presentation. Based on the Trace Log, this is what I think I learned :

1) The AVCLIPBOARDEVENT appears in the trace before the NAVIGATETO runs. The NAVIGATETO has the AVRESTOREAVALUE statement, so its not clear to me what causes AVCLIPBOARDEVENT to wake up
2) The assignment of the objGlobal needs to happen in the AVCLIPBOARD using a switch that tests the id1/id2/id3 combination. You don’t use the traditional objGlobal.clipboardval = AVRESTOREAVALUE to assign to a local variable . This wasn’t explained well in the documentation. My modification of the shipped example is shown
AVCLIPBOARDEVENT.png
AVCLIPBOARDEVENT.png (25.28 KiB) Viewed 6812 times
3) The USERENV object isn’t defined in the AVCLIPBOARDEVENT, so my workaround was to set the objGlobal value in MainLogin and then set the USERENV in the screen that arrived after MainLogin , such as OS400MainMenu. This worked
Post Reply