BUI logoDWC logoBBjWebManager::newEventOptions

Description

In BBj 24.11 and higher, this method returns a BBjWebEventOptions object that can be used to configure event callback options for a subsequent BBjWebManager::setCallback.

Note:

In BBj 22.03 and higher, BBjWebManager is an alias for BBjBuiManager.

Syntax

Return Value Method
BBjWebEventOptions newEventOptions()

Parameters

None.

Return Value

Returns a BBjWebEventOptions object that can be used to configure event callback options for a subsequent BBjWebManager::setCallback.

Example

rem ' BBjWebManager WebEvents

sysgui = unt
open (sysgui)"X0"
title$ = "BBjWebManager WebEvents"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,800,100,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
status! = window!.addStatusBar(99)
status!.setText("Resize browser to see WebEvents")

web! = bbjapi().getWebManager(err=oops)
web!.setCallback(web!.ON_BROWSER_CLOSE,"eoj",err=oops)

options! = web!.newEventOptions()
options!.addItem("innerWidth","event.target.innerWidth")
options!.addItem("innerHeight","event.target.innerHeight")
options!.addItem("outerWidth","event.target.outerWidth")
options!.addItem("outerHeight","event.target.outerHeight")
web!.setCallback("resize","webevent",options!)

web!.setCallback("focus","webevent")
web!.setCallback("blur","webevent")

process_events

oops:
  i = msgbox(errmes(-1))
eoj:
  release

webevent:
  event! = sysgui!.getLastEvent()
  eventMap$ = event!.getJsonString()
  eventMap$ = ""
  map! = event!.getEventMap()
  iterator! = map!.keySet().iterator()
  while iterator!.hasNext()
    key$ = iterator!.next()
    value! = map!.get(key$)
    value$ = String.valueOf(value!)
    eventMap$ = eventMap$ + key$ + "=" + value$ + " "
  wend
  msg$ = date(0:"%Hz:%mz:%sz.%tz ")+event!.getEventName()
  msg$ = msg$ + " " + event!.getEventType()
  msg$ = msg$ + " " + eventMap$ 
  status!.setText(msg$)
return

ClosedVersion History

  • BBj 24.11: BBjWebManager::newEventOptions added.

See Also

BBjAPI

Object Variables

BBjWebManager::setCallback

PROCESS_EVENTS Verb

BBj Custom Objects Tutorial

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