BBjNamespace::setCallbackForNamespaceChange

Description

In BBj 3.00 and higher, this method sets a callback that will be called if any Named Object within this BBjNamespace is changed.

Syntax

Return Value Method
void setCallbackForNamespaceChange(String varName, String callbackName)
void setCallbackForNamespaceeChange(String varName, CustomObject customObj, String methodName)
void setCallbackForNamespaceChange(String varName, Object object, String methodName)

Parameters

Parameter Description
callbackName Specifies the name of the callback to be called when the namespace changes.
customObj Specifies a CustomObject that has a method which is to be called when namespace changes.
methodName Specifies the method of the Object which is to be called.
object Specifies a Java Object that has a method which is to be called when the namespace changes.

Return Value

None.

Remarks

All callbacks that a program registered on a BBjNamespace are removed when that program executes START, STOP, END, or BEGIN. All callbacks registered by a BBj process are removed when the BBj process terminates.

Example

namespace! = BBjAPI().getNamespace("test","test",1)

rem 'set a callback that will be called if *any* value in namespace changes
namespace!.setCallbackForNamespaceChange("callback")

rem 'remove the callback
namespace!.removeCallbackForNamespaceChange()
end

callback:
    print "some value in ", namespace!.getName(), " has changed"

ClosedVersion History

  • 25.03: Previously, this method could only accept a BBj CustomObject, but can now take any Java Object as a parameter.

See Also

BBjAPI

BBjNamespace

BBjNamespaceEvent

Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.