&<img src="../resources/images/opentocr.png" title="Open Contents list" border="0"&>
You are here:

2.26.2 iHelpHandler Interface

A flexible way of creating independent (i.e. not stored in the repository) help for components is to use the iHelpHandler interface.
Using the iHelpHandler interface you have the option of implementing whatever help mechanism you like.  You simply need to plug in the appropriate piece of code and the help will be routed via a mechanism that sends notification that help was requested on a particular component. What you do after this is entirely up to you.
This example form implements the iHelpHandler Interface. When F1 is pressed, the focus component will determine whether it is implementing the help interface. If not, help will be handled through the normal automated repository help. If it is, the ProcessHelpRequest method will be executed.

In the following code the Find_Tag method receives a reference to the control that currently has focus. In the example, the ComponentTag property of the requesting component is used to determine the what help to show. If the component has a blank tag, the Handled map on the method is left as false, indicating to LANSA that help should go through the normal channels. However, if the component tag is not blank, it is displayed in a message box. Once control is returned from the message box to the form, the Handled map is set to True indicating that normal repository help should not be shown.
Note that this example uses RDMLX:
Mthroutine Name(Find_Tag) Help('Find a tag for the current control.  Use Parent chain to resolve if none specified') Access(*Private)
Define_Map For(*Input) Class(#prim_objt) Name(#i_Requestor) Pass(*by_reference)
Define_Map For(*Result) Class(#prim_alph) Name(#o_tag)