BBjWebEventOptions::getDebounce

Description

In BBj 24.00 and higher, this method returns true if BBjWebEventOptions::setDebounce was previously invoked.

Syntax

Return Value Method
boolean getDebounce()

Parameters

None.

Return Value

Returns true (1) if BBjWebEventOptions::setDebounce was previously invoked or returns false (0) if it was not previously invoked.

Remarks

By default, BBjWebComponent BBjWebEvents are not debounced; they are returned to the server immediately.

Example

rem ' BBjWebComponent Debounce & Throttle

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,300,300,"Debounce & Throttle",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

button! = window!.addWebComponent(101,25,25,250,25,"button")
button!.setText("Click Immediate")
button!.setAttribute("title","Click events are reported immediately")
button!.setCallback("click","event")
options! = button!.newEventOptions()
options!.setImmediate(); rem ' this is the default
System.out.println("getImmediate = " + Boolean.toString(options!.getImmediate()))

throttle! = window!.addWebComponent(102,25,75,250,25,"button")
throttle!.setText("Click Throttle")
options! = throttle!.newEventOptions()
options!.setThrottle(1000)
throttle!.setAttribute("title","Click events are throttled to once per second.")
throttle!.setCallback("click","event",options!)
System.out.println("getThrottle = " + Boolean.toString(options!.getThrottle()))
System.out.println("getDelay = " + str(options!.getDelay()))

debounce! = window!.addWebComponent(103,25,125,250,25,"button")
debounce!.setText("Click Debounce")
options! = debounce!.newEventOptions()
options!.setDebounce(1000,Boolean.TRUE,Boolean.FALSE)
debounce!.setAttribute("title","Click events are debounced to once per second.")
debounce!.setCallback("click","event",options!)
System.out.println("getDebounce = " + Boolean.toString(options!.getDebounce()))
System.out.println("getDelay = " + str(options!.getDelay()))
System.out.println("getLeading = " + Boolean.toString(options!.getLeading()))
System.out.println("getTrailing = " + Boolean.toString(options!.getTrailing()))

status! = window!.addStatusBar(99)

process_events

eoj:
  release

event:
  event! = sysgui!.getLastEvent()
  msg$ = date(0:"%Hz:%mz:%sz.%tz")
  msg$ = msg$ + " " + event!.getEventType()
  msg$ = msg$ + " " + event!.getControl().getText()
  status!.setText(msg$)
  System.out.println(msg$)
return

ClosedVersion History

  • BBj 24.00: BBjWebEventOptions::getDebounce added.

See Also

BBjAPI

BBj Object Syntax

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