BBjHtmlView::getText

Description

In BBj 7.0 and higher, this method returns the HTML code for the BBjHtmlView control.

Syntax

Return Value

Method

string

getText()

Parameters

None.

Return Value

Returns the underlying HTML code (i.e. text + HTML tags) for the BBjHtmlView control.

BUI logoDWC logoRemarks

In BUI and DWC, this returns only text that was set with setText.

Example

rem ' BBjHtmlView::getText()

client = 0
if (info(3,6)<>"5" and info(3,6)<>"6") then
    client = msgbox("BBjHtmlView Client",7+32+512,"BBjHtmlView","Swing","JavaFX","Chromium")
    switch client
        case 1; rem ' Swing
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=FALSE",ERR=*NEXT)
            break
        case 2; rem ' JavaFX
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
            break
        case 3; rem ' Chromium
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=TRUE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
            break
    swend
endif
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,400,200,"BBjHtmlView",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
html$ = "<html><head><style>p{margin:0;padding:0;}</style><title>BASIS</title></head>"
img$ = "https://www.basis.cloud/sites/basis.com/files/images/BusJGBetter.jpg"
html$ = html$ + "<body><img src="""+img$+""">"+$0a$
url$ = "https://documentation.basis.cloud/BASISHelp/WebHelp/bbjobjects/Window/bbjhtmlview/bbjhtmlview.htm"
html$ = html$ + "<p>This is a <a href="""+url$+""">BBjHtmlView</a>."
html$ = html$ + "</body></html>"
htmlview! = window!.addHtmlView(101,25,25,350,150,html$)
htmlview!.setCallback(htmlview!.ON_PAGE_LOADED,"page")
htmlview!.setCallback(htmlview!.ON_HYPERLINK_ACTIVATE,"event")
process_events

eoj:
release

page:
    event! = sysgui!.getLastEvent()
    i = msgbox(event!.getText(),32768,event!.getEventName())
    print htmlview!.getText()
return

event:
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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