BBjHtmlView
Description
The BBjHtmlView control displays HTML files, and can act as a complete embedded web browser, with support for HTML5, CSS, and JavaScript.
The BBjHtmlView can be configured through STBL options to be either a basic container for static HTML 3.2 content, or a complete embedded Chromium-based browser. See STBL Options for BBjHtmlView below.
Access to the CHROMIUM_HTMLVIEW feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.
The WEBGUI_HTMLVIEW feature is only available in the WEBGUI client, and requires a WEBGUI BLS license.
Implemented Interfaces
DragSource, DropTarget, Focusable, TabTraversable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjHtmlView
A BBjHtmlView object is created through the following BBjWindow methods:
Return Value | Method |
---|---|
BBjHtmlView |
addHtmlView(int ID, number x, number y, number w, number h, string html) |
BBjHtmlView |
addHtmlView(int ID, number x, number y, number w, number h, string html, string flags) |
BBjHtmlView |
addHtmlView(int ID, number x, number y, number w, number h, string html, string flags, string chromium_switches$) |
BBjHtmlView |
addHtmlView(int ID, String html) |
BBjHtmlView |
addHtmlView(int ID, String html, string flags) |
BBjHtmlView |
addHtmlView(int ID, String html, string flags, string chromium_switches) |
BBjHtmlView |
addHtmlView(String html) |
BBjHtmlView |
addHtmlView(String html, string flags) |
BBjHtmlView |
addHtmlView(String html, string flags, string chromium_switches) |
Methods of BBjHtmlView
Return Value | Method |
---|---|
int | executeAsyncScript(String script) |
int | executeAsyncScript(String script, boolean await) |
int | executeAsyncScript(String script, boolean await, boolean event) |
Object | executeScript(String script) |
Object | executeScript(String script, boolean await) |
boolean |
|
string |
|
string |
|
string | getDownloadDirectory() |
getImage() |
|
string |
getText() |
string |
getUrl() |
string |
|
void |
injectScript(String script) |
void |
injectScript(String script, boolean top) |
void |
injectUrl(String url) |
void |
injectUrl(String url, boolean top) |
boolean |
print() |
void |
setAutoNavigate(boolean autoNavigate) |
void | setDownloadDirectory(String directory) |
void |
setUrl(String url) |
void |
setUrl(String url, String loader) |
void |
setUserAgent(String userAgent) |
Methods of BBjHtmlView implemented for DragSource
Methods of BBjHtmlView implemented for DropTarget
Methods of BBjHtmlView implemented for Focusable
Methods of BBjHtmlView implemented for TabTraversable
Methods of BBjHtmlView inherited from BBjControl
Constants inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
---|---|---|---|
ON_DROP_TARGET_DROP |
D |
||
ON_GAINED_FOCUS |
f |
||
ON_EXECUTE_SCRIPT |
x |
||
ON_HTMLVIEW_DOWNLOAD |
BBjHtmlViewDownloadEvent | HtmlView Download Event | x |
ON_HYPERLINK_ACTIVATE |
x |
||
ON_HYPERLINK_ENTER |
x |
||
ON_HYPERLINK_EXIT |
x |
||
ON_LOST_FOCUS |
f |
||
ON_MOUSE_ENTER |
E |
||
ON_MOUSE_EXIT |
E |
||
ON_NATIVE_JAVASCRIPT |
x |
||
ON_PAGE_LOADED |
x |
||
ON_POPUP_REQUEST |
r |
||
ON_RIGHT_MOUSE_DOWN |
R |
||
ON_SCRIPT_FAILED |
x |
||
ON_SCRIPT_LOADED |
x |

BUI CSS
The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.
The BBjHtmlView control is a <div> containing a content field with a class name of .BBjHtmlView-content. If the content is set using setUrl(), it is an <iframe>. If the content is set using setText(), it is a <div> containing the specified HTML. The BBjHtmlView defines the following CSS style names:
.BBjHtmlView (the top level control)
.BBjHtmlView-content (the content, either an iframe or a div)
.BBjHtmlView.bbj-disabled (the control is disabled)
STBL Options for BBjHtmlView
The BBjHtmlView can be configured through STBL options to be either a basic container for static HTML 3.2 content, or a complete embedded Chromium-based browser. Using the Chromium browser engine is limited to the operating systems and platforms on which the Chromium engine is supported.
The STBL("!OPTIONS") CHROMIUM_HTMLVIEW and STBL("!OPTIONS") WEBGUI_HTMLVIEW options can be used to select a specific BBjHtmlView content engine.
Access to the CHROMIUM_HTMLVIEW feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.
The WEBGUI_HTMLVIEW feature is only available in the WEBGUI client, and requires a WEBGUI BLS license.
If the Chromium-based BBjHtmlView is used, the STBL("!CHROMIUM_SWITCHES") string can specify an arbitrary number of space-delimited Chromium command-line switches (e.g. "--remote-debugging-port=9223 --lang=de"). These switches are passed on to CHROMIUM_HTMLVIEW BBjHtmlView clients, unless the version of the addHtmlView method that explicitly specifies the chromium_switches$ parameter is used.
Version History
- BBj 25.00: Removed the STBL("!OPTIONS") JAVAFX_HTMLVIEW option and added the STBL("!OPTIONS") WEBGUI_HTMLVIEW option.
- BBj 24.11: Added an optional event argument for executeAsyncScript.
- BBj 23.04: Added an optional await argument for executeScript and executeAsyncScript.
- BBj 19.10: Added the STBL("!CHROMIUM_SWITCHES") option and executeAsyncScript.
- BBj 19.00: Added the STBL("!OPTIONS") CHROMIUM_HTMLVIEW option.
- BBj 16.00: Added executeScript.
- BBj 15.00: Added the STBL("!OPTIONS") JAVAFX_HTMLVIEW option.
- BBj 7.00: BBjHtmlView first introduced.
Example
See Also
CALLBACK Verb - Register BBj Subroutine
STBL("!OPTIONS") CHROMIUM_HTMLVIEW
STBL("!OPTIONS") WEBGUI_HTMLVIEW
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.