BBjWebguiBridge is a plugin for BBj that provides a bridge to a Webswing Connector. It enables integration between BBj applications running in webswing and webforJ.
- Register and manage custom event callbacks between BBj and webforJ
- Send and receive custom events with payloads
- Simple API for integration with BBj applications
BBjWebguiBridge (see BBjWebguiBridge.bbj)
listenerMap!(HashMap): Stores event listeners by labelbridge!(WebguiBridge@): The underlying Webgui bridge instance
BBjWebguiBridge()
Initializes the bridge and listener map.
setCallback(BBjString callbackLabel$, CustomObject instance!, BBjString methodName$)
setCallback(String callbackLabel$, String methodName$)
Registers a callback for a custom event. Associates a listener with the event label and sets the callback in BBjAPI.
Parameters:
callbackLabel$: The label for the callback/eventinstance!: (optional) The object instance for the callbackmethodName$: The method to invoke on the callback
removeCallback(BBjString callbackLabel$)Removes a previously registered callback and its listener.
postCustomEvent(BBjString eventName!, String payload!)Posts a custom event to the bridge and therefore the webswing connector, sending the specified payload.
use ::BBjWebguiBridge/BBjWebguiBridge.bbj::BBjWebguiBridge
bridge! = new BBjWebguiBridge()
bridge!.setCallback("onCustomEvent", instance!, "handleEvent")
bridge!.postCustomEvent("onCustomEvent", "{" + """data""" + ":" + """Hello World """ + "}")
handleEvent:
json! = CAST(JsonObject, ev!.getObject())
print json!- BASIS BBj
- BASIS WebguiBridge Java library (
lib/webgui-bridge-25.03-SNAPSHOT.jar)
Default listener implementation: listeners/BBjWebguiDefaultListener.bbj