Project

General

Profile

HYPERLINK Browse Cell Option

One can turn cells of the specific browse column into hyperlinks. By specifying the browse column option HYPERLINK "event-name" the associated column's cells turn into clickable links that when clicked will implicitly PUBLISH "event-name" and pass the cell's current value as a single character parameter. Sample:

DEFINE BROWSE br QUERY q 
DISPLAY 
     tt.f1 hyperlink "column1" 
     tt.f2 hyperlink "column2" 
     tt.f3
     WITH size-chars 60 by 10 TITLE "Static browse" separators.

PROCEDURE column1:
  DEFINE INPUT PARAMETER val AS CHARACTER NO-UNDO.

  MESSAGE "The cell from Column 1 was clicked: " + val.
END.

PROCEDURE column2:
  DEFINE INPUT PARAMETER val AS CHARACTER NO-UNDO.

  MESSAGE "The cell from Column 2 was clicked: " + val.
END.

subscribe to "column1" anywhere run-procedure "column1".
subscribe to "column2" anywhere run-procedure "column2".

The SUBSCRIBE does not need to be in the same program that is enabling the hyperlinking (and thus which is doing the PUBLISH). This works the same way that any named event (PUBLISH/SUBSCRIBE) works in the 4GL.

The conversion changes are not enough to enable this feature. In order to turn on this ability at runtime, one must set the following directory parameter which globally enables this ability for the application, under /server/{default|<server_name>}/enhancedBrowse/{desktop|embedded}/:

<node class="boolean" name="hyperlinking">
   <node-attribute name="value" value="TRUE"/>
</node>

If the browse is editable, then left click on a hyperlink cell starts editing of the cell, while ctrl+left click fires the hyperlink event.. In a non-editable browse, a single left click fires the hyperlink event.


© 2019 Golden Code Development Corporation. ALL RIGHTS RESERVED.