F5 - UI refresh from code


In the Notes client you can refresh the UI by pressing the F5 (F9) button.

This means for a document the UI document gets recalulated and updated.


There are methods to something similar in code, UI.reload, UI.refresh etc,
In the backend document you can call doc.computewithform, but my experience is that with a complicated form with maybe both LotusScript and Formulas it will often fail.

Sometimes you just need a simple F5 refresh to update the document...because it works.

So here is a way to make a F5 refresh from LotusScript and Java.

Java:
System.setProperty("java.awt.AWTPermission", "createRobot");
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_F5);
robot.keyRelease(KeyEvent.VK_F5);

LotusScript:
Dim mySession As JAVASESSION
Dim Systemclass As JAVACLASS
Dim RobotClass As JAVACLASS
Dim robotObject As Javaobject
Set mySession = New JavaSession ()
Set SystemClass = mySession.GetClass("java.lang.System")
Set RobotClass = mySession.GetClass("java.awt.Robot")
Call SystemClass.setProperty("java.awt.AWTPermission", "createRobot")
Set robotObject = RobotClass.Createobject()
robotObject.keyPress(
116)
robotObject.keyRelease(
116)

You really do not need to call
System.setProperty("java.awt.AWTPermission", "createRobot");
to make the code work.
However for other Robot functionality, you will need it, so it is just show you how to


Posted on 03/27/2025 01:59:57 PM CET